示例#1
0
    void Start()
    {
        gvr        = FindObjectOfType <GvrEditorEmulator>();
        gvrPointer = FindObjectOfType <GvrPointerPhysicsRaycaster>();
        //gvr.gameObject.SetActive(false);
        //gvrPointer.enabled = false;

        transform.LookAt(lookAtObjects[0]);
    }
示例#2
0
    private GameManager gameManager;  //the gameManager(controlling the state)


    /**
     * Initializes the controller, and necessary variables for the movement
     */
    void Start()
    {
        controller = GetComponent <CharacterController>();
        gvrEditor  = transform.GetChild(0).GetComponent <GvrEditorEmulator>();
        vrHead     = Camera.main.transform;

        isInAir          = false;
        moveForwardInAir = false;
        gameManager      = GameObject.FindWithTag("GameManager").GetComponent <GameManager>();
    }
示例#3
0
    public void Recenter()
    {
#if !UNITY_EDITOR
        GvrCardboardHelpers.Recenter();
#else
        GvrEditorEmulator emulator = FindObjectOfType <GvrEditorEmulator>();
        if (emulator == null)
        {
            return;
        }
        emulator.Recenter();
#endif  // !UNITY_EDITOR
    }
示例#4
0
 private void Awake()
 {
     if (Instance == null)
     {
         instance = this;
     }
     else if (Instance != this)
     {
         Debug.LogError("More than one active GvrEditorEmulator instance was found in your " +
                        "scene.  Ensure that there is only one active GvrEditorEmulator.");
         this.enabled = false;
         return;
     }
 }
示例#5
0
 void Start()
 {
     cc        = GetComponent <CharacterController> ();
     gvrEditor = transform.GetChild(0).GetComponent <GvrEditorEmulator> ();
     vrHead    = Camera.main.transform;
 }