public static void DrawSceneReloadButton()
 {
     SpiralEditor.BeginPanel(GroupType.Vertical);
     if (SpiralEditor.Button(strSceneFile_ReuploadCurrentSceneText))
     {
         ReloadCurrentSceneFile();
     }
     SpiralEditor.EndPanel();
 }
Beispiel #2
0
 private void DrawSimpleMode()
 {
     SpiralEditor.BeginPanel(strObjectsOnly);
     if (SpiralEditor.Button(strObjectsOnlyButton))
     {
         DeadScripts.UpdateDeadList();
         DeadScripts.SelectDeads();
     }
     SpiralEditor.EndPanel();
 }
Beispiel #3
0
        private void DrawDeadGUIDEntry(ComponentGUID dead)
        {
            GUILayoutOption labelOption = GUILayout.Height(20);

            SpiralEditor.BeginPanel(GroupType.Vertical);

            EditorGUILayout.SelectableLabel($"GUID: {dead.guid}", GUILayout.MinWidth(250), labelOption);

            string strDeadCount = strDeadObjectsCount + $" {dead.oids.Count}";

            dead.showInfo = EditorGUILayout.Foldout(dead.showInfo, strDeadCount);
            if (dead.showInfo)
            {
                for (int i = 0; i < dead.gids.Count; i++)
                {
                    var dgid   = dead.gids[i];
                    var dgidID = dgid.fileID;

                    string strGID        = $"{dgidID}";
                    string strButtonName = $"#{i} MonoBehaviour ID: {strGID}";
                    if (EditorGUILayout.DropdownButton(new GUIContent(strButtonName), FocusType.Passive))
                    {
                        dgid.showInfo = !dgid.showInfo;
                    }
                    if (dgid.showInfo)
                    {
                        SpiralEditor.BeginPanel(GroupType.Vertical);
                        EditorGUILayout.SelectableLabel(strGID);
                        if (SpiralEditor.Button(strSelectObject))
                        {
                            Selection.objects = new Object[1] {
                                dead.oids[i].gameObject
                            };
                        }
                        GUI.enabled = false;
                        EditorGUILayout.TextArea(dgid.fileEntry);
                        GUI.enabled = true;
                        EditorGUILayout.Space();
                        SpiralEditor.EndPanel();
                    }
                }
            }

            if (SpiralEditor.Button(strSelectObjects))
            {
                ObjectID.Select(dead.oids);
            }

            EditorGUILayout.EndVertical();
        }
Beispiel #4
0
        private void DrawBoxSceneState()
        {
            SpiralEditor.BeginPanel(strSceneFileCheckout);

            SpiralEditor.BeginPanel(GroupType.Vertical);

            SpiralEditor.BeginPanel(GroupType.Horizontal);
            GUIStyle styleSceneIsDirty = new GUIStyle(SpiralStyles.labelBold);
            string   sceneIsDirty      = DeadScripts.isDirty ?
                                         strSceneWasChanged :
                                         strSceneClear;

            styleSceneIsDirty.normal.textColor = DeadScripts.isDirty ? new Color(0.8f, 0.0f, 0.0f) : Color.gray;
            EditorGUILayout.LabelField(sceneIsDirty, styleSceneIsDirty);
            SpiralEditor.EndPanel();

            SpiralEditor.BeginPanel(GroupType.Vertical);
            EditorGUI.indentLevel += 1;
            foldoutSceneSearchHelp = EditorGUILayout.Foldout(foldoutSceneSearchHelp,
                                                             strShowHelp,
                                                             true, SpiralStyles.foldoutNormal);
            EditorGUI.indentLevel -= 1;
            if (foldoutSceneSearchHelp)
            {
                EditorGUILayout.HelpBox(strSceneHelpWarning, MessageType.Warning);
                EditorGUILayout.HelpBox(strSceneHelpExplanation, MessageType.Info);
            }
            SpiralEditor.EndPanel();
            SpiralEditor.EndPanel();

            if (SpiralEditor.Button(strFindDeadGUIDs))
            {
                DeadScripts.SearchForDeads();
                if (DeadScripts.deadGUIDs.Count > 0)
                {
                    foldoutDeads = true;
                }
            }
            ShowDeadGUIDs();

            SpiralEditor.EndPanel();
        }
Beispiel #5
0
        private void DrawSanboxEvent(Sandbox.SandboxEventInfo sandboxInfo)
        {
            GUILayoutOption buttonWidth = GUILayout.Width(100);

            if (sandboxInfo == null)
            {
                SpiralEditor.BeginPanel(GroupType.Vertical, SpiralStyles.colorLightRed);
                EditorGUILayout.LabelField($"IDX {sandboxInfo.idx} broken entry", SpiralStyles.panel);
                if (SpiralEditor.Button("Kill callback", buttonWidth))
                {
                    Sandbox.RemoveCallback(sandboxInfo.idx);
                }
                EditorGUILayout.Space(2);
                SpiralEditor.EndPanel();
            }
            else
            {
                bool  good = CheckEventHealth(sandboxInfo);
                Color color;
                if (good)
                {
                    color = sandboxInfo.paused ? SpiralStyles.colorLightYellow : SpiralStyles.colorLightGreen;
                }
                else
                {
                    color = sandboxInfo.paused ? SpiralStyles.colorLightOrange : SpiralStyles.colorLightRed;
                }

                SpiralEditor.BeginPanel(GroupType.Vertical, color);
                string isPaused = sandboxInfo.paused ? "PAUSED" : "IS RUNNING";
                EditorGUILayout.LabelField($"IDX {sandboxInfo.idx} {isPaused}", SpiralStyles.panel);

                EditorGUI.indentLevel += 1;
                GUI.enabled            = false;
                if (sandboxInfo.hasReference)                // имеет опорный объект
                {
                    if (sandboxInfo.referenceObject != null) // опорный объект существует
                    {
                        if (sandboxInfo.isReferenceUnityObject)
                        {
                            _ = EditorGUILayout.ObjectField("UnityObject: ",
                                                            sandboxInfo.referenceObject as UnityEngine.Object,
                                                            sandboxInfo.referenceObjectType,
                                                            true);
                        }
                        else
                        {
                            string name = "System.Object";
                            string data = $"{sandboxInfo.referenceObject} [{sandboxInfo.referenceObjectType}]";
                            EditorGUILayout.LabelField(name, data);
                        }
                    }
                    else // опорный объект утерян
                    {
                        if (sandboxInfo.isReferenceUnityObject)
                        {
                            _ = EditorGUILayout.ObjectField("UnityObject: ", null, sandboxInfo.referenceObjectType, true);
                        }
                        else
                        {
                            string name = "System.Object";
                            string data = $"<missing> [{sandboxInfo.referenceObjectType}]";
                            EditorGUILayout.LabelField(name, data);
                        }
                    }
                }
                else // запуск без опорного объекта
                {
                    EditorGUILayout.LabelField("No reference object");
                }

                EditorGUILayout.LabelField("Sender Type", $"[{sandboxInfo.senderType}]");

                string callbackName;
                object target = sandboxInfo.callback.Target;
                string parent = $"[{target}]";
                callbackName = $"{sandboxInfo.callback.Method.Name} {parent}";

                EditorGUILayout.LabelField("Method", $"{callbackName}");

                EditorGUI.indentLevel -= 1;
                GUI.enabled            = true;

                SpiralEditor.BeginGroup(GroupType.Horizontal);
                EditorGUILayout.Space(2);
                GUI.enabled = sandboxInfo.idx != Sandbox.sandboxTotalCount - 1;
                if (SpiralEditor.Button("Move Down", buttonWidth))
                {
                    Sandbox.MoveDown(sandboxInfo.idx);
                }
                GUI.enabled = true;
                EditorGUILayout.Space(2);
                if (SpiralEditor.Button("Kill callback", buttonWidth))
                {
                    Sandbox.RemoveCallback(sandboxInfo.idx);
                }
                string pause = sandboxInfo.paused ? "Unpause" : "Pause";
                if (SpiralEditor.Button(pause, buttonWidth))
                {
                    if (sandboxInfo.paused)
                    {
                        Sandbox.UnpauseCallback(sandboxInfo.idx);
                    }
                    else
                    {
                        Sandbox.PauseCallback(sandboxInfo.idx);
                    }
                }
                EditorGUILayout.Space(2);
                GUI.enabled = sandboxInfo.idx != 0;
                if (SpiralEditor.Button("Move Up", buttonWidth))
                {
                    Sandbox.MoveUp(sandboxInfo.idx);
                }
                GUI.enabled = true;
                EditorGUILayout.Space(2);
                SpiralEditor.EndGroup();

                EditorGUILayout.Space(2);
                SpiralEditor.EndPanel();
            }
        }