private void LoadComponents() { _attack = GetComponent <Combat.Attack>(); Debug.Assert(null != _attack, $"Attack component missing on {name}."); _playerAnimator = GetComponent <PlayerAnimator>(); Debug.Assert(null != _playerAnimator, $"PlayerAnimator component missing on {name}."); _rb = GetComponent <Rigidbody>(); Debug.Assert(null != _rb, $"RigidBody component missing on {name}."); }
private void LoadComponents() { _attack = GetComponent <Combat.Attack>(); Debug.Assert(_attack, $"{this}: No attack found on {name}."); _agent = GetComponent <NavMeshAgent>(); Debug.Assert(_agent, $"{this}: NavMeshAgent component missing on {name}."); if (_attack && _attack is Combat.RadialAttack) { _attackRange = ((Combat.RadialAttack)_attack).Radius; } }