// Use this for initialization void Start() { cruiser = UnitSpawner.SpawnUnit(UnitReferences.AlliedCruiserHeavy1, Vector3.zero); cruiser.GetComponent <CruiserAIController>().goToPoints = goToPoints; priority = GetComponent <PriorityTarget>(); if (priority) { priority.setEnemyPriority(cruiser); } else { Debug.LogError("PriorityTarget component not found."); } }
/// <summary> /// Remove target from priority list /// </summary> /// <param name = "targetToRemove"></param> public bool RemovePrimaryWeaponPriorityTarget(PriorityTarget targetToRemove) { try { _primaryWeaponPriorityTargets.Remove(targetToRemove); } catch (Exception) { Logging.Log("Cache.RemovePrimaryWeaponPriorityTargets","Unable to remove [" + targetToRemove.Entity.Name + "] from the _primaryWeaponPriorityTargets list, was it already removed?",Logging.Teal); return true; //(should we return false here?!) - if we did questor would hang... } return true; }