1234567891011121314151617181920212223242526272829303132333435363738394041 |
-
- using UnityEngine;
- using System.Collections;
- namespace Valve.VR
- {
-
-
-
- public class SteamVR_ActivateActionSetOnLoad : MonoBehaviour
- {
- public SteamVR_ActionSet actionSet = SteamVR_Input.GetActionSet("default");
- public SteamVR_Input_Sources forSources = SteamVR_Input_Sources.Any;
- public bool disableAllOtherActionSets = false;
- public bool activateOnStart = true;
- public bool deactivateOnDestroy = true;
- private void Start()
- {
- if (actionSet != null && activateOnStart)
- {
-
- actionSet.Activate(forSources, 0, disableAllOtherActionSets);
- }
- }
- private void OnDestroy()
- {
- if (actionSet != null && deactivateOnDestroy)
- {
-
- actionSet.Deactivate(forSources);
- }
- }
- }
- }
|