Exemplo n.º 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();
        }
    }
Exemplo n.º 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);
    }
Exemplo n.º 3
0
    void Start()
    {
        base.Start();

        isHero = false;

        state = new NPCActorState_Idle(this);

        StartCoroutine(CoUpdateState());
    }
Exemplo n.º 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();
        }
    }
Exemplo n.º 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;
 }