コード例 #1
0
        protected override void OnCollision(Collision collision)
        {
            LivingEntity entity = collision.gameObject.GetComponentInParent <LivingEntity>();

            if (entity != null)
            {
                if (!entitiesTouched.Contains(entity))
                {
                    InflictDamage(entity);
                    entitiesTouched.Add(entity);
                }
            }
            else
            {
                if (dieOnCollision)
                {
                    Die();
                }
            }
            if (instability >= 3 && entitiesTouched.Count >= 2)
            {
                Die();
            }
        }
コード例 #2
0
 protected override void InflictDamage(LivingEntity entity)
 {
     entity.TakeDamage(heading, damage);
 }
コード例 #3
0
 protected abstract void InflictDamage(LivingEntity entity);