Ejemplo n.º 1
0
        /// <summary>
        /// Returns a member constructed from the current parameter values.
        /// </summary>
        /// <returns></returns>
        protected UnityMemberBase GetValue()
        {
            if (hasMultipleDifferentValues ||
                string.IsNullOrEmpty(nameProperty.stringValue))
            {
                return(null);
            }

            string component = componentProperty.stringValue;
            string name      = nameProperty.stringValue;

            Type[] parameterTypes = UnityMemberDrawerHelper.DeserializeParameterTypes(parameterTypesProperty);

            if (component == string.Empty)
            {
                component = null;
            }
            if (name == string.Empty)
            {
                name = null;
            }
            // Cannot reliably determine if parameterTypes should be null; see other TODO note for selectedOption.

            return(new UnityMember(component, name, parameterTypes));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Assigns the property values from a specified member.
 /// </summary>
 protected virtual void SetValue(UnityMemberBase value)
 {
     if (value != null)
     {
         componentProperty.stringValue = value.component;
         nameProperty.stringValue      = value.name;
         UnityMemberDrawerHelper.SerializeParameterTypes(parameterTypesProperty, value.parameterTypes);
     }
     else
     {
         componentProperty.stringValue    = null;
         nameProperty.stringValue         = null;
         parameterTypesProperty.arraySize = 0;
     }
 }