Beispiel #1
0
        protected override bool CheckNeedJump()
        {
            TDGuide data = TDGuideTable.GetData(m_GuideId);

            if (data == null)
            {
                return(true);
            }

            if (string.IsNullOrEmpty(data.jumpTrigger))
            {
                return(false);
            }

            List <ITrigger> triggerList = LoadTrigger(data.jumpTrigger, data.commonParam);

            if (triggerList == null || triggerList.Count == 0)
            {
                return(false);
            }

            for (int i = 0; i < triggerList.Count; ++i)
            {
                if (!triggerList[i].isReady)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        protected override List <ITrigger> GetTriggerArray()
        {
            TDGuide data = TDGuideTable.GetData(m_GuideId);

            if (data == null)
            {
                return(null);
            }

            return(LoadTrigger(data.trigger, data.commonParam));
        }
Beispiel #3
0
        private static void OnAddRow(TDGuide memberInstance)
        {
            int key = memberInstance.id;

            if (m_DataCache.ContainsKey(key))
            {
                Log.e(string.Format("Invaild,  TDGuideTable Id already exists {0}", key));
            }
            else
            {
                m_DataCache.Add(key, memberInstance);
                m_DataList.Add(memberInstance);
            }
        }
Beispiel #4
0
        public void StartGuideTrack()
        {
            var dataList = TDGuideTable.dataList;

            for (int i = 0; i < dataList.Count; ++i)
            {
                TDGuide data = dataList [i];
                if (IsGuideFinish(data.id))
                {
                    continue;
                }

                if (data.requireGuideId > 0)
                {
                    if (IsGuideFinish(data.requireGuideId))
                    {
                        AddTrackingGuide(new Guide(data.id));
                    }
                    else
                    {
                        m_UnTrackingGuide.Add(data);
                    }
                }
                else
                {
                    AddTrackingGuide(new Guide(data.id));
                }
            }

            bool needRecheck = false;

            for (int i = m_TrackingGuideList.Count - 1; i >= 0; --i)
            {
                if (!m_TrackingGuideList[i].StartTrack())
                {
                    SaveFinishGuideID(m_TrackingGuideList[i].guideID);
                    m_TrackingGuideList.RemoveAt(i);
                    needRecheck = true;
                }
            }

            if (needRecheck)
            {
                ReCheckUnTrackGuide();
            }
        }
Beispiel #5
0
        public static void Parse(byte[] fileData)
        {
            m_DataCache.Clear();
            m_DataList.Clear();
            DataStreamReader dataR = new DataStreamReader(fileData);
            int rowCount           = dataR.GetRowCount();

            int[] fieldIndex = dataR.GetFieldIndex(TDGuide.GetFieldHeadIndex());
    #if (UNITY_STANDALONE_WIN) || UNITY_EDITOR || UNITY_STANDALONE_OSX
            dataR.CheckFieldMatch(TDGuide.GetFieldHeadIndex(), "GuideTable");
    #endif
            for (int i = 0; i < rowCount; ++i)
            {
                TDGuide memberInstance = new TDGuide();
                memberInstance.ReadRow(dataR, fieldIndex);
                OnAddRow(memberInstance);
                memberInstance.Reset();
                CompleteRowAdd(memberInstance);
            }
            Log.i(string.Format("Parse Success TDGuide"));
        }
Beispiel #6
0
 static void CompleteRowAdd(TDGuide tdData)
 {
 }