コード例 #1
0
    public void Death()
    {
        if (growth.isAdult)
        {
            audioManager.Play("AdultDeath");
        }
        else if (growth.isTeen)
        {
            audioManager.Play("TeenDeath");
        }
        else
        {
            audioManager.Play("ChildDeath");
        }
        var newSoul = Instantiate(soul, transform.position, Quaternion.identity);

        newSoul.GetComponent <PickMeUp>().howMuchToAdd = Mathf.RoundToInt(c_stats.c_Age) * 2;
        population.RemoveHuman(gameObject);
        Destroy(gameObject);
        //maybe also spawn like a gravestone or something
    }