/// <summary>
        /// <strong>[Should not be called by user code]</strong> Initializes the individual sources as well as the base map itself.
        /// Gets the handle for the action from SteamVR and does any other SteamVR related setup that needs to be done
        /// </summary>
        public override void Initialize(bool createNew = false, bool throwErrors = true)
        {
            if (needsReinit)
            {
                TryNeedsInitData();
            }

            if (createNew)
            {
                sourceMap.Initialize();
            }
            else
            {
                sourceMap = SteamVR_Input.GetActionDataFromPath <SourceMap>(actionPath);

                if (sourceMap == null)
                {
#if UNITY_EDITOR
                    if (throwErrors)
                    {
                        if (string.IsNullOrEmpty(actionPath))
                        {
                            Debug.LogError("<b>[SteamVR]</b> Action has not been assigned.");
                        }
                        else
                        {
                            Debug.LogError("<b>[SteamVR]</b> Could not find action with path: " + actionPath);
                        }
                    }
#endif
                }
            }

            initialized = true;
        }
Beispiel #2
0
        /// <summary>
        /// <strong>[Should not be called by user code]</strong> Initializes the individual sources as well as the base map itself.

        /// </summary>
        public override void Initialize(bool createNew = false, bool throwErrors = true)
        {
            if (needsReinit)
            {
                TryNeedsInitData();
            }

            if (createNew)
            {
                sourceMap.Initialize();
            }
            else
            {
                sourceMap = SteamVR_Input.GetActionDataFromPath <SourceMap>(actionPath);
            }

            initialized = true;
        }