public static void ShowProto(Proto proto) { if (proto != null) { ShowItem item = new ShowItem(proto, $"{proto.GetType().Name} {proto.name.Translate()}"); ShowData(item); } }
/// <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); } }
public static string GetProtoName(Proto proto) { return(proto.GetType().Name.Replace("Proto", "")); }
public static int GetIndex(Proto proto) { return(GetIndex(proto.GetType())); }