rimworld-animation-studio/Library/PackageCache/com.unity.2d.spriteshape@3.0.14/Editor/SpriteShapeEditorGUI.cs
2022-09-13 00:36:34 -05:00

36 lines
1.3 KiB
C#

using UnityEditor;
using UnityEngine;
using UnityEditor.Sprites;
using System.Collections;
using System.Collections.Generic;
namespace UnityEditor.U2D
{
public class SpriteShapeEditorGUI
{
private const float kSpacingSubLabel = 2.0f;
private const float kMiniLabelW = 13;
private const int kVerticalSpacingMultiField = 0;
private const float kIndentPerLevel = 15;
public static int s_FoldoutHash = "Foldout".GetHashCode();
public static void MultiDelayedIntField(Rect position, GUIContent[] subLabels, int[] values, float labelWidth)
{
int eCount = values.Length;
float w = (position.width - (eCount - 1) * kSpacingSubLabel) / eCount;
Rect nr = new Rect(position);
nr.width = w;
float t = EditorGUIUtility.labelWidth;
int l = EditorGUI.indentLevel;
EditorGUIUtility.labelWidth = labelWidth;
EditorGUI.indentLevel = 0;
for (int i = 0; i < values.Length; i++)
{
values[i] = EditorGUI.DelayedIntField(nr, subLabels[i], values[i]);
nr.x += w + kSpacingSubLabel;
}
EditorGUIUtility.labelWidth = t;
EditorGUI.indentLevel = l;
}
}
}