// Update is called once per frame //void Update() //{ //} void SetupPath() { GameObject pathRoot = GameObject.Find("RootPath"); List <CurveNodeData> pathDataList = new List <CurveNodeData>(); Transform pathTrans = pathRoot.transform; for (int i = 0; i < pathTrans.childCount; ++i) { Transform child = pathTrans.GetChild(i); CurveNodeData data = new CurveNodeData(); data.position = child.position; data.rotation = child.rotation; pathDataList.Add(data); } TrackManager.GetInstance().GenerateTrack(trackPrefab, pathDataList.ToArray()); }
// Use this for initialization void Start() { TrackManager.GetInstance().Init(TrackNumDef.enTrackType.Curve); //SetupPath(); }