Advertisement
Guest User

Untitled

a guest
Jan 28th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public enum TestCallStates
  5. {
  6.     VoidState,
  7.     EnumState,
  8.     CallState
  9. }
  10.  
  11. public class TestCallBehaviour : StateMachineBehaviourEx
  12. {
  13.     void Start()
  14.     {
  15.         currentState = TestCallStates.EnumState;
  16.     }
  17.    
  18.     void Update()
  19.     {
  20.         Debug.Log(currentState);
  21.     }
  22.    
  23.     IEnumerator EnumState_EnterState()
  24.     {
  25.         Debug.Log("Calling CallState from EnumState");
  26.         Call(TestCallStates.CallState);
  27.         Debug.Log("Just after Calling CallState from EnumState");
  28.         yield return null;
  29.     }
  30.    
  31.     void VoidState_EnterState()
  32.     {
  33.         Debug.Log("Calling CallState from VoidState");
  34.         Call(TestCallStates.CallState);
  35.         Debug.Log("Just after Calling CallState from VoidState");
  36.     }
  37.    
  38.     IEnumerator CallState_EnterState()
  39.     {
  40.         Debug.Log("Waiting for 3 seconds in CallState");
  41.         yield return new WaitForSeconds(3f);
  42.        
  43.         Debug.Log("Return()ing from CallState");
  44.         Return();
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement