示例#1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Blast")
        {
            Blast blast = collision.gameObject.GetComponent <Blast>();
            float score = blast.power;
            switch (blast.blastMode)
            {
            case BlastManager.BlastMode.Green:
                planetManager.AddStat(0, score, 0, 0);
                break;

            case BlastManager.BlastMode.Water:
                planetManager.AddStat(score, 0, 0, 0);
                break;

            case BlastManager.BlastMode.Earth:
                planetManager.AddStat(0, 0, score, 0);
                break;

            case BlastManager.BlastMode.Hot:
                planetManager.AddStat(0, 0, 0, score);
                break;
            }
            Destroy(blast.gameObject);
        }
    }