예제 #1
0
    private void PlayTransForm(Transform ts)
    {
        Delay component = ts.GetComponent <Delay>();

        if (component)
        {
            component.Begin();
            return;
        }
        if (ts.GetComponent <Animation>())
        {
            ts.GetComponent <Animation>().Play();
            ts.GetComponent <Animation>().wrapMode = WrapMode.Once;
        }
        if (ts.GetComponent <Animator>())
        {
            ts.GetComponent <Animator>().SetTrigger("play");
        }
        if (ts.GetComponent <ParticleSystem>())
        {
            ts.GetComponent <ParticleSystem>().Play();
        }
        if (ts.GetComponent <AudioSource>())
        {
            ts.GetComponent <AudioSource>().Play();
        }
        foreach (Transform ts2 in ts)
        {
            this.PlayTransForm(ts2);
        }
    }
    public static void Invocation(Action action, int delayMilliseconds)
    {
        var delay = new Delay(action, delayMilliseconds);

        delay.Begin();
    }