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; }
private void Start() { blackboard = GetComponent <ThrowHandsEnemyBlackboard>(); enemyPassiveFSM = GetComponent <ThrowHandsEnemyPassiveFSM>(); wanderPlusAvoid = GetComponent <WanderPlusAvoid>(); arrivePlusAvoid = GetComponent <ArrivePlusAvoid>(); }
private void Start() { blackboard = GetComponent <ThrowHandsEnemyBlackboard>(); wanderPlusAvoid = GetComponent <WanderPlusAvoid>(); arrivePlusAvoid = GetComponent <ArrivePlusAvoid>(); timer = 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); }
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; }