123456789101112131415161718192021222324252627282930313233343536373839404142 |
-
- 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;
- public int initialPriority = 0;
- private void Start()
- {
- if (actionSet != null && activateOnStart)
- {
-
- actionSet.Activate(forSources, initialPriority, disableAllOtherActionSets);
- }
- }
- private void OnDestroy()
- {
- if (actionSet != null && deactivateOnDestroy)
- {
-
- actionSet.Deactivate(forSources);
- }
- }
- }
- }
|