public void generateTrack(trackSegmentPool.segment seg, bool withEndPart = false, bool addDestroyer = false) { generateTrack (seg.parts, seg.parameters, withEndPart, addDestroyer); }
// Use this for initialization void Awake() { stackRef = GetComponent<difficultyStack> (); if(!GetComponent<trackManager>()) { managerRef = GameObject.Find ("GameManager"); if(GetComponent<trackManager>()) { if(GetComponent<trackManager>().enabled) inEditor = true; } if(playerRef==null) playerRef = GameObject.Find ("Skater"); nextSegmentPosition = GameObject.Find ("InitPart").GetComponent<trackPartData> ().endPoint.transform.position; segmentPoolRef = managerRef.GetComponent<trackSegmentPool> (); partPoolRef = managerRef.GetComponent<trackPartPool> (); pickUpPoolRef = managerRef.GetComponent<PickUpPool>(); backgroundRef = GetComponent<BackgroundSpawner>(); segmentPoolRef.loadSegments (); } }