public Situation(ActorCar actorCar = null, int trafficLight = TrafficLight.Empty, int trafficSign = TrafficSign.Empty, int position = Position.First, DataDirection direction = null, bool car = false, bool player = false) { this.trafficLight = trafficLight; this.trafficSign = trafficSign; this.position = position; this.car = car; this.direction = direction; this.player = player; }
void SpawnCar(Actor roadSpot, ref ActorCar actorCar, int direction) { var carSpot = roadSpot.Get <DataCarSpot>().carSpot; var car = Toolbox.Get <FactoryCar>().SpawnCar(carSpot.selfTransform.position, carSpot.selfTransform.rotation, cross.actors[0].selfTransform, Tag.SkateBoard); car.name = (roadSpot.Get <DataPosition>().position).ToString(); actorCar = car.GetComponent <ActorCar>(); actorCar.Get <DataDirection>().direction = direction; Homebrew.Timer.Add(0.1f, () => car.GetComponent <ActorCar>().GetComponent <ActorCar>().signals.Send(new SignalSetLights())); }
public bool TryGetCar(int position, out ActorCar car) { Situation roadSpot; if (dataCarsLocation.TryGetValue(position, out roadSpot)) { car = roadSpot.actorCar; if (car != null) { return(true); } } car = null; return(false); }
internal void SetRoadData(ActorCar car, int trafficLight, int trafficSign) { }