Beispiel #1
0
        public virtual void SceneManager_activeSceneChanged(Scene from, Scene to)
        {
            StartCoroutine(GetMainCamera());
            StartCoroutine(Get360Managers());
            var vrPointers = to.name == "GameCore" ? Resources.FindObjectsOfTypeAll <VRPointer>() : Resources.FindObjectsOfTypeAll <VRPointer>();

            if (vrPointers.Count() == 0)
            {
                Logger.Log("Failed to get VRPointer!", LogLevel.Warning);
                return;
            }

            var pointer = to.name != "GameCore" ? vrPointers.First() : vrPointers.Last();

            if (_moverPointer)
            {
                Destroy(_moverPointer);
            }
            _moverPointer = pointer.gameObject.AddComponent <CameraMoverPointer>();
            _moverPointer.Init(this, _cameraCube);

            if (to.name == "GameCore" && Config.movementScriptPath != String.Empty && Config.movementAudioSync)
            {
                AddMovementScript();
                Logger.Log($"Add MoveScript \"{Path.GetFileName(Config.movementScriptPath)}\" successfully initialized! {Convert.ToString(_cam.cullingMask, 16)}");
            }
        }
        private void Start()
        {
            if (PluginConfig.Instance.ScreenFillBlack)
            {
                _renderTexture         = new RenderTexture(Screen.width, Screen.height, 24);
                _screenCameraBehaviour = this.gameObject.AddComponent <ScreenCameraBehaviour>();
                _screenCameraBehaviour.SetCameraInfo(new Vector2(0, 0), new Vector2(Screen.width, Screen.height), -2000);
                _screenCameraBehaviour.SetRenderTexture(_renderTexture);
            }

            ShaderLoad();
            _cameraMovePointer = this.gameObject.AddComponent <CameraMoverPointer>();
            CameraUtilities.AddNewCamera(Plugin.MainCamera);
            MultiplayerSessionInit = false;

            externalSender = new GameObject("ExternalSender").AddComponent <ExternalSender>();
            externalSender.transform.SetParent(transform);

            if (CustomUtils.IsModInstalled("VMCAvatar"))
            {
                existsVMCAvatar = true;
            }
            _webCamTexture = new WebCamTexture();
            webCamDevices  = WebCamTexture.devices;
        }
Beispiel #3
0
        public virtual void SceneManager_activeSceneChanged(Scene from, Scene to)
        {
            StartCoroutine(GetMainCamera());
            StartCoroutine(Get360Managers());
            var vrPointers = to.name == "GameCore" ? Resources.FindObjectsOfTypeAll <VRPointer>() : Resources.FindObjectsOfTypeAll <VRPointer>();

            if (vrPointers.Count() == 0)
            {
                Logger.Log("Failed to get VRPointer!", LogLevel.Warning);
                return;
            }

            var pointer = to.name != "GameCore" ? vrPointers.First() : vrPointers.Last();

            if (_moverPointer)
            {
                Destroy(_moverPointer);
            }
            _moverPointer = pointer.gameObject.AddComponent <CameraMoverPointer>();
            _moverPointer.Init(this, _cameraCube);

            if (to.name == "GameCore")
            {
                SharedCoroutineStarter.instance.StartCoroutine(Delayed_activeSceneChanged(from, to));
            }
            else
            if (Config.movementAudioSync || (!Config.movementAudioSync && Config.movementScriptPath == string.Empty))
            {
                ClearMovementScript();
            }
        }
Beispiel #4
0
        public virtual void SceneManager_activeSceneChanged(Scene from, Scene to)
        {
            StartCoroutine(GetMainCamera());
            StartCoroutine(Get360Managers());
            var vrPointers = to.name == "GameCore" ? Resources.FindObjectsOfTypeAll<VRPointer>() : Resources.FindObjectsOfTypeAll<VRPointer>();
            if (vrPointers.Count() == 0)
            {
                Logger.Log("Failed to get VRPointer!", LogLevel.Warning);
                return;
            }

            var pointer = to.name != "GameCore" ? vrPointers.First() : vrPointers.Last();
            if (_moverPointer) Destroy(_moverPointer);
            _moverPointer = pointer.gameObject.AddComponent<CameraMoverPointer>();
            _moverPointer.Init(this, _cameraCube);
        }