public static SidConfigAttribute GetSidConfigAttribute(this SidConfig value)
        {
            FieldInfo info = value.GetType().GetField(value.ToString());

            Assert.IsNotNull(info, "找不到info");
            object[] attributes = info.GetCustomAttributes(typeof(SidConfigAttribute), true);
            Assert.IsTrue(attributes.Length > 0, "没有attributes");
            SidConfigAttribute sidConfigAttribute = (SidConfigAttribute)attributes[0];

            return(sidConfigAttribute);
        }
        public static string GetChannelFolder(this SidConfig value, ChannelType type)
        {
            SidConfigAttribute sidConfigAttribute = GetSidConfigAttribute(value);

            if (!string.IsNullOrEmpty(sidConfigAttribute.BundleId))
            {
                return(sidConfigAttribute.ChannelFolder);
            }
            ChannelTypeAttribute channelTypeAttribute = GetChannelTypeAttribute(type);

            return(channelTypeAttribute.ChannelFolder);
        }
Exemple #3
0
 static int set_sidConfigAttr(IntPtr L)
 {
     try
     {
         LuaFramework.SidConfigAttribute arg0 = (LuaFramework.SidConfigAttribute)ToLua.CheckObject <LuaFramework.SidConfigAttribute>(L, 2);
         LuaFramework.AppConst.sidConfigAttr = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }