Esempio n. 1
0
        private List <AbstractGuideCommand> GetCommandArray()
        {
            TDGuideStep data = TDGuideStepTable.GetData(m_GuideStepID);

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

            return(LoadCommands(data.command, data.commonParam));
        }
Esempio n. 2
0
        private List <IGuideTrigger> GetTriggerArray()
        {
            TDGuideStep data = TDGuideStepTable.GetData(m_GuideStepID);

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

            return(LoadTrigger(data.trigger, data.commonParam));
        }
Esempio n. 3
0
        public void SaveStep(GuideStep step)
        {
            int oldKeyStep = PrefsRecord.S.GetInt(GetLastKeyStepKey(step.guide.guideID));

            if (oldKeyStep >= step.stepID)
            {
                return;
            }

            //TODO:需要找到最近的关键帧并保存
            var data = TDGuideStepTable.GetData(step.stepID);

            if (data != null)
            {
                if (data.keyFrame == 1)
                {
                    PrefsRecord.S.SetInt(GetLastKeyStepKey(step.guide.guideID), step.stepID);
                    PrefsRecord.S.Save();
                }
                else
                {
                    //纪录最近的keyframe
                    var allStep = TDGuideStepTable.GetDataAsGuideID(step.guide.guideID);
                    for (int i = allStep.Count - 1; i >= 0; --i)
                    {
                        if (allStep[i].keyFrame == 0)
                        {
                            continue;
                        }

                        if (allStep[i].id <= oldKeyStep)
                        {
                            break;
                        }

                        if (allStep[i].id <= data.id)
                        {
                            PrefsRecord.S.SetInt(GetLastKeyStepKey(step.guide.guideID), allStep[i].id);
                            PrefsRecord.S.Save();
                            break;
                        }
                    }
                }
            }
        }