コード例 #1
0
ファイル: DummyHealth.cs プロジェクト: WesMcW/Project_Sol
    public void TakeDamage(int amount)
    {
        currentHealth -= amount;

        //The Damage number part////
        if (dn != null)
        {
            DamageNumber newDN = Instantiate(dn, transform.position, Quaternion.identity);
            newDN.SetValues(amount, currentHealth / (float)maxHealth, false); //need to find a way to tell this we're criting or not
        }
        ////

        if (currentHealth <= 0)
        {
            Die();
        }
    }