Example #1
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag == "Ball")
     {
         currentHitPoint -= DamageCalculator.Damage(other.relativeVelocity.sqrMagnitude, 1.0f);
     }
     //マップ外に出た時の処理
     if (other.gameObject.tag == "BreakArea")
     {
         currentHitPoint = 0.0f;
     }
 }
Example #2
0
        public bool Update(float timeIncrement, Character target)
        {
            _elapsed += timeIncrement;

            if (_elapsed >= (_timesHappened + 1) * _period)
            {
                target.Health -= DamageCalculator.Damage(_source, target, _damagePerTick, _damageType);
                _timesHappened++;
            }

            return(_elapsed > _duration);
        }
Example #3
0
 public void Execute(Character self, Character target)
 {
     target.Health -= DamageCalculator.Damage(self, target, self.PhysicalDamage, DamageType.Physical);
     Debug.Log($"{self.Name} attacks {target.Name}");
 }