示例#1
0
        public void OnApplicationStart()
        {
            logger.Info("Starting " + typeof(Plugin).Namespace);

            OpenVRUtilities.Init();

            logger.Info("Successfully initialized OpenVR API");

            // adding the manifest to config is more of a quality of life thing
            try
            {
                AddManifestToSteamConfig();
            }
            catch (Exception ex)
            {
                logger.Error("Failed to update SteamVR manifest.");
                logger.Error(ex);
            }

            RegisterActionSet();
            ApplyHarmonyPatches();

            OpenVRActionManager.instance.Initialize(_actionManifestPath);

            _initialized = true;
        }
示例#2
0
        public void OnStart()
        {
            logger.Info("Starting " + typeof(Plugin).Namespace);

            try
            {
                OpenVRUtilities.Init();
            }
            catch (Exception ex)
            {
                logger.Error("Failed to initialize OpenVR API; DynamicOpenVR will not run");
                logger.Error(ex);
                return;
            }

            logger.Info("Successfully initialized OpenVR API");

            // adding the manifest to config is more of a quality of life thing
            try
            {
                AddManifestToSteamConfig();
            }
            catch (Exception ex)
            {
                logger.Error("Failed to update SteamVR manifest.");
                logger.Error(ex);
            }

            RegisterActionSet();
            ApplyHarmonyPatches();

            OpenVRActionManager.instance.Initialize(_actionManifestPath);

            OpenVREventHandler eventHandler = new GameObject(nameof(OpenVREventHandler)).AddComponent <OpenVREventHandler>();

            Object.DontDestroyOnLoad(eventHandler.gameObject);
            eventHandler.gamePaused += OnGamePaused;
        }
示例#3
0
        public void OnStart()
        {
            _logger.Info("Starting " + typeof(Plugin).Namespace);

            try
            {
                OpenVRUtilities.Init();
            }
            catch (Exception ex)
            {
                _logger.Error("Failed to initialize OpenVR API; DynamicOpenVR will not run");
                _logger.Error(ex);
                return;
            }

            _logger.Info("Successfully initialized OpenVR API");

            // adding the manifest to config is more of a quality of life thing
            try
            {
                AddManifestToSteamConfig();
            }
            catch (Exception ex)
            {
                _logger.Error("Failed to update SteamVR manifest.");
                _logger.Error(ex);
            }

            RegisterActionSet();
            ApplyHarmonyPatches();

            OpenVRActionManager.instance.Initialize(kActionManifestPath);

            SceneManager.sceneLoaded += OnSceneLoaded;
            OpenVREventHandler.instance.eventTriggered += OnOpenVREventTriggered;
        }