Ejemplo n.º 1
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.º 2
0
        public SubTrack(string id, SplittedRegion splitRegion, SubTrackGroup[] trackGroups)
        {
            SplittedRegion = splitRegion;
            TrackGroups = trackGroups;
            Id = id;

            foreach (SubTrackGroup trackGroup in trackGroups)
            {
                trackGroup.OnAttachToSubTrack(this);
            }
        }
Ejemplo n.º 3
0
 public bool AllowPrevious(SubTrackGroup stGroup)
 {
     if(_junction.Direction == Junction.JunctionDirection.ManyToOne)
     {
         return stGroup == _junction.NextBranch;
     }
     return true;
 }
Ejemplo n.º 4
0
 public bool AllowNext(SubTrackGroup stGroup)
 {
     if(_junction.Direction == Junction.JunctionDirection.OneToMany)
     {
         return stGroup == _junction.NextBranch;
     }
     return true;
 }
Ejemplo n.º 5
0
 public TrackRunner(TrackConnectionResolver connectionResolver, SubTrackGroup initialTrackGroup, bool initialReverse)
 {
     ConnectionResolver = connectionResolver;
     Setup(initialTrackGroup, initialReverse);
 }
Ejemplo n.º 6
0
 private void Setup(SubTrackGroup initialTrackGroup, bool initialReverse)
 {
     NextConnection = true;
     _connectionCtx = ConnectionResolver.FirstContext(initialTrackGroup, initialReverse);
     _interpolator = new BezierSpline.LinearInterpolator(initialTrackGroup.Spline, initialReverse);
     _interpolator.Step(0);
     _currentPt = _interpolator.Value();
     SetStartingValues();
 }
Ejemplo n.º 7
0
 private Vector3 DirectionFromTrackGroup(SubTrackGroup trackGroup)
 {
     return trackGroup.NumTrackNodes > 1 ? trackGroup.Nodes[1].Forward : trackGroup.Nodes[0].Forward;
 }
Ejemplo n.º 8
0
 public bool ReferencesGroup(SubTrackGroup group)
 {
     return BranchDefault == group || BranchAlternate == group;
 }