IEnumerator - Waitforseconds - 错误(CS1525)

时间:2018-03-22 00:24:42

标签: c# unityscript

IEnumerator () {      // this is were the error is 
        yield return new WaitForSeconds (10);
        characterdirection.SetInteger ("State", 5);
        }

这不起作用并说:错误(CS1525)意外符号'{'

1 个答案:

答案 0 :(得分:1)

您必须为您的功能定义名称;

IEnumerator WaitAndSetState ()
{    
    yield return new WaitForSeconds (10);
    characterdirection.SetInteger ("State", 5);
}