C#
1void Awake(){ 2 SRe(); 3 filter=true; 4 } 5 public static bool filter=false; 6 public static void SRe(){ 7 _S = 0; 8 } 9 10 public static void Sup(MonoBehaviour mon){ 11 if(filter){ 12 _S = _S + 1; 13 mon.StartCoroutine("filterscan"); 14 }} 15 16 public static IEnumerator filterscan(){ 17 filter=false; 18 yield return new WaitForSeconds(3); 19 filter=true; 20 } 21
外部からSup(this)と読み込み、_Sの値を増加させています。
ここまではいいのですが、Bool値のfilterがうまく作動しません。。なぜか理由もわからず、アドバイスお願いいたします。。
外部からSupを呼び出す度に、_Sが+1され、その後、_Sが+1されるまでの待ち時間を設けたいのです。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/27 01:31
2016/05/27 01:33
退会済みユーザー
2016/05/27 03:19 編集