コード例 #1
0
    public void Die()
    {
        if (!isDead)
        {
            isDead = true;
            GameObject starbox = GameObject.Find("StarBox");
            if (starbox)
            {
                starbox.GetComponent <Timer>().restart();
            }
            Color tmp = GetComponent <SpriteRenderer>().color;
            tmp.a = 0;
            GetComponent <SpriteRenderer>().color = tmp;
            audioPlayer.PlayOneShot(smokeAudio);
            GetComponent <ParticleSystem>().Emit(20);

            flip.Reset();

            if (gameObject.activeSelf)
            {
                StartCoroutine(Spawn(1.5f));
            }
        }
    }