public EnemyBrain(Person person) { _person = person; _storage = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", _person.transform.position); SetMyDummyToMyCurrPosAndIni(); _fin = _storage; CreateRoute(); GameController.ChangeGameModeTo(H.War); }
public Transform GiveMeClosestUnit(Vector3 from) { var tMin = GetClosestEnemy(Units, from); if (tMin == null) { //tMin = Program.gameScene.BuildingManager.GetClosestBuild(from); tMin = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", from).transform; } return(tMin); }
// Use this for initialization void Start() { StartCoroutine("OneSecUpdate"); _base = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", transform.position).gameObject; _agent = GetComponent <NavMeshAgent>(); base.Start(); _marker = GetChildCalled("Marker"); Ammo = 200; //Health = 6; StartTargetAdquired(); LoadBulletGO(); }
private void CheckOnAgentAndTarget() { if (Health == 0) { return; } if (_didTargetRocket) { return; } var dist = Vector3.Distance(transform.position, _base.transform.position); if (dist > 40) { TargetRocket(); return; } _targetPos = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", transform.position).transform.position; }
/// <summary> /// So it gets added back to the closest Storage /// </summary> /// <param name="item"></param> /// <param name="amt"></param> /// <param name="position"></param> public void Add(P item, float amt, Vector3 position) { var closest = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", position, true); closest.Inventory.Add(item, amt); }