Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public enum TestCallStates
- {
- VoidState,
- EnumState,
- CallState
- }
- public class TestCallBehaviour : StateMachineBehaviourEx
- {
- void Start()
- {
- currentState = TestCallStates.EnumState;
- }
- void Update()
- {
- Debug.Log(currentState);
- }
- IEnumerator EnumState_EnterState()
- {
- Debug.Log("Calling CallState from EnumState");
- Call(TestCallStates.CallState);
- Debug.Log("Just after Calling CallState from EnumState");
- yield return null;
- }
- void VoidState_EnterState()
- {
- Debug.Log("Calling CallState from VoidState");
- Call(TestCallStates.CallState);
- Debug.Log("Just after Calling CallState from VoidState");
- }
- IEnumerator CallState_EnterState()
- {
- Debug.Log("Waiting for 3 seconds in CallState");
- yield return new WaitForSeconds(3f);
- Debug.Log("Return()ing from CallState");
- Return();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement