Example #1
0
    // 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();
        }
    }
Example #2
0
    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);
    }
Example #3
0
    void Start()
    {
        base.Start();

        isHero = false;

        state = new NPCActorState_Idle(this);

        StartCoroutine(CoUpdateState());
    }
Example #4
0
    // 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();
        }
    }
Example #5
0
 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;
 }