Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void OnAttachToSplitTrack(SplitTrack splitTrack)
        {

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