Exemplo 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>());
        }
 //TODO:简便显示实体的封装示例
 public static void ShowTrack(this EntityComponent entityComponent, TrackData data)
 {
     entityComponent.ShowEntity(typeof(Track), "Track", data);
 }