UnityEditor.GameObjectInspector.ShowMixedStaticEditorFlags C# (CSharp) Method

ShowMixedStaticEditorFlags() private static method

private static ShowMixedStaticEditorFlags ( StaticEditorFlags mask ) : bool
mask StaticEditorFlags
return bool
        private static bool ShowMixedStaticEditorFlags(StaticEditorFlags mask)
        {
            uint num = 0;
            uint num2 = 0;
            IEnumerator enumerator = Enum.GetValues(typeof(StaticEditorFlags)).GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    object current = enumerator.Current;
                    num2++;
                    if ((mask & ((StaticEditorFlags) current)) > 0)
                    {
                        num++;
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            return ((num > 0) && (num != num2));
        }

Usage Example

Exemplo n.º 1
0
        private void DoStaticToggleField(GameObject go)
        {
            Rect rect = GUILayoutUtility.GetRect(GameObjectInspector.s_Styles.staticContent, EditorStyles.toggle, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(false)
            });

            EditorGUI.BeginProperty(rect, GUIContent.none, this.m_StaticEditorFlags);
            EditorGUI.BeginChangeCheck();
            Rect position = rect;

            EditorGUI.showMixedValue |= GameObjectInspector.ShowMixedStaticEditorFlags((StaticEditorFlags)this.m_StaticEditorFlags.intValue);
            Event     current = Event.current;
            EventType type    = current.type;
            bool      flag    = current.type == EventType.MouseDown && current.button != 0;

            if (flag)
            {
                current.type = EventType.Ignore;
            }
            bool flagValue = EditorGUI.ToggleLeft(position, GameObjectInspector.s_Styles.staticContent, go.isStatic);

            if (flag)
            {
                current.type = type;
            }
            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                SceneModeUtility.SetStaticFlags(base.targets, -1, flagValue);
                base.serializedObject.SetIsDifferentCacheDirty();
                GUIUtility.ExitGUI();
            }
            EditorGUI.EndProperty();
        }
All Usage Examples Of UnityEditor.GameObjectInspector::ShowMixedStaticEditorFlags