private void Start()
        {
            roomSceneManager = (RoomSceneManager)NetworkRoomManagerExt.singleton.sceneManager;
            roomSceneManager.SetPlayer(this);
            if (isLocalPlayer)
            {
                NetworkRoomManagerExt.singleton.roomPlayer = this;


                rig.AddComponent <OVRCameraRig>();
                OVRManager ovrmanager = rig.AddComponent <OVRManager>();
                ovrmanager.trackingOriginType = OVRManager.TrackingOrigin.FloorLevel;

                ovrHeadsetEmulator        = rig.AddComponent <OVRHeadsetEmulator>();
                ovrHeadsetEmulator.opMode = OVRHeadsetEmulator.OpMode.AlwaysOn;


                Camera cameraComponent = camera.AddComponent <Camera>();
                camera.AddComponent <AudioListener>();
                camera.tag = "MainCamera";
                cameraComponent.nearClipPlane = 0.2f;
                // cameraComponent.nearClipPlane = 0.45f;
                cameraComponent.cullingMask = ~(1 << 9);
                for (int i = 0; i < models.Length; i++)
                {
                    models[i].layer = 9;
                }
                body.tag = "Player";
                for (int i = 0; i < hands.Length; i++)
                {
                    hands[i].tag = "Hand";
                }

                //StartCoroutine(cDoWaitTime(1f,()=>
                //{
                //    gameObject.AddComponent<OVRPlayerController>();
                //    gameObject.AddComponent<OVRSceneSampleController>();
                //}));

                CmdSetPlayerZeroPos(PlayerPrefs.GetFloat("PlayerYZeroPos"));
            }

            rig.SetActive(true);
        }
Beispiel #2
0
 public SocketEventHandler(RoomSceneManager manager)
 {
     roomSceneManager = manager;
 }
Beispiel #3
0
 // Update is called once per frame
 void Switch()
 {
     RoomSceneManager.ChangeScene(this, sceneName);
 }