public static IVariableStore DrawTable(IVariableStore store, bool allowAddRemove) { var names = store.GetVariableNames(); IVariableStore selectedStore = null; foreach (var name in names) { var value = store.GetVariable(name); using (var changes = new EditorGUI.ChangeCheckScope()) { switch (value.Type) { case VariableType.Empty: DrawEmpty(name, ref value); break; case VariableType.Boolean: DrawBoolean(name, ref value); break; case VariableType.Integer: DrawInteger(name, ref value); break; case VariableType.Number: DrawNumber(name, ref value); break; case VariableType.String: DrawString(name, ref value); break; case VariableType.Null: DrawNull(name, ref value); break; default: { if (DrawLink(name, value.RawObject)) // TODO: show object picker { selectedStore = value.Store; } break; } } if (changes.changed) { store.SetVariable(name, value); } } } return(selectedStore); }
public virtual SetVariableResult SetVariable(string name, VariableValue value) => name == ValueName ? SetVariableResult.ReadOnly : _parent.SetVariable(name, value);