c#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class EnemyAttack : MonoBehaviour { 6 7 8 void Start () { 9 10 } 11 12 void Update () { 13 } 14 15 void OnCollisionEnter2D(Collision2D other){ 16 17 18 player_invulnerable pupupu = GameObject.Find("player").GetComponent<player_invulnerable>(); 19 20 pupupu.muteki (); 21 22 23 24 } 25}
このスクリプトから
c#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class player_invulnerable : MonoBehaviour { 6 7 // Use this for initialization 8 void Start () { 9 } 10 11 // Update is called once per frame 12 void Update () { 13 } 14 15 public IEnumerable muteki (){ 16 17 Debug.Log ("feefe"); 18 yield return new WaitForSeconds (0.6f); 19 } 20} 21
このスクリプトにワープするようにしたいのですが
なぜかIEnumerable mutekiにワープできません
ちなみにmutekiをpublic voidに変えてyieldの行を削除したら
debug.logが無事動作します。
なぜでしょうか・・?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/10/14 09:03
2017/10/14 09:17
2017/10/16 05:03