UnityEditor.ModuleUI.GUIBoolAsPopup C# (CSharp) Method

GUIBoolAsPopup() public static method

public static GUIBoolAsPopup ( GUIContent label, UnityEditor.SerializedProperty boolProp, string options ) : bool
label UnityEngine.GUIContent
boolProp UnityEditor.SerializedProperty
options string
return bool
        public static bool GUIBoolAsPopup(GUIContent label, SerializedProperty boolProp, string[] options, params GUILayoutOption[] layoutOptions)
        {
            Rect position = PrefixLabel(GetControlRect(13, layoutOptions), label);
            int selectedIndex = !boolProp.boolValue ? 0 : 1;
            int num2 = EditorGUI.Popup(position, selectedIndex, options, ParticleSystemStyles.Get().popup);
            if (num2 != selectedIndex)
            {
                boolProp.boolValue = num2 > 0;
            }
            return (num2 > 0);
        }

Usage Example

 public override void OnInspectorGUI(ParticleSystem s)
 {
     if (VelocityModuleUI.s_Texts == null)
     {
         VelocityModuleUI.s_Texts = new VelocityModuleUI.Texts();
     }
     base.GUITripleMinMaxCurve(GUIContent.none, VelocityModuleUI.s_Texts.x, this.m_X, VelocityModuleUI.s_Texts.y, this.m_Y, VelocityModuleUI.s_Texts.z, this.m_Z, null);
     ModuleUI.GUIBoolAsPopup(VelocityModuleUI.s_Texts.space, this.m_InWorldSpace, VelocityModuleUI.s_Texts.spaces);
 }
All Usage Examples Of UnityEditor.ModuleUI::GUIBoolAsPopup