Skip to content

Instantly share code, notes, and snippets.

@hon454
Created February 8, 2018 05:14
Show Gist options
  • Save hon454/0b7b7c50f635cc2ce54bc9115966cad9 to your computer and use it in GitHub Desktop.
Save hon454/0b7b7c50f635cc2ce54bc9115966cad9 to your computer and use it in GitHub Desktop.
Good Coroutine Example 2/2
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