コード例 #1
0
 public void TakeDamage(Transform bodyPart,
                        ET.DamageType damageType,
                        float damageTaken,
                        bool isDead,
                        Vector3 direction,
                        Vector3 hitPoint,
                        float force)
 {
     if (onTakeDamage != null)
     {
         onTakeDamage(transform, damageType, damageTaken, isDead, direction, hitPoint, force);
     }
 }
コード例 #2
0
        public void OnDamageTake(Transform bodyPart, ET.DamageType damageType, float damageTaken, bool isDead, Vector3 direction, Vector3 hitPoint, float force)
        {
            switch (damageType)
            {
            case ET.DamageType.BulletToBody:
                ai.Memory.Add(
                    new InformationReceivedDamageBulletToHumanoid
                    (
                        damageTaken, maxConfidenceDmgBulletToHumanoid,
                        direction, 1,
                        force, 1,
                        bodyPart
                    )
                    );
                break;

            case ET.DamageType.DirectToHealth:
                break;

            default:
                break;
            }
        }
コード例 #3
0
    public void ApplyDamage(float damage, Vector3 direction, Vector3 hitPoint, float force, ET.DamageType damageType)
    {
        if (!isDead)
        {
            health.health -= damage * damageMultiplier;

            if (health.health <= 0 && force > 0)
            {
                StartCoroutine(AddForceToRbs(direction, hitPoint, force));
                isDead = true;
            }
            TakeDamage(transform, damageType, damage, isDead, direction, hitPoint, force);
        }
    }