예제 #1
0
        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}.");
        }
예제 #2
0
    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;
        }
    }