private void InfoCollectJob(Vector3 point, float radius) { if (area != 0 && !position.Equals(Vector3.zero)) { var colliders = Physics.OverlapSphere(point, radius); for (int i = 0; i < colliders.Length; i++) { StoneMountain stoneMountain; if ((stoneMountain = colliders[i].gameObject.GetComponent <StoneMountain>()) != null) { Job moveJob = new Job(Job.JobType.MOVE); moveJob.position = stoneMountain.transform.position; Job examineJob = new Job(Job.JobType.ACTION); Action actionAddTree = new Action(() => { stones.Add(stoneMountain); }); examineJob.extra0 = actionAddTree; cheif.AddJob(moveJob); cheif.AddJob(examineJob); } } Job actionJob = new Job(Job.JobType.ACTION); Action action = new Action(() => { status = HarvestStoneWorkStatus.WORKING; }); actionJob.extra0 = action; cheif.AddJob(actionJob); } }
private void HarvestStoneWork_onAreaChanged(HarvestStoneWork work, Vector3 point, float radius) { stones.Clear(); status = HarvestStoneWorkStatus.INFO_COLLECT; if (cheif != null) { InfoCollectJob(point, radius); } }
private void HarvestStoneWork_onCheifChanged(NPCLogic currentCheif) { stones.Clear(); status = HarvestStoneWorkStatus.INFO_COLLECT; if (cheif != null) { InfoCollectJob(position.position, area); } }