Esempio n. 1
0
    void Start()
    {
        GameConfig    = GameConfig.Instance();
        rotationSpeed = GameConfig.playerRotationSpeed;
        forwardSpeed  = GameConfig.playerForwardSpeed;
        audio         = GetComponent <AudioSource>();


        if (photonView.isMine || GameConfig.isSoloGame)
        {
            startPhotonIsMineCalled = true;
            rb           = GetComponent <Rigidbody>();
            forwardSpeed = GameConfig.playerForwardSpeed;
            playerLocal  = this.transform.Find("GvrMain/Head/Main Camera/Main Camera Left");

            avatar.SetActive(false);

            AudioListener listener = GetComponent <AudioListener>();
            listener.enabled = true;

            GvrViewer viewer = GetComponentInChildren <GvrViewer>();
            viewer.enabled = true;

            GvrEye[] eyes = GetComponentsInChildren <GvrEye>(true);
            foreach (GvrEye eye in eyes)
            {
                eye.enabled = true;
            }

            GvrAudioListener gvrListener = GetComponentInChildren <GvrAudioListener>();
            if (gvrListener)
            {
                gvrListener.enabled = true;
            }

            Camera[] cameras = GetComponentsInChildren <Camera>(true);
            foreach (Camera camera in cameras)
            {
                camera.enabled = true;
            }

            GameObject scoring = GameObject.FindWithTag("Scoring System");
            scoringScript = scoring.GetComponent <ScoringSystem>();
            scoringScript.AddPlayer(playerNumber);
//        } else {
//            StartCoroutine("Alive");      // To reinstate lerping when ready.
        }
    }