/** * Full initializer with parameters for array elements and a type param to force the element type (which can be necessary in the * event that UpdateValue returns null and no declaring type is found). */ public void Initialize(string name, UpdateValue getStoredValueDelegate, Callback <object> onValueChangedDelegate, UpdateValueWithIndex getStoredValueDelegateIndexed, Callback <int, object> onValueChangedDelegateIndexed) { if (!string.IsNullOrEmpty(name)) { this.memberName = name; } this.updateValue = getStoredValueDelegate; this.onValueChanged = onValueChangedDelegate; this.updateValueWithIndex = getStoredValueDelegateIndexed; this.onValueChangedAtIndex = onValueChangedDelegateIndexed; if (declaringType == null) { object o = updateValue != null?updateValue() : (updateValueWithIndex != null ? updateValueWithIndex(index) : null); if (o != null) { declaringType = o.GetType(); } else { declaringType = null; } } Initialize_INTERNAL(); }
/** * Type inspector initializer when parent object is an array. */ public void Initialize(string name, UpdateValueWithIndex getStoredValueDelegate, Callback <int, object> onValueChangedDelegate) { Initialize(name, null, null, getStoredValueDelegate, onValueChangedDelegate); }