void Start() { _stageManager = FindObjectOfType <StageManager>().GetComponent <StageManager>(); _playerCentral = gameObject.GetComponent <PlayerCentral>(); if (_textUI) { _textUIHealth = _textUI.GetComponent <TextMeshProUGUI>(); } }
void Start() { _inputManager = FindObjectOfType <InputManager>().GetComponent <InputManager>(); _rb = gameObject.GetComponent <Rigidbody>(); _playerCentral = gameObject.GetComponent <PlayerCentral>(); if (!_inputManager) { Debug.LogError("No InputManager found in the scene!"); } if (!_rb) { Debug.LogError("No RigidBody in the object!"); } }