public Data() { userDefined = true; changed = false; isStepFlag = false; propertyFlag = ""; optionText = ""; currentValue = ""; propertyType = Type.GROUP; associatedEnumType = ""; processStep = (aiPostProcessSteps)0; propertyCategory = Category.None;; customOption = SelfDefinedOption.NONE; }
private static System.Object InitValue(SelfDefinedOption option, Property.Type type, System.Object default_value) { string key_name = Enum.GetName(typeof(SelfDefinedOption), option); if (PlayerPrefs.HasKey(key_name)) { return(PlayerPrefs.GetString(key_name)); } else { if (type == Property.Type.FLAG) { return((int)default_value); // Must be cast explicitely to int to avoid ToString conversion of enums } else { return(default_value); } } }
internal Data(SelfDefinedOption option, Property.Type type, Category category, System.Type enum_type, System.Object init_value) : this(Enum.GetName(typeof(SelfDefinedOption), option), type, category, InitValue(option, type, (int)init_value), true) { customOption = option; associatedEnumType = enum_type.ToString(); }
internal Data(SelfDefinedOption option, Property.Type type, Category category, System.Object init_value) : this(option, type, category, init_value, true) { }
internal Data(SelfDefinedOption option, Property.Type type, Category category, System.Object init_value, bool user_defined) : this(Enum.GetName(typeof(SelfDefinedOption), option), type, category, InitValue(option, type, init_value), user_defined) { customOption = option; }