public SerializableUIOptionBase(string fieldName, Options.PersistTo scope)
        {
            _fieldName = fieldName;
            _scope     = scope;

            if (scope.IsFlagSet(Options.PersistTo.Savegame))
            {
                _fieldInfo = typeof(Options).GetField(fieldName, BindingFlags.Static | BindingFlags.Public);

                if (_fieldInfo == null)
                {
                    throw new Exception($"SerializableUIOptionBase.ctor: `{fieldName}` does not exist");
                }
            }
        }
Example #2
0
 public CheckboxOption(string fieldName, Options.PersistTo scope = Options.PersistTo.Savegame)
     : base(fieldName, scope)
 {
     OnValueChanged = DefaultOnValueChanged;
 }