Esempio n. 1
0
    private void DrawSettings()
    {
        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

        style.DrawButton("Add", "Add an extra mesh", () => AddExtraMesh(), style.smallButtonStyle);

        // Draw every mesh setting container
        foreach (MeshSettingsContainer mesh in settings.container)
        {
            int meshIndex = settings.container.IndexOf(mesh);

            // Draw the header for the mesh settings with buttons
            GUILayout.BeginHorizontal(style.textStyle);
            settings.foldoutGroups[meshIndex] = EditorGUILayout.BeginFoldoutHeaderGroup(settings.foldoutGroups[meshIndex], (meshIndex + 1) + " mesh", style.smallButtonStyle);
            if (style.DrawButton("Remove", "", () => RemoveMesh(meshIndex), style.smallButtonStyle))
            {
                break;
            }

            if (mesh.usedMesh != null)
            {
                GUILayout.Label(mesh.usedMesh.name, style.titleStyle);
            }

            DrawErrorMeshSetting(meshIndex);
            GUILayout.EndHorizontal();

            // Draw all the settings
            if (settings.foldoutGroups[meshIndex])
            {
                settings.tabStatus[meshIndex] = WarningStatus.None; // Reset tab errors

                EditorGUI.BeginChangeCheck();
                DrawMeshSettings(mesh, meshIndex);
                if (EditorGUI.EndChangeCheck()) // Execute realtime when something changed
                {
                    DataTools.realtimeManager.Execute();
                }

                GUILayout.Space(20);
            }

            EditorGUILayout.EndFoldoutHeaderGroup();

            GUILayout.Space(10);
        }

        GUILayout.Space(20);

        EditorGUILayout.EndScrollView();
    }
Esempio n. 2
0
    // Draw the options in the functions tab
    private void DrawButtons()
    {
        GUILayout.Label("Function for the node system", style.titleStyle);

        style.DrawButton("Connect\nNetwork",
                         "Connect network will connect all the nodes with eachother and bake the curves. Will reset curves on nodes with a reset flag",
                         () => TrackManager.nodeManager.SetupNetwork());

        style.DrawButton("Bake\nCurves",
                         "Option will only bake curves",
                         () => TrackManager.nodeManager.BakeCurves());

        style.DrawButton("Hard\nReset",
                         "This will reset all the curves and nodes regardless of their status",
                         () => TrackManager.nodeManager.SetupNetwork(true));


        DrawNodeSystemInfo();
        DrawActionMessage();
    }