public void SetCategory(GameTextCategory newCategory) { if (category != newCategory) { category = newCategory; SetCategoryId(null); } }
private void OnGameTextSetterCategoryChanged(GameTextCategory category) { if (category != GameTextCategory.None) { Reflection.InvokePrivateMethod(instance, "SetDevelopmentText", new object[] { null }); } instance.ImportText(); }
private void BuildSelectionInfos() { category = GameTextSetterInspector.Current.Instance.Category; var categoryTable = Reflection.GetPrivateField <GameText, Dictionary <Type, GameTextCategory> >(GameText.Instance, "CategoryTable"); var gameTexts = GameText.Instance.Cache.GetValueOrDefault((int)category); var enumType = categoryTable.Where(x => x.Value == category).Select(x => x.Key).FirstOrDefault(); selectionCache = gameTexts.Select(x => new SelectionInfo(x.Key, Enum.ToObject(enumType, x.Key).ToString(), x.Value)).ToArray(); }
// ※ SheetIdがGameTextCategoryのEnumIDとして登録されている. public string Find(GameTextCategory category, int enumValue) { if (Instance == null) { return(null); } if (category != GameTextCategory.None) { var texts = Instance.Cache.GetValueOrDefault((int)category); return(texts != null?texts.GetValueOrDefault(enumValue, null) : null); } return(null); }