Created
February 8, 2018 05:14
-
-
Save hon454/0b7b7c50f635cc2ce54bc9115966cad9 to your computer and use it in GitHub Desktop.
Good Coroutine Example 2/2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
public partial class PlayerFSM : MonoBehaviour | |
{ | |
private IEnumerator Idle() | |
{ | |
do | |
{ | |
yield return null; | |
if (_isNewState) break; | |
// Idle 행동 구현 | |
} while (!_isNewState); | |
} | |
private IEnumerator Run() | |
{ | |
do | |
{ | |
yield return null; | |
if (_isNewState) break; | |
// Run 행동 구현 | |
} while (!_isNewState); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment