Beispiel #1
0
        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);
        }
Beispiel #2
0
        public Junction(string id, SplitTrack branchDefault, SplitTrack branchAlternate, JunctionDirection direction)
        {
            Id = id;
            NextBranchType = BranchType.BranchDefault;
            Direction = direction;

            BranchDefault = GetFirstGroup(branchDefault);
            BranchAlternate = GetFirstGroup(branchAlternate);
        }
Beispiel #3
0
        public void OnAttachToSplitTrack(SplitTrack splitTrack)
        {

            SplitTrack = splitTrack;
        }
Beispiel #4
0
 public Level(string levelName, SplitTrack end, SplitTrack start)
 {
     LevelName = levelName;
     End = end;
     Start = start;
 }
Beispiel #5
0
 private SubTrackGroup GetFirstGroup(SplitTrack subTrack)
 {
     return Direction == JunctionDirection.OneToMany ? subTrack.FirstSubTrack.FirstGroup : subTrack.LastSubTrack.LastGroup;
 }