Example #1
0
    // Add the given sections from the sections list
    static void AddSection(GameObject section, bool removeLast = true)
    {
        if(removeLast) RemoveLastSection();
        Section newSection = new Section(section, ("S"+(totalSections+1)), sectionOffset, sectionRotation);
        newSection.obj.gameObject.transform.parent = sectionHolder.transform;
        totalPoints += newSection.waypointCount;
        instantiatedSections[totalSections%maximumSections] = newSection;
        sectionOffset = newSection.nextSectionPosition(sectionOffset);
        sectionRotation = Quaternion.identity * newSection.nextSectionRotation();

        totalSections++;
    }