PropertyWindow 기능 추가
This commit is contained in:
@@ -11,5 +11,11 @@ namespace UVC.UI.Window.PropertyWindow
|
||||
/// <param name="item">표시할 속성 데이터</param>
|
||||
/// <param name="controller">상호작용할 컨트롤러</param>
|
||||
void Setup(IPropertyItem item, PropertyWindow controller);
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
void SetReadOnly(bool isReadOnly);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,5 +322,56 @@ namespace UVC.UI.Window.PropertyWindow
|
||||
_groupViews.Clear();
|
||||
_itemViews.Clear();
|
||||
}
|
||||
|
||||
#region Property/Group Visibility
|
||||
|
||||
/// <summary>
|
||||
/// 특정 속성 아이템의 가시성을 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">속성 아이템의 ID</param>
|
||||
/// <param name="visible">가시성 여부</param>
|
||||
public void SetPropertyVisibility(string propertyId, bool visible)
|
||||
{
|
||||
if (_itemViews.TryGetValue(propertyId, out var itemView) && itemView != null)
|
||||
{
|
||||
itemView.SetActive(visible);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 그룹의 가시성을 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="groupId">그룹 ID</param>
|
||||
/// <param name="visible">가시성 여부</param>
|
||||
public void SetGroupVisibility(string groupId, bool visible)
|
||||
{
|
||||
if (_groupViews.TryGetValue(groupId, out var groupView) && groupView != null)
|
||||
{
|
||||
groupView.gameObject.SetActive(visible);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property/Group ReadOnly
|
||||
|
||||
/// <summary>
|
||||
/// 특정 속성 아이템의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">속성 아이템의 ID</param>
|
||||
/// <param name="isReadOnly">읽기 전용 여부</param>
|
||||
public void SetPropertyReadOnly(string propertyId, bool isReadOnly)
|
||||
{
|
||||
if (_itemViews.TryGetValue(propertyId, out var itemView) && itemView != null)
|
||||
{
|
||||
var propertyUI = itemView.GetComponent<IPropertyUI>();
|
||||
if (propertyUI != null)
|
||||
{
|
||||
propertyUI.SetReadOnly(isReadOnly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,5 +517,182 @@ namespace UVC.UI.Window.PropertyWindow
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property/Group Visibility
|
||||
|
||||
/// <summary>
|
||||
/// 특정 속성 아이템의 가시성을 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">속성 아이템의 ID</param>
|
||||
/// <param name="visible">가시성 여부</param>
|
||||
public void SetPropertyVisibility(string propertyId, bool visible)
|
||||
{
|
||||
if (_view != null)
|
||||
{
|
||||
_view.SetPropertyVisibility(propertyId, visible);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 여러 속성 아이템의 가시성을 한번에 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyIds">속성 아이템 ID 목록</param>
|
||||
/// <param name="visible">가시성 여부</param>
|
||||
public void SetPropertiesVisibility(IEnumerable<string> propertyIds, bool visible)
|
||||
{
|
||||
if (_view != null && propertyIds != null)
|
||||
{
|
||||
foreach (var propertyId in propertyIds)
|
||||
{
|
||||
_view.SetPropertyVisibility(propertyId, visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 그룹의 가시성을 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="groupId">그룹 ID</param>
|
||||
/// <param name="visible">가시성 여부</param>
|
||||
public void SetGroupVisibility(string groupId, bool visible)
|
||||
{
|
||||
if (_view != null)
|
||||
{
|
||||
_view.SetGroupVisibility(groupId, visible);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 여러 그룹의 가시성을 한번에 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="groupIds">그룹 ID 목록</param>
|
||||
/// <param name="visible">가시성 여부</param>
|
||||
public void SetGroupsVisibility(IEnumerable<string> groupIds, bool visible)
|
||||
{
|
||||
if (_view != null && groupIds != null)
|
||||
{
|
||||
foreach (var groupId in groupIds)
|
||||
{
|
||||
_view.SetGroupVisibility(groupId, visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property/Group ReadOnly (Enable/Disable)
|
||||
|
||||
/// <summary>
|
||||
/// 특정 속성 아이템의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">속성 아이템의 ID</param>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetPropertyReadOnly(string propertyId, bool isReadOnly)
|
||||
{
|
||||
if (_itemIndex.TryGetValue(propertyId, out var item))
|
||||
{
|
||||
item.IsReadOnly = isReadOnly;
|
||||
if (_view != null)
|
||||
{
|
||||
_view.SetPropertyReadOnly(propertyId, isReadOnly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 속성 아이템의 활성화 상태를 설정합니다.
|
||||
/// SetPropertyReadOnly의 반대 동작입니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">속성 아이템의 ID</param>
|
||||
/// <param name="enabled">활성화 여부 (true: 활성화, false: 비활성화)</param>
|
||||
public void SetPropertyEnabled(string propertyId, bool enabled)
|
||||
{
|
||||
SetPropertyReadOnly(propertyId, !enabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 여러 속성 아이템의 읽기 전용 상태를 한번에 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyIds">속성 아이템 ID 목록</param>
|
||||
/// <param name="isReadOnly">읽기 전용 여부</param>
|
||||
public void SetPropertiesReadOnly(IEnumerable<string> propertyIds, bool isReadOnly)
|
||||
{
|
||||
if (propertyIds != null)
|
||||
{
|
||||
foreach (var propertyId in propertyIds)
|
||||
{
|
||||
SetPropertyReadOnly(propertyId, isReadOnly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 여러 속성 아이템의 활성화 상태를 한번에 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="propertyIds">속성 아이템 ID 목록</param>
|
||||
/// <param name="enabled">활성화 여부</param>
|
||||
public void SetPropertiesEnabled(IEnumerable<string> propertyIds, bool enabled)
|
||||
{
|
||||
SetPropertiesReadOnly(propertyIds, !enabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 그룹 내 모든 속성 아이템의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="groupId">그룹 ID</param>
|
||||
/// <param name="isReadOnly">읽기 전용 여부</param>
|
||||
public void SetGroupReadOnly(string groupId, bool isReadOnly)
|
||||
{
|
||||
if (_groupIndex.TryGetValue(groupId, out var group))
|
||||
{
|
||||
foreach (var item in group.Items)
|
||||
{
|
||||
item.IsReadOnly = isReadOnly;
|
||||
if (_view != null)
|
||||
{
|
||||
_view.SetPropertyReadOnly(item.Id, isReadOnly);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 그룹 내 모든 속성 아이템의 활성화 상태를 설정합니다.
|
||||
/// SetGroupReadOnly의 반대 동작입니다.
|
||||
/// </summary>
|
||||
/// <param name="groupId">그룹 ID</param>
|
||||
/// <param name="enabled">활성화 여부</param>
|
||||
public void SetGroupEnabled(string groupId, bool enabled)
|
||||
{
|
||||
SetGroupReadOnly(groupId, !enabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 여러 그룹 내 모든 속성 아이템의 읽기 전용 상태를 한번에 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="groupIds">그룹 ID 목록</param>
|
||||
/// <param name="isReadOnly">읽기 전용 여부</param>
|
||||
public void SetGroupsReadOnly(IEnumerable<string> groupIds, bool isReadOnly)
|
||||
{
|
||||
if (groupIds != null)
|
||||
{
|
||||
foreach (var groupId in groupIds)
|
||||
{
|
||||
SetGroupReadOnly(groupId, isReadOnly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 여러 그룹 내 모든 속성 아이템의 활성화 상태를 한번에 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="groupIds">그룹 ID 목록</param>
|
||||
/// <param name="enabled">활성화 여부</param>
|
||||
public void SetGroupsEnabled(IEnumerable<string> groupIds, bool enabled)
|
||||
{
|
||||
SetGroupsReadOnly(groupIds, !enabled);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,22 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_valueToggle != null)
|
||||
{
|
||||
_valueToggle.interactable = !isReadOnly;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// 메모리 누수를 방지하기 위해 등록된 리스너를 제거합니다.
|
||||
|
||||
@@ -130,6 +130,20 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
openningColorPickered = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_colorLabel != null) _colorLabel.interactable = !isReadOnly;
|
||||
if (_colorPickerButton != null) _colorPickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -110,6 +110,24 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_dateText != null) _dateText.interactable = !isReadOnly;
|
||||
if (_datePickerButton != null)
|
||||
{
|
||||
_datePickerButton.interactable = !isReadOnly;
|
||||
_datePickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -147,6 +147,30 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_startDateText != null) _startDateText.interactable = !isReadOnly;
|
||||
if (_endDateText != null) _endDateText.interactable = !isReadOnly;
|
||||
if (_startDatePickerButton != null)
|
||||
{
|
||||
_startDatePickerButton.interactable = !isReadOnly;
|
||||
_startDatePickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
if (_endDatePickerButton != null)
|
||||
{
|
||||
_endDatePickerButton.interactable = !isReadOnly;
|
||||
_endDatePickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -172,6 +172,26 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newDateTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_dateText != null) _dateText.interactable = !isReadOnly;
|
||||
if (_dateTimePickerButton != null)
|
||||
{
|
||||
_dateTimePickerButton.interactable = !isReadOnly;
|
||||
_dateTimePickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
if (_hourDropDown != null) _hourDropDown.interactable = !isReadOnly;
|
||||
if (_miniteDropDown != null) _miniteDropDown.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -275,6 +275,34 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_startDateText != null) _startDateText.interactable = !isReadOnly;
|
||||
if (_endDateText != null) _endDateText.interactable = !isReadOnly;
|
||||
if (_startDatePickerButton != null)
|
||||
{
|
||||
_startDatePickerButton.interactable = !isReadOnly;
|
||||
_startDatePickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
if (_endDatePickerButton != null)
|
||||
{
|
||||
_endDatePickerButton.interactable = !isReadOnly;
|
||||
_endDatePickerButton.gameObject.SetActive(!isReadOnly);
|
||||
}
|
||||
if (_startHourDropDown != null) _startHourDropDown.interactable = !isReadOnly;
|
||||
if (_startMiniteDropDown != null) _startMiniteDropDown.interactable = !isReadOnly;
|
||||
if (_endHourDropDown != null) _endHourDropDown.interactable = !isReadOnly;
|
||||
if (_endMiniteDropDown != null) _endMiniteDropDown.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -110,6 +110,19 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_dropdown != null) _dropdown.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -107,6 +107,19 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_dropdown != null) _dropdown.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -195,6 +195,26 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, v);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_valueInput != null)
|
||||
{
|
||||
_valueInput.interactable = !isReadOnly;
|
||||
}
|
||||
if (_slider != null)
|
||||
{
|
||||
_slider.interactable = !isReadOnly;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
// 오브젝트가 파괴될 때 리스너를 확실히 제거합니다.
|
||||
|
||||
@@ -181,6 +181,20 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_minInputField.text = newMin.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_minInputField != null) _minInputField.interactable = !isReadOnly;
|
||||
if (_maxInputField != null) _maxInputField.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -140,6 +140,25 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, selectedValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
foreach (var toggle in _toggles)
|
||||
{
|
||||
if (toggle != null)
|
||||
{
|
||||
toggle.interactable = !isReadOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -88,6 +88,22 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_valueInput != null)
|
||||
{
|
||||
_valueInput.interactable = !isReadOnly;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
// 오브젝트가 파괴될 때 리스너를 확실히 제거합니다.
|
||||
|
||||
@@ -110,6 +110,20 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_xInputField != null) _xInputField.interactable = !isReadOnly;
|
||||
if (_yInputField != null) _yInputField.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -121,6 +121,21 @@ namespace UVC.UI.Window.PropertyWindow.UI
|
||||
_controller.UpdatePropertyValue(_propertyItem.Id, _propertyItem.PropertyType, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
if (_xInputField != null) _xInputField.interactable = !isReadOnly;
|
||||
if (_yInputField != null) _yInputField.interactable = !isReadOnly;
|
||||
if (_zInputField != null) _zInputField.interactable = !isReadOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 UI 오브젝트가 파괴될 때 Unity에 의해 호출됩니다.
|
||||
/// </summary>
|
||||
|
||||
@@ -65,6 +65,30 @@ namespace UVC.UI.Window.PropertyWindow
|
||||
SubscribeEvents();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UI의 읽기 전용 상태를 설정합니다.
|
||||
/// 파생 클래스에서 재정의하여 구체적인 UI 요소에 적용해야 합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부 (true: 비활성화, false: 활성화)</param>
|
||||
public virtual void SetReadOnly(bool isReadOnly)
|
||||
{
|
||||
if (_propertyItem != null)
|
||||
{
|
||||
_propertyItem.IsReadOnly = isReadOnly;
|
||||
}
|
||||
// 파생 클래스에서 구체적인 UI 요소 비활성화 로직을 구현
|
||||
ApplyReadOnlyStateToUI(isReadOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 파생 클래스에서 구체적인 UI 요소에 읽기 전용 상태를 적용합니다.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly">읽기 전용 여부</param>
|
||||
protected virtual void ApplyReadOnlyStateToUI(bool isReadOnly)
|
||||
{
|
||||
// 기본 구현 없음 - 파생 클래스에서 필요시 구현
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Common UI Setup
|
||||
|
||||
Reference in New Issue
Block a user