// Use this for initialization void Start() { gameView = GameObject.Find("CPU").GetComponent <GameView>(); ani_sprite = GetComponent <tk2dAnimatedSprite>(); cc = GetComponent <CharacterController>(); state = new NPCActorState_Idle(this); if (aiActions != null) { ToNextAIAction(); DoCurAction(); } }
public override IActorState toNextState(EActorAction action) { IActorState result = null; if (action == EActorAction.NPC_IDLE) { result = new NPCActorState_Idle(actor); } else if (action == EActorAction.NPC_WALK) { result = new NPCActorState_Walk(actor); } else if (action == EActorAction.NPC_DIE) { result = new NPCActorState_Die(actor); } return(result); }
void Start() { base.Start(); isHero = false; state = new NPCActorState_Idle(this); StartCoroutine(CoUpdateState()); }
// Use this for initialization void Start() { gameView = GameObject.Find("CPU").GetComponent<GameView>(); ani_sprite = GetComponent<tk2dAnimatedSprite>(); cc = GetComponent<CharacterController>(); state = new NPCActorState_Idle(this); if(aiActions != null){ ToNextAIAction(); DoCurAction(); } }
public override IActorState toNextState(EActorAction action) { IActorState result = null; if(action == EActorAction.NPC_IDLE){ result = new NPCActorState_Idle(actor); } else if(action == EActorAction.NPC_WALK){ result = new NPCActorState_Walk(actor); } else if(action == EActorAction.NPC_DIE){ result = new NPCActorState_Die(actor); } return result; }