小游戏

Posted xiaomao21

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小游戏相关的知识,希望对你有一定的参考价值。

private IEnumerator WaitForShifting() {
        yield return new WaitUntil(() => !BoardManager.instance.IsShifting);
        yield return new WaitForSeconds(.25f);
        GameOver();
    }
    while (t <= time && !drop){
            t += Time.deltaTime;
            yield return null;
        }
public class WaitUntilExample : MonoBehaviour
{
    public int frame;

    void Start()
    {
        StartCoroutine(Example());
    }

    IEnumerator Example()
    {
        Debug.Log("Waiting for princess to be rescued...");
        yield return new WaitUntil(() => frame >= 10);
        Debug.Log("Princess was rescued!");
    }

    void Update()
    {
        if (frame <= 10)
        {
            Debug.Log("Frame: " + frame);
            frame++;
        }
    }
}

  

以上是关于小游戏的主要内容,如果未能解决你的问题,请参考以下文章