Ejemplo n.º 1
0
        /// <summary>
        /// Draw standard options GUI using layout engine. This method should be called
        /// within a horizontally flowing layout.
        /// </summary>
        /// <example>
        /// <code language="csharp"><![CDATA[
        /// GUILayout.BeginHorizontal();
        /// {
        ///     DrawStandardOptionsGUI();
        /// }
        /// GUILayout.EndHorizontal();
        /// ]]></code>
        /// </example>
        protected void DrawStandardOptionsGUI()
        {
            Rect position = GUILayoutUtility.GetRect(77, 0);

            position.y -= 3;

            // Draw "Rotation" selector interface.
            EditorGUI.BeginChangeCheck();
            ToolUtility.Rotation = RotorzEditorGUI.RotationSelector(new Rect(position.x + 3, position.y, 39, 36), ToolUtility.Rotation);
            if (EditorGUI.EndChangeCheck())
            {
                SceneView.RepaintAll();
            }

            using (var content = ControlContent.Basic(
                       RotorzEditorStyles.Skin.GetActive(RotorzEditorStyles.Skin.Randomize, ToolUtility.RandomizeVariations),
                       TileLang.ParticularText("Property", "Randomize Variations")
                       )) {
                Rect togglePosition = position;
                togglePosition.x     += 3 + 39 + 5;
                togglePosition.y     += 1;
                togglePosition.width  = 32;
                togglePosition.height = 30;

                ToolUtility.RandomizeVariations = RotorzEditorGUI.HoverToggle(togglePosition, content, ToolUtility.RandomizeVariations);
            }

            if (this.EnableVariationShifting)
            {
                EditorGUI.BeginDisabledGroup(this.TemporarilyDisableVariationShifting);
                this.DrawVariationShifter();
                EditorGUI.EndDisabledGroup();
            }

            RotorzEditorGUI.VerticalSeparatorLight();
        }