コード例 #1
0
        public STimeData AddStateVlaue <T>(string key, T value, float time, string group = DEFAULT)
        {
            STimeData sd = AddState(key, time, group);

            sd.ex = value;
            return(sd);
        }
コード例 #2
0
 public void ResetGroup(string group = DEFAULT)
 {
     for (int i = mSTimeData.Count - 1; i >= 0; i--)
     {
         STimeData std = mSTimeData[i];
         if (std.Group == group || group == "")
         {
             mSTimeData.Remove(std);
             mMapSTimeData.Remove(std.key);
             if (mCallEvent != null)
             {
                 mCallEvent(std, STimeType.ST_Reset);
             }
         }
     }
 }
コード例 #3
0
        public List <STimeData> GetStimeDataList(string group = DEFAULT)
        {
            if (group == "")
            {
                return(mSTimeData);
            }

            List <STimeData> stdList = new List <STimeData>();

            for (int i = 0; i < mSTimeData.Count; i++)
            {
                STimeData std = mSTimeData[i];
                if (std.Group == group)
                {
                    stdList.Add(std);
                }
            }
            return(stdList);
        }
コード例 #4
0
 public override float PlayLogic(float timeDp)
 {
     for (int i = mSTimeData.Count - 1; i >= 0; i--)
     {
         STimeData std = mSTimeData[i];
         std.allTime += timeDp;
         if ((std.time -= timeDp) <= 0)
         {
             if (mCallEvent != null)
             {
                 mCallEvent(std, STimeType.ST_Normal);
             }
             if (std.time < 0)
             {
                 mSTimeData.Remove(std);
                 mMapSTimeData.Remove(std.key);
             }
         }
     }
     return(0);
 }
コード例 #5
0
        public STimeData AddState(string key, float time, string group = DEFAULT)
        {
            STimeData std = GetStimeData(key);

            if (std == null)
            {
                std = new STimeData();
                mSTimeData.Add(std);
            }
            else
            {
                if (mCallEvent != null)
                {
                    mCallEvent(std, STimeType.ST_Reset);
                }
            }
            std.key   = key;
            std.time  = time;
            std.Group = group;
            mMapSTimeData[std.key] = std;
            return(std);
        }