Пример #1
0
    public override void Enter()
    {
        base.Enter();
        FireSlimeBossAI fireSlimeBossAI = (FireSlimeBossAI)GetAI();

        if (childrenStates.Count == 0)
        {
            ConditionHaveEnemy_FireSlimeBoss conditionHaveEnemy = new ConditionHaveEnemy_FireSlimeBoss();
            MoveToEnemy_FireSlimeBoss        moveToEnemy        = new MoveToEnemy_FireSlimeBoss();
            moveToEnemy.SetCharacterAI(GetAI());
            conditionHaveEnemy.SetCharacterAI(GetAI());

            AddChild(conditionHaveEnemy);
            AddChild(moveToEnemy);
        }
        Debug.Log("进入移动向敌人状态");
    }
Пример #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;
    }