private string GetRaceStringForTimeStamp(int year, int month, int day) { if (!CreatureTypes.Any()) { return(RaceString); } List <CreatureType> relevantCreatureTypes = GetRelevantCreatureTypesByTimeStamp(year, month, day); string raceString = ""; if (!string.IsNullOrWhiteSpace(PreviousRace)) { raceString += PreviousRace.ToLower(); } else if (!string.IsNullOrWhiteSpace(AnimatedType)) { raceString += AnimatedType.ToLower(); } else { raceString += Race.NameSingular.ToLower(); } foreach (var creatureType in relevantCreatureTypes) { raceString += " " + creatureType.Type; } return(raceString); }
private void OnGUI() { GUILayout.BeginHorizontal(); if (GUILayout.Button("帮助")) { Help(); } if (GUILayout.Button("重置工具")) { Reset(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); _animatedType = (AnimatedType)EditorGUILayout.EnumPopup("动画的类型", _animatedType); GUILayout.Label("动画帧数(10 ~ 60帧)"); frames = EditorGUILayout.IntSlider(frames, 10, 60); GUILayout.EndHorizontal(); _fileStructure = (FileStructure)EditorGUILayout.EnumPopup("文件目录结构", _fileStructure); GUILayout.BeginHorizontal(); if (GUILayout.Button("选择要转换的图片文件根目录")) { _ImagePath = EditorUtility.OpenFolderPanel("选择要转换的图片文件根目录", Application.dataPath, "null"); hasSelected = true; } //显示其他选项 if (hasSelected) { localLocation = GUILayout.Toggle(localLocation, "动画文件本地放置"); if (!localLocation) { if (GUILayout.Button("选择动画保存的目录")) { _AnimationPath = EditorUtility.OpenFolderPanel("选择要转换的图片文件根目录", Application.dataPath, "null"); } } if (GUILayout.Button("创建动画")) { BuildAniamtion(); } GUILayout.EndHorizontal(); GUILayout.BeginVertical(); GUILayout.Label("要处理的文件目录"); EditorGUILayout.SelectableLabel(_ImagePath); if (!localLocation) { GUILayout.Label("保持动画文件目录"); EditorGUILayout.SelectableLabel(_AnimationPath); } } GUILayout.EndVertical(); }
public string GetRaceString() { if (Race == null) { Race = CreatureInfo.Unknown; } if (Deity) { return(Race.NameSingular.ToLower() + " deity"); } if (Force) { return("force"); } string raceString = ""; if (!string.IsNullOrWhiteSpace(PreviousRace)) { raceString += PreviousRace.ToLower() + " turned "; } else if (!string.IsNullOrWhiteSpace(AnimatedType) && !Name.Contains("Corpse")) { raceString += AnimatedType.ToLower(); } else { raceString += Race.NameSingular.ToLower(); } foreach (var creatureType in CreatureTypes) { raceString += " " + creatureType.Type; } return(raceString); }