void SendFiremanTo(Node fire) { List <Node> entrances = CheckAdjRoads(); Structure str = world.Map.GetBuildingAt(fire).GetComponent <Structure>(); if (entrances.Count == 0) { return; } Node start = entrances[0]; GameObject go = Instantiate(Resources.Load <GameObject>("Walkers/Fireman")); go.transform.position = start.GetVector3(); go.name = "FiremanFrom_" + name; Carryer c = go.GetComponent <Carryer>(); c.world = world; c.Origin = this; c.Destination = str; c.Path = c.FindPath(start, fire); c.Activate(); }
public void SpawnGetter(ItemOrder io, Structure s) { Node start = CheckAdjRoads()[0]; Node stop = s.CheckAdjRoads()[0]; GameObject go = Instantiate(Resources.Load <GameObject>("Walkers/GetterCart")); go.transform.position = start.GetVector3(); go.name = "CartFrom_" + name; Carryer c = go.GetComponent <Carryer>(); c.world = world; c.Order = io; c.Origin = this; c.Destination = s; c.Path = c.FindPath(start, stop); c.Activate(); }