UnityEditor.ModuleUI.GUIMask C# (CSharp) Method

GUIMask() public static method

public static GUIMask ( GUIContent label, int intValue, string options ) : int
label UnityEngine.GUIContent
intValue int
options string
return int
        public static int GUIMask(GUIContent label, int intValue, string[] options, params GUILayoutOption[] layoutOptions)
        {
            return EditorGUI.MaskField(PrefixLabel(GetControlRect(13, layoutOptions), label), label, intValue, options, ParticleSystemStyles.Get().popup);
        }

Usage Example

示例#1
0
        private void ShowSubEmitter(int index)
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[]
            {
                GUILayout.Height(16f)
            });
            SerializedProperty arrayElementAtIndex = this.m_SubEmitters.GetArrayElementAtIndex(index);
            SerializedProperty serializedProperty  = arrayElementAtIndex.FindPropertyRelative("emitter");
            SerializedProperty serializedProperty2 = arrayElementAtIndex.FindPropertyRelative("type");
            SerializedProperty intProp             = arrayElementAtIndex.FindPropertyRelative("properties");

            ModuleUI.GUIPopup(GUIContent.none, serializedProperty2, SubModuleUI.s_Texts.subEmitterTypeTexts, new GUILayoutOption[]
            {
                GUILayout.MaxWidth(80f)
            });
            GUILayout.Label("", ParticleSystemStyles.Get().label, new GUILayoutOption[]
            {
                GUILayout.Width(4f)
            });
            ModuleUI.GUIObject(GUIContent.none, serializedProperty, new GUILayoutOption[0]);
            GUIStyle gUIStyle = new GUIStyle("OL Plus");

            if (serializedProperty.objectReferenceValue == null)
            {
                GUILayout.Label("", ParticleSystemStyles.Get().label, new GUILayoutOption[]
                {
                    GUILayout.Width(8f)
                });
                GUILayout.BeginVertical(new GUILayoutOption[]
                {
                    GUILayout.Width(16f),
                    GUILayout.Height(gUIStyle.fixedHeight)
                });
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(GUIContent.none, ParticleSystemStyles.Get().plus, new GUILayoutOption[0]))
                {
                    this.CreateSubEmitter(serializedProperty, index, (SubModuleUI.SubEmitterType)serializedProperty2.intValue);
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndVertical();
            }
            else
            {
                GUILayout.Label("", ParticleSystemStyles.Get().label, new GUILayoutOption[]
                {
                    GUILayout.Width(24f)
                });
            }
            ModuleUI.GUIMask(GUIContent.none, intProp, SubModuleUI.s_Texts.propertyStrings, new GUILayoutOption[]
            {
                GUILayout.Width(100f)
            });
            GUILayout.Label("", ParticleSystemStyles.Get().label, new GUILayoutOption[]
            {
                GUILayout.Width(8f)
            });
            if (index == 0)
            {
                if (GUILayout.Button(GUIContent.none, gUIStyle, new GUILayoutOption[]
                {
                    GUILayout.Width(16f)
                }))
                {
                    this.m_SubEmitters.InsertArrayElementAtIndex(this.m_SubEmitters.arraySize);
                    SerializedProperty arrayElementAtIndex2 = this.m_SubEmitters.GetArrayElementAtIndex(this.m_SubEmitters.arraySize - 1);
                    SerializedProperty serializedProperty3  = arrayElementAtIndex2.FindPropertyRelative("emitter");
                    serializedProperty3.objectReferenceValue = null;
                }
            }
            else if (GUILayout.Button(GUIContent.none, new GUIStyle("OL Minus"), new GUILayoutOption[]
            {
                GUILayout.Width(16f)
            }))
            {
                this.m_SubEmitters.DeleteArrayElementAtIndex(index);
            }
            GUILayout.EndHorizontal();
        }