Esempio n. 1
0
    public override void Enter()
    {
        FireSlimeBossAI fireSlimeBossAI = (FireSlimeBossAI)GetAI();
        FireSlimeBoss   fireSlimeBoss   = (FireSlimeBoss)fireSlimeBossAI.getCharacter();
        GameObject      myBody          = fireSlimeBoss.GetGameObject();

        if (childrenStates.Count == 0)
        {
            Skill1State_FireSlimeBoss       skill1State       = new Skill1State_FireSlimeBoss();
            Skill2State_FireSlimeBoss       skill2State       = new Skill2State_FireSlimeBoss();
            Skill3State_FireSlimeBoss       skill3State       = new Skill3State_FireSlimeBoss();
            NormalAttackState_FireSlimeBoss normalAttackState = new NormalAttackState_FireSlimeBoss();

            skill1State.SetCharacterAI(GetAI());
            skill2State.SetCharacterAI(GetAI());
            skill3State.SetCharacterAI(GetAI());
            normalAttackState.SetCharacterAI(GetAI());

            AddChild(skill3State);
            AddChild(skill2State);
            AddChild(skill1State);
            AddChild(normalAttackState);
        }
        Debug.Log("进入攻击状态");
        base.Enter();
    }
Esempio n. 2
0
    public FireSlimeBossAI() : base()
    {
        SetConditionHaveEnemy(new ConditionHaveEnemy_FireSlimeBoss());
        conditionHaveEnemy.SetCharacterAI(this);

        SetDistanceCondition(new DistanceCondition_FireSlimeBoss());
        distanceCondition.SetCharacterAI(this);

        SetMoveState(new MoveState_FireSlimeBoss());
        moveState.SetCharacterAI(this);

        SetMoveToEnemyState(new MoveToEnemyState_FireSlimeBoss());
        moveToEnemyState.SetCharacterAI(this);

        SetMoveToEnemy(new MoveToEnemy_FireSlimeBoss());
        moveToEnemy.SetCharacterAI(this);

        SetAttackState(new AttackState_FireSlimeBoss());
        attackState.SetCharacterAI(this);

        SetSkill1State(new Skill1State_FireSlimeBoss());
        skill1State.SetCharacterAI(this);

        SetSkill2State(new Skill2State_FireSlimeBoss());
        skill2State.SetCharacterAI(this);

        SetSkill3State(new Skill3State_FireSlimeBoss());
        skill3State.SetCharacterAI(this);

        SetNormalAttackState(new NormalAttackState_FireSlimeBoss());
        normalAttackState.SetCharacterAI(this);

        root_Node = new Selector();
        root_Node.AddChild(attackState);
        root_Node.AddChild(moveState);
        root_Node.currentState = State.NONE;
    }