コード例 #1
0
        public override void Use(Character character)
        {
            Collider2D[] collisions = AttackType.GetColliders(character);

            foreach (Collider2D collision in collisions)
            {
                if (collision == character.Body.Collider)
                {
                    continue;
                }

                Strikeable strikeable = collision.gameObject.GetComponent <Strikeable>();

                if (strikeable)
                {
                    StrikeData strike = new StrikeData(
                        DamageType.Name,
                        Damage,
                        character.Entity,
                        Time.time
                        );

                    strikeable.Strike(strike);
                }
            }
        }