Esempio n. 1
0
    // Draw extra visual settings to make the visuals of the node system dynamic
    private void DrawVisualSettings()
    {
        GUILayout.Label("References", style.titleStyle);

        style.DrawObjectField("Curve Point Mesh", ref settings.curvePointMesh);
        if (settings.curvePointMesh == null)
        {
            SendMessageRequest("Reference is empty, curve points will not be visible!", WarningStatus.Warning);
        }

        GUILayout.Space(10);
        GUILayout.Label("Node Sizes", style.titleStyle);

        style.DrawFloatField("Node", ref settings.nodeSize);
        style.DrawFloatField("Adjustment Node", ref settings.adjustmentNodeSize);
    }
Esempio n. 2
0
    // Draw for each mesh setting container the settings
    private void DrawMeshSettings(MeshSettingsContainer mesh, int meshIndex)
    {
        GUILayout.Space(10);
        GUILayout.Label("Settings", style.titleStyle);

        // Mesh reference
        EditorGUI.BeginChangeCheck();
        style.DrawObjectField("Mesh Object", ref mesh.usedMesh);

        // Clean the mesh when it changed
        if (EditorGUI.EndChangeCheck())
        {
            TrackManager.meshTools.CleanMesh(mesh);
        }

        if (mesh.usedMesh)
        {
            // Draw this mesh y/n
            style.DrawToggle("Create Mesh", ref mesh.createMesh);

            if (mesh.createMesh)
            {
                // Draw settings for object without a triangle in the input mesh
                if (!mesh.isSeperateObj)
                {
                    // Draw symmetry mode
                    GUILayout.Label("Mesh Settings", style.textStyle);
                    style.DrawToggle("Symmetry Mode", ref mesh.symmetry);

                    // Draw loop mesh setting
                    style.DrawToggle("Loop Mesh Around", ref mesh.loopMesh);
                }
                // Settings unavailable for mesh with triangles
                else if (settings.showInfo)
                {
                    mesh.symmetry = false;
                    mesh.loopMesh = false;
                    style.DrawInfo("Loop Mesh and symmetry modes are not available when the mesh has faces.");
                }
                // Draw flip normal setting
                style.DrawToggle("Flip Normals", ref mesh.flipNormals);

                // Draw offset settings
                GUILayout.Label("Offset of the mesh", style.textStyle);
                style.DrawFloatField("Offset Mesh X", ref mesh.offsetFromCurveX, -100, 100);
                style.DrawFloatField("Offset Mesh Y", ref mesh.offsetFromCurveY, -100, 100);

                // Draw size settings
                GUILayout.Label("Size of the mesh", style.textStyle);
                style.DrawFloatField("Mesh Size X", ref mesh.localSizeOfMeshX, 0.01f);
                style.DrawFloatField("Mesh Size Y", ref mesh.localSizeOfMeshY, 0.01f);

                if (mesh.isSeperateObj)
                {
                    style.DrawFloatField("Mesh Size Z", ref mesh.localSizeOfMeshZ, 0.01f);
                }
                else if (settings.showInfo)
                {
                    mesh.localSizeOfMeshZ = 0;
                    style.DrawInfo("The size of the mesh in the Z axis is unavailable when the mesh does not have faces.");
                }

                // Check if mesh size is not too small
                if (mesh.localSizeOfMeshX < 0.1f || mesh.localSizeOfMeshY < 0.1f || (mesh.isSeperateObj && mesh.localSizeOfMeshZ < 0.1f))
                {
                    SendMessageRequest("Size of the mesh is really small! Mesh might not be visible.", meshIndex, WarningStatus.Warning);
                }

                GUILayout.Label("Materials", style.textStyle);
                style.DrawObjectField("Main Material", ref mesh.materialInput);
                if (!mesh.materialInput)
                {
                    SendMessageRequest("Material is not assigned, mesh will display as error material.", meshIndex, WarningStatus.Warning);
                }
            }
            else if (settings.showInfo)
            {
                style.DrawInfo("This mesh will not be generated.");
            }
        }
        else
        {
            SendMessageRequest("The settings need a mesh to operate!", meshIndex, WarningStatus.Error);
        }
    }