コード例 #1
0
        void Start()
        {
            wander = GetComponent <WanderPlusAvoid>();
            if (wander == null)
            {
                Debug.LogError(gameObject + " has no WanderPlusAvois attached in " + this);
            }

            arrive = GetComponent <ArrivePlusAvoid>();
            if (arrive == null)
            {
                Debug.LogError(gameObject + " has no ArrivePlusAvoid attached in " + this);
            }

            blackboard = GetComponent <MOUSE_Blackboard>();
            if (blackboard == null)
            {
                blackboard = gameObject.AddComponent <MOUSE_Blackboard>();
            }

            // the global blackboard it's better created by an external agent
            // or (if has to be created here) must come from a class implementing the SINGLETON PATTERN

            wander.enabled = false;
            arrive.enabled = false;
        }
コード例 #2
0
 private void Start()
 {
     blackboard      = GetComponent <ThrowHandsEnemyBlackboard>();
     enemyPassiveFSM = GetComponent <ThrowHandsEnemyPassiveFSM>();
     wanderPlusAvoid = GetComponent <WanderPlusAvoid>();
     arrivePlusAvoid = GetComponent <ArrivePlusAvoid>();
 }
コード例 #3
0
    private void Start()
    {
        blackboard      = GetComponent <ThrowHandsEnemyBlackboard>();
        wanderPlusAvoid = GetComponent <WanderPlusAvoid>();
        arrivePlusAvoid = GetComponent <ArrivePlusAvoid>();

        timer = 0;
    }
コード例 #4
0
        protected override SteeringOutput GetSteering()
        {
            SteeringOutput result = ArrivePlusAvoid.GetSteering(m_ownKS, m_arriveInfo, m_obstacleAvoidanceInfo, ref obstacleAvoided);

            base.ApplyFacingPolicy(obstacleAvoided ? m_obstacleAvoidanceInfo.m_facingPolicy : m_arriveInfo.m_facingPolicy, result);

            return(result);
        }
コード例 #5
0
    void SetArrivePlusAvoidVariables()
    {
        ArrivePlusAvoid arrivePlusAvoid = GetComponent <ArrivePlusAvoid>();

        arrivePlusAvoid.closeEnoughRadius = closeEnoughRadius;
        arrivePlusAvoid.slowDownRadius    = slowDownRadius;

        arrivePlusAvoid.lookAheadLength       = lookAheadLength;
        arrivePlusAvoid.avoidDistance         = avoidDistance;
        arrivePlusAvoid.secondaryWhiskerAngle = secondaryWhiskerAngle;
        arrivePlusAvoid.secondaryWhiskerRatio = secondaryWhiskerRatio;
        arrivePlusAvoid.avoidLayers           = avoidLayers;
        arrivePlusAvoid.scanner = scannerSphereCollider;

        arrivePlusAvoid.repulsionTag       = repulsionTag;
        arrivePlusAvoid.repulsionThreshold = repulsionThreshold;
        arrivePlusAvoid.arriveWeight       = arriveWeight;
    }