やまめも

【 ゲーム開発・日々のことについて 】

【Unity エラー】CS1624 : コルーチン関連

error CS1624: The body of `SituationCreater2.ChangeCharacter()' cannot be 
an iterator block because `void' is not an iterator interface type
public void ChangeCharacter(){
	// 「yield return new WaitForSeconds(0.5f);」の存在が原因でエラー
	GameObject FlickManagerObj = GameObject.Find("FlickManager").gameObject;
	CurrentType = Type;
	Case[CurrentType].transform.FindChild("TimerGameOverScript").GetComponent<TimerGameOver>().StopRunTime();
	yield return new WaitForSeconds(0.5f);
	SelectCase(CurrentType);

}

Error CS1624: xxx cannot be iterator block because 'void' is not an iterator interface type - C# - Unity Answers