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.

34 lines
1.1 KiB

5 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. namespace Valve.VR.Extras
  4. {
  5. /// <summary>
  6. /// This is an example class of how to force steamvr initialization. You still need to have vr mode enabled
  7. /// but you can have the top sdk set to None, then this script will force it to OpenVR after a second
  8. /// </summary>
  9. public class SteamVR_ForceSteamVRMode : MonoBehaviour
  10. {
  11. public GameObject vrCameraPrefab;
  12. public GameObject[] disableObjectsOnLoad;
  13. private IEnumerator Start()
  14. {
  15. yield return new WaitForSeconds(1f); // just here to show that you can wait a while.
  16. SteamVR.Initialize(true);
  17. while (SteamVR.initializedState != SteamVR.InitializedStates.InitializeSuccess)
  18. yield return null;
  19. for (int disableIndex = 0; disableIndex < disableObjectsOnLoad.Length; disableIndex++)
  20. {
  21. GameObject toDisable = disableObjectsOnLoad[disableIndex];
  22. if (toDisable != null)
  23. toDisable.SetActive(false);
  24. }
  25. GameObject.Instantiate(vrCameraPrefab);
  26. }
  27. }
  28. }