Exemplo n.º 1
0
    public IEnumerator Destroy()
    {
        if (current_path != null)
        {
            StopCoroutine(current_path);
        }

        AllMessager.Continue_After_Shot();

        sr.enabled = false;
        preview_trajectory.enabled = false;
        trail.Stop();
        this.GetComponentInChildren <Collider2D>().enabled = false;

        yield return(new WaitForSeconds(
                         trail.main.startLifetime.constant
                         ));

        Destroy(this.gameObject);
    }