예제 #1
0
    public void ClearBaseDateSetItem(Type type, BaseDateSet set)
    {
        List <BaseDateSet> list = mDateSet[type];

        for (int i = list.Count; i >= 0; i--)
        {
            if (list[i] == set)
            {
                list.Remove(set);
            }
        }
    }
예제 #2
0
    public void RemoveDateSet(BaseDateSet date)
    {
        Type t = date.GetType();

        if (mDateSet.ContainsKey(t))
        {
            List <BaseDateSet> list = mDateSet[t];
            list.Remove(date);
        }
        else
        {
            Debug.Log("不包含的类");
        }
    }
예제 #3
0
    public void AddDateSet(BaseDateSet data)
    {
        Type t = data.GetType();

        if (mDateSet.ContainsKey(t))
        {
            List <BaseDateSet> list = mDateSet[t];
            list.Add(data);
        }
        else
        {
            List <BaseDateSet> list = new List <BaseDateSet> ()
            {
                data
            };
            mDateSet[t] = list;
        }
    }
예제 #4
0
 public BaseDateSet CreateDateSet(Type type, JsonData data)
 {
     if (type.IsSubclassOf(typeof(BaseDateSet)))
     {
         if (!mDateSet.ContainsKey(type))
         {
             mDateSet.Add(type, new List <BaseDateSet> ());
         }
         if (data != null)
         {
             List <BaseDateSet> list = mDateSet[type];
             BaseDateSet        set  = ScriptableObject.CreateInstance(type) as BaseDateSet;
             set.Fill(data);
             list.Add(set);
             return(set);
         }
         return(null);
     }
     else
     {
         Debug.Log("不存在的数据类型");
         return(null);
     }
 }