コード例 #1
0
        public static GEventAttribute GetAttr(GEventStyle data)
        {
            GEventAttribute attr = null;

            eventAttrDic.TryGetValue(data.GetType(), out attr);
            return(attr);
        }
コード例 #2
0
 public static void Init()
 {
     if (typeDic.Count > 0)
     {
         return;
     }
     System.Type[] ctypes = typeof(GEvent).Assembly.GetTypes();
     foreach (System.Type t in ctypes)
     {
         GEventAttribute[] attrs = t.GetCustomAttributes(typeof(GEventAttribute), true) as GEventAttribute[];
         if (attrs != null)
         {
             if (attrs.Length > 0)
             {
                 GEventAttribute att   = attrs[0];
                 string          tName = t.Name;
                 eventAttrDic[t] = attrs[0];
                 typeDic[tName]  = t;
                 if (t == typeof(GTimelineStyle))
                 {
                     eventPoolDic[tName] = new ObjectPool(actionOnGet, actionOnRelease);
                 }
                 else
                 {
                     eventPoolDic[tName] = new ObjectPool();// attrs[0].dataType;
                 }
             }
         }
     }
 }