Example #1
0
    public async Task noisy()
    {
        if (last != null)
        {
            last.SetActive(false);
        }
        GroupAnimation ga = s4.GetComponent <GroupAnimation>();

        SoundPlayer.Play("gallery");
        await ga.Reload(ga.path);

        s4.SetActive(true); last = s4;
        await Task.Run(() => {
            while (ga.playTime < 3)
            {
                Thread.Sleep(50);
            }
        });

        ga = s5.GetComponent <GroupAnimation>();
        SoundPlayer.Play("gavel");
        await ga.Reload(ga.path);

        s5.SetActive(true); s4.SetActive(false);
        await Task.Run(() => {
            while (ga.playTime < 1)
            {
                Thread.Sleep(50);
            }
        });

        s5.SetActive(false);
    }
Example #2
0
    public async Task p3(string action, int loopcount = 0)
    {
        GroupAnimation ga = s3.transform.Find("p3").GetComponent <GroupAnimation>();
        await ga.Reload("p3\\" + action, loopcount == 1);

        if (last != null && last != s3)
        {
            last.SetActive(false);
        }
        s3.SetActive(true); last = s3;
        await Task.Run(() => {
            while (ga.playTime < loopcount)
            {
                Thread.Sleep(50);
            }
        });

        if (loopcount == 1)
        {
            await Delay(500);
        }
    }