public TrainController(LevelTree level, SplitTrack startTrack, GameObject trainPrefab, TrackConnectionResolver connectionResolver) { SubTrackGroup stGroup = startTrack.FirstSubTrack.FirstGroup; _trackRunner = new TrackRunner(connectionResolver, stGroup, false); GameObject go = Object.Instantiate(trainPrefab); _trackFollowingGO = new TrackFollowingGameObject(go, _trackRunner, Vector3.forward); }
public Junction(string id, SplitTrack branchDefault, SplitTrack branchAlternate, JunctionDirection direction) { Id = id; NextBranchType = BranchType.BranchDefault; Direction = direction; BranchDefault = GetFirstGroup(branchDefault); BranchAlternate = GetFirstGroup(branchAlternate); }
public void OnAttachToSplitTrack(SplitTrack splitTrack) { SplitTrack = splitTrack; }
public Level(string levelName, SplitTrack end, SplitTrack start) { LevelName = levelName; End = end; Start = start; }
private SubTrackGroup GetFirstGroup(SplitTrack subTrack) { return Direction == JunctionDirection.OneToMany ? subTrack.FirstSubTrack.FirstGroup : subTrack.LastSubTrack.LastGroup; }