コード例 #1
0
    void DrawScatterSettingsUI(FoilageRules r)
    {
        scatterUIFoldout = EditorUtils.Foldout("Scatter Settings", scatterUIFoldout, 15, 15);
        if (scatterUIFoldout)
        {
            GUILayout.Space(10);

            // position offsets
            EditorUtils.BoldLabel("Position Offset", 30, 15);
            r.posOffset    = EditorUtils.VectorField(r.posOffset, "Offset Pos    ", 30, 15);
            r.minPosOffset = EditorUtils.VectorField(r.minPosOffset, "Random Min", 30, 15);
            r.maxPosOffset = EditorUtils.VectorField(r.maxPosOffset, "Random Max", 30, 15);

            GUILayout.Space(10);

            // rotation offsets
            EditorUtils.BoldLabel("Rotation Offset", 30, 15);
            r.rotOffset    = EditorUtils.VectorField(r.rotOffset, "Offset Angle", 30, 15);
            r.minRotOffset = EditorUtils.VectorField(r.minRotOffset, "Random Min", 30, 15);
            r.maxRotOffset = EditorUtils.VectorField(r.maxRotOffset, "Random Max", 30, 15);

            GUILayout.Space(10);

            // scale offsets
            EditorUtils.BoldLabel("Scale Offset", 30, 15);

            GUILayout.BeginHorizontal();
            EditorUtils.Label("Random Min ", 30, 0);
            r.minScaleOffset = EditorUtils.Float(ref r.minScaleOffset, "", 30, 15, minWidth: 50);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorUtils.Label("Random Max", 30, 0);
            r.maxScaleOffset = EditorUtils.Float(ref r.maxScaleOffset, "", 30, 15, minWidth: 50);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);
        }
    }
コード例 #2
0
    void OptionsPanel()
    {
        optionsFoldPanel = EditorUtils.Foldout("Paint Options", optionsFoldPanel, 15, 0) && !isPainting;

        if (optionsFoldPanel)
        {
            if (painter.currentGroup != null)
            {
                GUILayout.Space(10);

                // position offsets
                EditorUtils.BoldLabel("Position Offset", 30, 15);
                painter.currentGroup.posOffset    = EditorUtils.VectorField(painter.currentGroup.posOffset, "Offset Pos    ", 30, 15);
                painter.currentGroup.minPosOffset = EditorUtils.VectorField(painter.currentGroup.minPosOffset, "Random Min", 30, 15);
                painter.currentGroup.maxPosOffset = EditorUtils.VectorField(painter.currentGroup.maxPosOffset, "Random Max", 30, 15);

                GUILayout.Space(10);

                // rotation offsets
                EditorUtils.BoldLabel("Rotation Offset", 30, 15);
                painter.currentGroup.rotOffset    = EditorUtils.VectorField(painter.currentGroup.rotOffset, "Offset Angle", 30, 15);
                painter.currentGroup.minRotOffset = EditorUtils.VectorField(painter.currentGroup.minRotOffset, "Random Min", 30, 15);
                painter.currentGroup.maxRotOffset = EditorUtils.VectorField(painter.currentGroup.maxRotOffset, "Random Max", 30, 15);

                GUILayout.Space(10);

                // scale offsets
                EditorUtils.BoldLabel("Scale Offset", 30, 15);
                painter.currentGroup.scaleOffset    = EditorUtils.VectorField(painter.currentGroup.scaleOffset, "Offset Scale", 30, 15);
                painter.currentGroup.minScaleOffset = EditorUtils.VectorField(painter.currentGroup.minScaleOffset, "Random Min", 30, 15);
                painter.currentGroup.maxScaleOffset = EditorUtils.VectorField(painter.currentGroup.maxScaleOffset, "Random Max", 30, 15);

                GUILayout.Space(10);
            }
        }
    }