示例#1
0
    private IEnumerator ColorFlash()
    {
        if (th.currentColor == "b")
        {
            sr.color = GameManager.cWhite;
            yield return(new WaitForSeconds(0.3f));

            sr.color = GameManager.cBlack;
            yield return(new WaitForSeconds(0.3f));

            sr.color = GameManager.cWhite;
            yield return(new WaitForSeconds(0.3f));

            sr.color = GameManager.cBlack;
            yield return(new WaitForSeconds(0.3f));

            th.FlipColor();
        }
        else if (th.currentColor == "w")
        {
            sr.color = GameManager.cBlack;
            yield return(new WaitForSeconds(0.3f));

            sr.color = GameManager.cWhite;
            yield return(new WaitForSeconds(0.3f));

            sr.color = GameManager.cBlack;
            yield return(new WaitForSeconds(0.3f));

            sr.color = GameManager.cWhite;
            yield return(new WaitForSeconds(0.3f));

            th.FlipColor();
        }
    }
示例#2
0
    private IEnumerator Timer()
    {
        while (true)
        {
            yield return(new WaitForSeconds(changeTime));

            th.FlipColor();
        }
    }