예제 #1
0
        /// <summary>
        /// Initializes the handle for the action
        /// </summary>
        public virtual void Initialize(bool createNew = false, bool throwErrors = true)
        {
            if (createNew)
            {
                setData.Initialize();
            }
            else
            {
                setData = SteamVR_Input.GetActionSetDataFromPath(actionSetPath);

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

            initialized = true;
        }
예제 #2
0
        public void PreInitialize(string newActionPath)
        {
            actionSetPath = newActionPath;

            setData          = new SteamVR_ActionSet_Data();
            setData.fullPath = actionSetPath;
            setData.PreInitialize();

            initialized = true;
        }
        /// <summary>
        /// Initializes the handle for the action
        /// </summary>
        public virtual void Initialize(bool createNew = false, bool throwErrors = true)
        {
            if (createNew)
            {
                setData.Initialize();
            }
            else
            {
                setData = SteamVR_Input.GetActionSetDataFromPath(actionSetPath);
            }

            initialized = true;
        }
예제 #4
0
        void ISerializationCallbackReceiver.OnAfterDeserialize()
        {
            if (setData != null)
            {
                if (setData.fullPath != actionSetPath)
                {
                    setData = SteamVR_Input.GetActionSetDataFromPath(actionSetPath);
                }
            }

            if (initialized == false)
            {
                Initialize(false, false);
            }
        }