Esempio n. 1
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);
            m_TrackData = (TrackData)userData;
            if (AllTrack.Count < 1)
            {
                CachedTransform.SetLocalPosition(m_TrackData.StartPostion);
            }
            else
            {
                CachedTransform.SetLocalPosition(new Vector3(0, -2.2f, ProTrack.GetComponent <TrackSegment>().pathParent.GetChild(1).transform.position.z + 4f));
            }
            ProTrack = this;
            AllTrack.Enqueue(this);

            if (m_TrackData.TypeId == 34)
            {
                TrackInitFinished = true;
                CurrentGoneTrack  = AllTrack.Dequeue();
            }

            SpawnObstacle(this.GetComponent <TrackSegment>());
        }