|
|
|
|
|
|
|
|
|
|
if (propertyInfo.PropertyType != typeof(Toggle)) |
|
|
|
throw new ArgumentException("Property must be a Toggle.", "propertyInfo"); |
|
|
|
|
|
|
|
|
|
|
|
label = label ?? ObjectNames.NicifyVariableName(propertyInfo.Name); |
|
|
|
|
|
|
|
var value = (Toggle)m_PropertyInfo.GetValue(m_Node, null); |
|
|
|
|
|
|
Action changedToggle = () => { OnChangeToggle(); }; |
|
|
|
m_Toggle = new UnityEngine.Experimental.UIElements.Toggle(changedToggle); |
|
|
|
m_Toggle.SetEnabled(value.isEnabled); |
|
|
|
m_Toggle.on = value.isOn; |
|
|
|
m_Toggle.SetValue(value.isOn); |
|
|
|
panel.Add(m_Toggle); |
|
|
|
Add(panel); |
|
|
|
} |
|
|
|
|
|
|
var value = (Toggle)m_PropertyInfo.GetValue(m_Node, null); |
|
|
|
m_Toggle.SetEnabled(value.isEnabled); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void OnChangeToggle() |
|
|
|