public void ExportDCFGByElement <TElement, TDCFG>(List <TDCFG> cfgList, FTWorldMap worldMap) where TElement : FTComponent where TDCFG : MapComponent { List <TElement> list = worldMap.GetGroup <FTGroup <TElement> >().GetElements(); for (int i = 0; i < list.Count; i++) { cfgList.Add(list[i].Export() as TDCFG); } }
public void ImportEvents(List <MapEvent> cfgList, FTWorldMap worldMap) { FTGroupEvent group = worldMap.GetGroup <FTGroupEvent>(); for (int i = 0; i < cfgList.Count; i++) { MapEvent d = cfgList[i]; EFTEventType t = (EFTEventType)d.EventType; Type type = Type.GetType("MAP." + t.ToString()); group.AddEvent(type); } }
public void ImportDCFGByElement <TElement, TDCFG>(List <TDCFG> cfgList, FTWorldMap worldMap) where TElement : FTComponent where TDCFG : MapComponent { FTGroup <TElement> group = worldMap.GetGroup <FTGroup <TElement> >(); for (int i = 0; i < cfgList.Count; i++) { TElement element = group.AddElement(); element.Import(cfgList[i]); } }
public static void DrawEvents(FTWorldMap map, List <FTEvent> events) { #if UNITY_EDITOR GUILayout.Space(10); GUI.color = Color.green; if (GUILayout.Button("添加事件", FTGUIStyles.FTButtonStyle, GUILayout.Height(40))) { FTEditorHelper.ShowMenu(typeof(FTEvent), (obj) => { FTEvent e = map.GetGroup <FTGroupEvent>().AddEvent(obj as Type); events.Add(e); }); } for (int i = 0; i < events.Count; i++) { GUILayout.Label(events[i].name); } GUILayout.Space(10); GUI.color = Color.white; #endif }