Exemple #1
0
    public void LoadTrackLayout(string assetName)
    {
        ClearTrackLayout();

        TrackLayout trackLayout = (TrackLayout)Resources.Load(assetName, typeof(TrackLayout));

        trackCollection = TrackCollection.GetInstance();
        TrackLayout.PopulateTrackCollection(trackLayout, trackCollection);

        foreach (TrackSection section in trackCollection.sections)
        {
            if (section != null && section.index != 0)
            {
                trackObjects.Add(CreateTrackObject(section));
            }
        }
        foreach (TrackJunction section in trackCollection.junctions)
        {
            if (section != null && section.index != 0)
            {
                junctionObjects.Add(CreateJunctionObject(section));
            }
        }
    }