2021년 4학년 1학기 기업연계프로젝트2 컴퓨터소프트웨어공학과 <원광투어팀> 팀장 : 송유진 팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

5 years ago
  1. //======= Copyright (c) Valve Corporation, All rights reserved. ===============
  2. using UnityEngine;
  3. using System.Collections;
  4. namespace Valve.VR
  5. {
  6. /// <summary>
  7. /// Automatically activates an action set on Start() and deactivates the set on OnDestroy(). Optionally deactivating all other sets as well.
  8. /// </summary>
  9. public class SteamVR_ActivateActionSetOnLoad : MonoBehaviour
  10. {
  11. public SteamVR_ActionSet actionSet = SteamVR_Input.GetActionSet("default");
  12. public SteamVR_Input_Sources forSources = SteamVR_Input_Sources.Any;
  13. public bool disableAllOtherActionSets = false;
  14. public bool activateOnStart = true;
  15. public bool deactivateOnDestroy = true;
  16. public int initialPriority = 0;
  17. private void Start()
  18. {
  19. if (actionSet != null && activateOnStart)
  20. {
  21. //Debug.Log(string.Format("[SteamVR] Activating {0} action set.", actionSet.fullPath));
  22. actionSet.Activate(forSources, initialPriority, disableAllOtherActionSets);
  23. }
  24. }
  25. private void OnDestroy()
  26. {
  27. if (actionSet != null && deactivateOnDestroy)
  28. {
  29. //Debug.Log(string.Format("[SteamVR] Deactivating {0} action set.", actionSet.fullPath));
  30. actionSet.Deactivate(forSources);
  31. }
  32. }
  33. }
  34. }