示例#1
0
        public void TwoAttacksWithinCooldown_AppliesDamageOnce()
        {
            AttackSkill attack = Data.AttackSkill.SetDamage(10).SetCooldown(1);

            attack.Attack(_target);
            attack.ReduceCooldown(0.75f);
            attack.Attack(_target);
            _target.Received(1).TakeDamage(10);
        }
示例#2
0
 private void Update()
 {
     if (IsDead)
     {
         return;
     }
     if (Input.GetMouseButtonDown(0))
     {
         _mouseAction.DoMouseAction(Input.mousePosition, _lmbSkill);
     }
     _lmbSkill.ReduceCooldown(Time.deltaTime);
 }
示例#3
0
    private void Update()
    {
        var player = PlayerManager.Instance.Player;

        if (player.IsDead)
        {
            return;
        }
        var position = player.transform.position;

        _mover.Move(position);
        var distance = Vector3.Distance(position, transform.position);

        if (distance < 2f)
        {
            _skill?.Attack(player.GetComponent <CharacterStats>());
        }
        _skill?.ReduceCooldown(Time.deltaTime);
    }