我是一个完全统一的初学者,我正在尝试用协同器来播放动画,但是得到以下错误:
1.错误CS1502: CS1502#1‘的最佳重载方法匹配不能转换UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)' has some invalid arguments 2.error CS1503: Argument
守则:
using UnityEngine;
using System.Collections;
public class Trap : MonoBehaviour {
//public float delayTime;
// Use this for initialization
void Start () {
StartCoroutine (Go ());
}
// Update is called once per frame
void Update () {
}
IEnumerable Go(){
while (true) {
animation.Play();
yield return new WaitForSeconds(3f);
}
}
}发布于 2015-06-28 13:57:19
变化
IEnumerable Go(){
while (true) {
animation.Play();
yield return new WaitForSeconds(3f);
}
}为了一个IEnumerator..。
IEnumerator Go(){
while (true) {
animation.Play();
yield return new WaitForSeconds(3f);
}
}发布于 2015-06-28 17:35:40
Coroutine的返回类型将是IEnumerator。
https://stackoverflow.com/questions/31100333
复制相似问题