This commit is contained in:
2026-07-24 18:20:02 +09:00
commit 0b02bacb3d
177 changed files with 5172 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f216d086afefbc04bbc61ce6903c421a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
using UnityEditor;
using UnityEngine;
// IntRange를 "라벨 [Min] ~ [Max]" 한 줄로 그린다.
[CustomPropertyDrawer(typeof(IntRange))]
public class IntRangeDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
=> EditorGUIUtility.singleLineHeight;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
position = EditorGUI.PrefixLabel(position, label);
int indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0; // PrefixLabel 뒤 필드가 들여쓰기에 밀리지 않게
const float tildeWidth = 14f;
float fieldWidth = (position.width - tildeWidth) * 0.5f;
var minRect = new Rect(position.x, position.y, fieldWidth, position.height);
var tildeRect = new Rect(minRect.xMax, position.y, tildeWidth, position.height);
var maxRect = new Rect(tildeRect.xMax, position.y, fieldWidth, position.height);
EditorGUI.PropertyField(minRect, property.FindPropertyRelative("Min"), GUIContent.none);
EditorGUI.LabelField(tildeRect, "~", CenteredLabel);
EditorGUI.PropertyField(maxRect, property.FindPropertyRelative("Max"), GUIContent.none);
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty();
}
static GUIStyle _centered;
static GUIStyle CenteredLabel => _centered ??= new GUIStyle(EditorStyles.label) { alignment = TextAnchor.MiddleCenter };
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 878034b1fe8afe64eaeb9b2e9b329778

View File

@@ -0,0 +1,13 @@
using System;
// 정수 범위 (양끝 포함). 인스펙터에서는 "라벨 [Min] ~ [Max]" 한 줄로 그려진다 (IntRangeDrawer).
[Serializable]
public struct IntRange
{
public int Min;
public int Max;
public IntRange(int min, int max) { Min = min; Max = max; }
public bool Contains(int value) => value >= Min && value <= Max;
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0ca113007f09def4f82463aef8aca122