コード例 #1
0
    void Attack()
    {
        // Reset le timer.
        timer = 0f;

        //La cible prend des dommage
        if (targetHealth.currentHealth > 0)
        {
            targetHealth.TakeDamage(attackDamage);
        }
    }
コード例 #2
0
    void Attack()
    {
        // Reset the timer.
        timer = 0f;

        // If the player has health to lose...
        if (playerHealth.currentHealth > 0)
        {
            // ... damage the player.
            playerHealth.TakeDamage(attackDamage);
        }
    }