コード例 #1
0
ファイル: Enemy.cs プロジェクト: hihijack/ASN
    // 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();
        }
    }
コード例 #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);
    }
コード例 #3
0
ファイル: Enermy.cs プロジェクト: hihijack/wqz
    void Start()
    {
        base.Start();

        isHero = false;

        state = new NPCActorState_Idle(this);

        StartCoroutine(CoUpdateState());
    }
コード例 #4
0
ファイル: Enemy.cs プロジェクト: hihijack/ASN
    // 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();
        }
    }
コード例 #5
0
ファイル: IActorState.cs プロジェクト: hihijack/ASN
 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;
 }