unity2d:co-routine
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
unity2d:co-routine [2024/01/12 02:12] – [Coinの発射] yajuadmin | unity2d:co-routine [2024/01/12 02:13] (現在) – [C#スクリプト作成] yajuadmin | ||
---|---|---|---|
行 72: | 行 72: | ||
if (other.tag == " | if (other.tag == " | ||
| | ||
- | | + | |
| | ||
| | ||
行 78: | 行 78: | ||
void OnBecameInvisible() { | void OnBecameInvisible() { | ||
- | Destroy(this.gameObject); | + | Destroy(this.gameObject); |
} | } | ||
} | } | ||
行 123: | 行 123: | ||
bool jump = Input.GetButtonDown(" | bool jump = Input.GetButtonDown(" | ||
Move(x, jump); | Move(x, jump); | ||
- | // | + | // 左クリックでコイン発射 |
if (Input.GetButtonDown(" | if (Input.GetButtonDown(" | ||
- | StartCoroutine(“Shot”); | + | StartCoroutine(“Shot”); |
} | } | ||
} | } | ||
行 132: | 行 132: | ||
if (isRunning) { yield break; } | if (isRunning) { yield break; } | ||
| | ||
- | // | + | // コインを3連射する |
| | ||
| | ||
| | ||
- | yield return new WaitForSeconds(1f); | + | yield return new WaitForSeconds(1f); |
} | } | ||
isRunning = false; | isRunning = false; |
unity2d/co-routine.1704993123.txt.gz · 最終更新: 2024/01/12 02:12 by yajuadmin