void Awake() { aiGrnd = GetComponent <AI_GroundAttack>(); myRWR = GetComponent <RWR>(); myRb = GetComponent <Rigidbody>(); airAI = GetComponent <AI_Aircraft>(); flare = GetComponent <FlareEmitter>(); }
// Update is called once per frame void Update() { if (localPlayerRWR == null) { if (debug) { Debug.LogWarning("Local player rwr null, pinging set to false"); } rwrIcon.showPingResult(false, 0.0f, 0.0f); GameObject localPlayer = GameManager.getGM().localPlayer; if (localPlayer != null) { localPlayerRWR = GameManager.getGM().localPlayer.GetComponent <RWR>(); localPlayerFlow = localPlayerRWR.GetComponent <CombatFlow>(); if (debug) { Debug.LogWarning("Found local player: " + localPlayerFlow.gameObject.name); } // } } // don't ping yourself // can find localPlayerRWR // no friendly pings if (!myFlow.isLocalPlayer && localPlayerRWR != null && myFlow.team != localPlayerFlow.team) { if (debug) { Debug.LogWarning("Counting down timer"); } if (pingTimer()) { if (debug) { Debug.LogWarning("Trying to ping"); } tryPing(); } } if (myFlow.isLocalPlayer) { if (rwrIcon != null) { GameObject.Destroy(rwrIcon.gameObject); } } }
private int countMissilesAgainstTarget(CombatFlow target) { RWR targetRWR = target.rwr; int missiles = 0; if (targetRWR != null) { missiles = targetRWR.incomingMissiles.Count; } // use target's rwr to find missiles launched by this aircraft return(missiles); }
void Awake() { // start these vectors with some magnitude, helps facilitate rotation lerping targetDir = transform.forward; currentDir = transform.forward; myFlow = GetComponent <CombatFlow>(); dirAI = GetComponent <DirectionAI>(); engine = GetComponent <EngineControl>(); myRb = GetComponent <Rigidbody>(); rwr = GetComponent <RWR>(); aiTgtComputer = GetComponent <AI_TgtComputer>(); mslAvoid = GetComponent <AI_MissileEvade>(); aiGroundAttack = GetComponent <AI_GroundAttack>(); }
private void Awake() { myRadar = GetComponent <Radar>(); rwr = GetComponent <RWR>(); creepAI = GetComponent <CreepControl>(); myRb = GetComponent <Rigidbody>(); if (CombatFlow.combatUnits == null) { CombatFlow.combatUnits = new List <CombatFlow>(); } if (showInWorldList) { CombatFlow.combatUnits.Add(this); } seenBy = new List <int>(); gameObject.name = abbreviation; }