public static void ShowProto(Proto proto)
 {
     if (proto != null)
     {
         ShowItem item = new ShowItem(proto, $"{proto.GetType().Name} {proto.name.Translate()}");
         ShowData(item);
     }
 }
示例#2
0
        /// <summary>
        /// Add data before game data loads
        /// </summary>
        /// <param name="proto">要添加的Proto</param>
        public static void PreAddProto(Proto proto)
        {
            int index = ProtoIndex.GetIndex(proto.GetType());

            if (!PreToAdd[index].Contains(proto))
            {
                if (proto is StringProto)
                {
                    int id = FindAvailableStringID();
                    proto.ID = id;
                }

                Bind(proto);
                PreToAdd[index].Add(proto);
                TotalDict[index].Add(proto);
            }
        }
示例#3
0
 public static string GetProtoName(Proto proto)
 {
     return(proto.GetType().Name.Replace("Proto", ""));
 }
示例#4
0
 public static int GetIndex(Proto proto)
 {
     return(GetIndex(proto.GetType()));
 }