void Awake()
 {
     if (instance == null)
     {
         instance = this;             // In first scene, make us the singleton.
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(gameObject);             // On reload, singleton already set, so destroy duplicate.
     }
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        //Cursor.lockState = CursorLockMode.Locked;

        state = Test_3FStates.PREPARATION;
        Node root = new Node();

        BuildTree(root);
        InstTree(root);

        VRController          = CameraOnAStick.GetInstance().transform;
        VRController.position = new Vector3(3.0f, -0.5f, -2.5f);
        VRController.GetComponent <CameraOnAStick>().adjustment = new Vector3(0, 0, 0);

        // It would be better to have an input scheme but this is effective until we get a controller
        controlCam.transform.parent.GetComponent <Pivot_rotate>().active = true;
        VRController.GetComponent <CameraOnAStick>().enabled             = false;
    }