// Update is called once per frame public virtual void Update() { ResetTarget(); if (pdTarget != null) { pdTargObj = pdTarget.GetGameObject(); } if (target != null || pdTarget != null) { Fire(); } }
// Update is called once per frame public void Update() { ResetTarget(); foreach (Turret t in turrets) { if (target != null && t.tType == TurretType.CAPITAL) { t.Target = target.GetGameObject(); } try{ if (pdtarget != null && t.tType == TurretType.PD) { t.Target = pdtarget.GetGameObject(); } } catch { Debug.Log("<color=red>Avoiding Target Lockup Error: Turret</color> This warning can be safely ignored."); t.Target = null; } pdTargetsCount = pdTargets.Count; } }