// Get reference to player through the state controller private void Start() { StateController controller = GetComponentInParent <StateController>(); _playerLifecycle = controller.Player.GetComponent <PlayerLifecycle>(); _body = controller.GetComponentInChildren <SkinnedMeshRenderer>(); }
//----------------------------------------------------------------------------------- // Method: Start // Desc: Used to cache component references not in this object's heirarchy //----------------------------------------------------------------------------------- private void Start() { _playerLifecycle = GetComponentInParent <StateController>().Player.GetComponent <PlayerLifecycle>(); }