Exemple #1
0
 void Awake()
 {
     // Find player within scene
     GameObject player = GameObject.FindGameObjectWithTag("Player");
     if (player == null)
     {
         Debug.LogError(string.Format("({0}) Unable to find player. Have you tagged the player with 'Player'?",
             this.name));
     }
     else
     {
         // Get Cinematic Camera component from player
         _playerCam = player.GetComponentInChildren<CinematicCamera>();
         if (_playerCam == null)
         {
             Debug.LogWarning(string.Format("({0}) Didn't find Cinematic Camera attached to player",
                 this.name));
         }
     }
 }
Exemple #2
0
        void Awake()
        {
            // Find player within scene
            GameObject player = GameObject.FindGameObjectWithTag("Player");

            if (player == null)
            {
                Debug.LogError(string.Format("({0}) Unable to find player. Have you tagged the player with 'Player'?",
                                             this.name));
            }
            else
            {
                // Get Cinematic Camera component from player
                _playerCam = player.GetComponentInChildren <CinematicCamera>();
                if (_playerCam == null)
                {
                    Debug.LogWarning(string.Format("({0}) Didn't find Cinematic Camera attached to player",
                                                   this.name));
                }
            }
        }