UnityEditor.GameObjectUtility.DisplayUpdateChildrenDialogIfNeeded C# (CSharp) Method

DisplayUpdateChildrenDialogIfNeeded() static private method

static private DisplayUpdateChildrenDialogIfNeeded ( IEnumerable gameObjects, string title, string message ) : ShouldIncludeChildren
gameObjects IEnumerable
title string
message string
return ShouldIncludeChildren
        internal static ShouldIncludeChildren DisplayUpdateChildrenDialogIfNeeded(IEnumerable<GameObject> gameObjects, string title, string message)
        {
            if (!HasChildren(gameObjects))
            {
                return ShouldIncludeChildren.HasNoChildren;
            }
            return (ShouldIncludeChildren) EditorUtility.DisplayDialogComplex(title, message, "Yes, change children", "No, this object only", "Cancel");
        }

Usage Example

        public static bool SetStaticFlags(UnityEngine.Object[] targetObjects, int changedFlags, bool flagValue)
        {
            bool flag = changedFlags == -1;
            StaticEditorFlags staticEditorFlags = (StaticEditorFlags)((!flag) ? ((int)Enum.Parse(typeof(StaticEditorFlags), changedFlags.ToString())) : 0);

            GameObjectUtility.ShouldIncludeChildren shouldIncludeChildren = GameObjectUtility.DisplayUpdateChildrenDialogIfNeeded(targetObjects.OfType <GameObject>(), "Change Static Flags", (!flag) ? string.Concat(new string[]
            {
                "Do you want to ",
                (!flagValue) ? "disable" : "enable",
                " the ",
                ObjectNames.NicifyVariableName(staticEditorFlags.ToString()),
                " flag for all the child objects as well?"
            }) : ("Do you want to " + ((!flagValue) ? "disable" : "enable") + " the static flags for all the child objects as well?"));
            if (shouldIncludeChildren == GameObjectUtility.ShouldIncludeChildren.Cancel)
            {
                GUIUtility.ExitGUI();
                return(false);
            }
            GameObject[] objects = SceneModeUtility.GetObjects(targetObjects, shouldIncludeChildren == GameObjectUtility.ShouldIncludeChildren.IncludeChildren);
            Undo.RecordObjects(objects, "Change Static Flags");
            GameObject[] array = objects;
            for (int i = 0; i < array.Length; i++)
            {
                GameObject go  = array[i];
                int        num = (int)GameObjectUtility.GetStaticEditorFlags(go);
                num = ((!flagValue) ? (num & ~changedFlags) : (num | changedFlags));
                GameObjectUtility.SetStaticEditorFlags(go, (StaticEditorFlags)num);
            }
            return(true);
        }
All Usage Examples Of UnityEditor.GameObjectUtility::DisplayUpdateChildrenDialogIfNeeded