コード例 #1
0
    public override void Begin(AIStateController controller)
    {
        controller.Agent.speed            = wanderSpeed;
        controller.Agent.stoppingDistance = 0f;
        controller.Agent.angularSpeed     = wanderTurnSpeed;

        WanderDataContainer container = controller.Data.Wander;

        container.SetStartPosition(controller.transform.position);
        container.SetWanderTarget(this, controller);

        ChaseDataContainer chase = controller.Data.Chase;

        if (chase.ChaseTarget != null)
        {
            chase.SetChaseTarget(null);
        }

        AttackDataContainer attack = controller.Data.Attack;

        if (attack.DamageTarget != null)
        {
            attack.SetDamageTarget(null);
        }
    }
コード例 #2
0
    public override void Begin(AIStateController controller)
    {
        AttackDataContainer container = controller.Data.Attack;

        if (container.DamageTarget == null)
        {
            container.SetDamageTarget(controller.Data.Chase.ChaseTarget);
        }
        controller.Animator.SetInteger("Walk", 0);
    }