利用SteamVR中的ITeleportPoint实现场景中的场景跳转

 teleport point的属性Teleport Type为Switch To New Scene,Switch To Scene属性面板跳转场景的名字。将要跳转的场景build在一起File -> Build Settings -> Scenes In Build,把相应的场景拖进去。还需要在Teleport Point脚本中添加一句代码:

		//-------------------------------------------------
		public void TeleportToScene()
		{
			if ( !string.IsNullOrEmpty( switchToScene ) )
			{
			    SceneManager.LoadScene(switchToScene);
                Debug.Log("<b>[SteamVR Interaction]</b> TeleportPoint: Hook up your level loading logic to switch to new scene: " + switchToScene );
			}
			else
			{
				Debug.LogError("<b>[SteamVR Interaction]</b> TeleportPoint: Invalid scene name to switch to: " + switchToScene );
			}
		}
发布了112 篇原创文章 · 获赞 40 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/chh19941125/article/details/102504745