UIToolkit 스타일 및 입력 컴포넌트 추가
- 기본 스타일을 위한 UTKDefaultStyle.uss파일을 생성했습니다. - UIToolkit 설정 구성을 위한 UTKSettings.asset 파일을 추가했습니다. - 포괄적인 색상 정의를 포함하는 다크 및 라이트 테마 스타일(UTKThemeDark.uss, UTKThemeLight.uss)을 도입했습니다. - 테마에 독립적인 레이아웃 및 크기 변수를 위한 UTKVariables.uss를 구현했습니다. - 스타일 및 이벤트 처리를 통해 열거형 선택을 위한 사용자 지정 드롭다운 컴포넌트(UTKEnumDropDown)를 개발했습니다. - 사용자 지정 스타일 및 이벤트 관리를 통해 각각 이중 입력 필드와 긴 입력 필드를 위한 UTKDoubleField 및 UTKLongField 컴포넌트를 생성했습니다.
This commit is contained in:
@@ -19,6 +19,10 @@ namespace UVC.UIToolkit
|
||||
#region Fields
|
||||
private bool _disposed;
|
||||
private bool _isEnabled = true;
|
||||
private string _xLabel = "X";
|
||||
private string _yLabel = "Y";
|
||||
private string _zLabel = "Z";
|
||||
private string _wLabel = "W";
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
@@ -46,6 +50,54 @@ namespace UVC.UIToolkit
|
||||
get => value;
|
||||
set => this.value = value;
|
||||
}
|
||||
|
||||
/// <summary>X축 라벨</summary>
|
||||
[UxmlAttribute]
|
||||
public string XLabel
|
||||
{
|
||||
get => _xLabel;
|
||||
set
|
||||
{
|
||||
_xLabel = value;
|
||||
UpdateAxisLabels();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Y축 라벨</summary>
|
||||
[UxmlAttribute]
|
||||
public string YLabel
|
||||
{
|
||||
get => _yLabel;
|
||||
set
|
||||
{
|
||||
_yLabel = value;
|
||||
UpdateAxisLabels();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Z축 라벨</summary>
|
||||
[UxmlAttribute]
|
||||
public string ZLabel
|
||||
{
|
||||
get => _zLabel;
|
||||
set
|
||||
{
|
||||
_zLabel = value;
|
||||
UpdateAxisLabels();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>W축 라벨</summary>
|
||||
[UxmlAttribute]
|
||||
public string WLabel
|
||||
{
|
||||
get => _wLabel;
|
||||
set
|
||||
{
|
||||
_wLabel = value;
|
||||
UpdateAxisLabels();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -74,6 +126,9 @@ namespace UVC.UIToolkit
|
||||
private void SetupStyles()
|
||||
{
|
||||
AddToClassList("utk-vector4field");
|
||||
|
||||
// 초기 라벨 설정
|
||||
schedule.Execute(() => UpdateAxisLabels());
|
||||
}
|
||||
|
||||
private void SetupEvents()
|
||||
@@ -94,6 +149,19 @@ namespace UVC.UIToolkit
|
||||
{
|
||||
UTKThemeManager.Instance.ApplyThemeToElement(this);
|
||||
}
|
||||
|
||||
private void UpdateAxisLabels()
|
||||
{
|
||||
// Vector4Field의 내부 FloatField들을 찾아서 라벨 변경
|
||||
var floatFields = this.Query<FloatField>().ToList();
|
||||
if (floatFields.Count >= 4)
|
||||
{
|
||||
floatFields[0].label = _xLabel;
|
||||
floatFields[1].label = _yLabel;
|
||||
floatFields[2].label = _zLabel;
|
||||
floatFields[3].label = _wLabel;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
Reference in New Issue
Block a user