public void Awake() { _transform = transform; // Find player camera controller PlayerCameraController cameraController = FindObjectOfType <PlayerCameraController>(); if (cameraController == null) { Debug.LogWarning("Either no player camera controller present within the scene, or Player script is unable to find it"); } else { // Get player camera _playerCamera = cameraController.GetComponentInChildren <Camera>(); if (_playerCamera == null) { Debug.LogWarning("Player script is unable to find the player camera"); } } // Ensure player is able to trigger explsions if (_explosionsAmount <= 0) { Debug.LogWarning("Player will not be able to trigger explosions, with current explosion count"); } if (_explodableLayers.value == 0) { Debug.LogWarning("Player will not be able to trigger explosions, with current explodable layers settings"); } }
public void Awake() { // Get reference to player camera controller _cameraController = FindObjectOfType<PlayerCameraController>(); if (_cameraController == null) { Debug.LogError("Unable to find player camera controller within scene"); } _mainCamera = _cameraController.GetComponentInChildren<Camera>(); // Get reference to player _player = FindObjectOfType<Player>(); if (_player == null) { Debug.LogError("TouchInput script unable to find player script within scene"); } }
public void Awake() { // Get reference to player camera controller _cameraController = FindObjectOfType <PlayerCameraController>(); if (_cameraController == null) { Debug.LogError("Unable to find player camera controller within scene"); } _mainCamera = _cameraController.GetComponentInChildren <Camera>(); // Get reference to player _player = FindObjectOfType <Player>(); if (_player == null) { Debug.LogError("TouchInput script unable to find player script within scene"); } }