コード例 #1
0
        void Init()
        {
            if (initd)
            {
                return;
            }
            if (_instance == null)
            {
                _instance = this;
                DontDestroyOnLoad(this);
                //because i'm paranoid
                DontDestroyOnLoad(this.gameObject);

                CVRInput = OpenVR.Input;
                SVRHelper.InitializeTemporarySession();
                var fi = new System.IO.FileInfo(System.IO.Path.Combine(Application.dataPath, ManifestPath));
                CVRInput.SetActionManifestPath(fi.FullName).Log("SetActionManifestPath:");
                SetupHandles();
                initd = true;
            }
            else
            {
                DestroyImmediate(this);
            }
        }
コード例 #2
0
 void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
         SVRHelper.ExitTemporarySession();
     }
 }