public ChaseTarget(AIControls ai, CarController car, Transform target) : base(ai, car) { this.target = target; ai.Follow(target); // Chase the target }
// Use this for initialization void Start() { character = GetComponent <Character>(); animator = GetComponent <Animator>(); AIcontrols = GetComponentInParent <AIControls>(); sharedProperties = GetComponentInParent <SharedProperties>(); if (GetComponentInParent <Opponent>() != null) { player = FindObjectOfType <Player>(); playerCharacter = player.GetComponentInChildren <Character>(); opponentController = GetComponentInParent <Opponent>(); animator.SetInteger("hadoukenOwner", 2); } else if (GetComponentInParent <Player>() != null) { opponent = FindObjectOfType <Opponent>(); opponentCharacter = opponent.GetComponentInChildren <Character>(); playerController = GetComponentInParent <Player>(); animator.SetInteger("hadoukenOwner", 1); } decisionTimerInput = decisionTimer; antiAirTimerInput = antiAirTimer; antiAirTimer = 0f; decision = Random.Range(0, 100); lastUsedNormal = LastUsedNormal.none; }
public AIState(AIControls ai, CarController car) { this.ai = ai; this.car = car; Debug.Log(GetType().ToString()); }
// Use this for initialization void Start() { if (GetComponentInParent <Opponent>() != null) { player = FindObjectOfType <Player>(); playerCharacter = player.GetComponentInChildren <Character>(); } else if (GetComponentInParent <Player>() != null) { opponent = FindObjectOfType <Opponent>(); opponentCharacter = opponent.GetComponentInChildren <Character>(); } character = GetComponent <Character>(); animator = GetComponent <Animator>(); AIcontrols = GetComponentInParent <AIControls>(); chargeSystem = GetComponentInParent <ChargeSystem>(); sharedProperties = GetComponentInParent <SharedProperties>(); regularFarRangeDecisions = new List <string>(); regularMidRangeDecisions = new List <string>(); regularCloseRangeDecisions = new List <string>(); airAttackDecisions = new List <string>(); otherFighterBlockedDecisions = new List <string>(); otherFighterGotHitDecisions = new List <string>(); knockDownDecisions = new List <string>(); antiAirDecisions = new List <string>(); RegularFarRangeDecisionTrees(); RegularMidRangeDecisionTrees(); RegularCloseRangeDecisionTrees(); AirAttackDecisionTrees(); OtherFighterBlockedDecisionTrees(); OtherFighterGotHitDecisionTrees(); KnockDownDecisionTrees(); AntiAirDecisionTrees(); decision = Random.Range(0, DECISION_MAX); decisionTimerInput = decisionTimer; antiAirTimerInput = antiAirTimer; antiAirTimer = 0f; }
private void Awake() { agent = GetComponent <NavMeshAgent>(); timeLeftToWalk = walkTime; if (isFlying && flyingBody != null) { flyingHeight = flyingBody.transform.position.y; } if (isFlying) { heart.SetValue(50); } // Detect debug commands aiControls = new AIControls(); aiControls.Debug.ToggleMovement.performed += _ => DebugToggleMove(); heartToDrop = Instantiate(heart, transform.position, transform.rotation, transform); heartToDrop.gameObject.transform.parent = null; }
// Use this for initialization void Start() { if (GetComponentInParent <Opponent>() != null) { player = FindObjectOfType <Player>(); playerCharacter = player.GetComponentInChildren <Character>(); } else if (GetComponentInParent <Player>() != null) { opponent = FindObjectOfType <Opponent>(); opponentCharacter = opponent.GetComponentInChildren <Character>(); } character = GetComponent <Character>(); animator = GetComponent <Animator>(); AIcontrols = GetComponentInParent <AIControls>(); sharedProperties = GetComponentInParent <SharedProperties>(); decisionTimerInput = decisionTimer; antiAirTimerInput = antiAirTimer; antiAirTimer = 0f; decision = Random.Range(0, 100); }
void Start() { AIControls = transform.parent.gameObject.GetComponent <AIControls>(); }
public HuntEnemy(AIControls ai, CarController car) : base(ai, car) { launcher = ai.GetComponent <RocketLauncher>(); }
public ClickToMove(AIControls ai, CarController car) : base(ai, car) /* Nothing */ }
public FindPowerUp(AIControls ai, CarController car) : base(ai, car) /* Nothing */ }
public EvasiveManoeuvres(AIControls ai, CarController car) : base(ai, car) { // TODO: listen for powerup spawn }