Example #1
0
 public void Reset()
 {
     SourceData       = null;
     FinishAction     = null;
     m_CurrentTLIndex = -1;
     isRunning        = false;
     timelines.Clear();
 }
Example #2
0
 public void Init(TimeLineGroup skill, RuntimeData srd)
 {
     this.SourceData    = skill;
     this.m_RunningData = srd;
     m_CurrentTLIndex   = -1;
     isRunning          = true;
     for (int i = 0; i < m_TimeLineCount; i++)
     {
         var rtl = Pool.SP.Get(RuntimeTimeLine.TimelineDataAndLogic[SourceData.TimeLines[i].GetType()]) as RuntimeTimeLine;
         timelines.Add(rtl);
         timelines[i].Init(SourceData.TimeLines[i], srd);
     }
 }
Example #3
0
        public static void SaveToSkillIndexFile(TimeLineGroup tlg, string fpath)
        {
            string indexPath = GetRequiredConfigsPath();

            if (tlg is Skill)
            {
                indexPath += "Skills/skill_index.bytes";
            }
            else if (tlg is Event)
            {
                indexPath += "Events/event_index.bytes";
            }
            else
            {
                indexPath += "Buffs/buff_index.bytes";
            }
            Dictionary <int, string> dic = null;

            if (File.Exists(indexPath))
            {
                var text = File.ReadAllText(indexPath);
                dic = Newtonsoft.Json.JsonConvert.DeserializeObject <Dictionary <int, string> >(text, settings);
            }
            else
            {
                File.Create(indexPath).Dispose();
                dic = new Dictionary <int, string>();
            }

            if (!dic.ContainsKey(tlg.ID))
            {
                fpath = fpath.Replace(@"\\", @"/");
                fpath = Path.GetFileName(fpath);
                if (fpath[0].Equals('/'))
                {
                    fpath.Remove(0);
                }
                dic.Add(tlg.ID, fpath);
                string text = Newtonsoft.Json.JsonConvert.SerializeObject(dic, Formatting.Indented, settings);
                File.WriteAllText(indexPath, text);
            }
        }
Example #4
0
        public static void SaveTimelineGroup(TimeLineGroup skill, string path)
        {
            string text = Newtonsoft.Json.JsonConvert.SerializeObject(skill, Formatting.Indented, settings);

            File.WriteAllText(path, text);
        }