PropUiDisplay 직렬화 누락 수정

This commit is contained in:
Jeonghyeon Ha 2025-09-01 15:36:49 +09:00
parent 86518fcd84
commit 32d2e31b50
3 changed files with 15 additions and 8 deletions

View File

@ -172,7 +172,7 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 3
Data: 2
Data: 4
- Name: $v
Entry: 10
Data: 0
@ -184,7 +184,7 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 3
Data: 4
Data: 2
- Name: $v
Entry: 10
Data: 0
@ -200,7 +200,9 @@ MonoBehaviour:
_rotation: {x: 40, y: 0, z: 0}
_defaultSprite: {fileID: 21300000, guid: 94f9e78fc7b864b93842bdfa21276f09, type: 3}
_offset: {x: 0, y: 1.5, z: 1.35}
_fixedSpriteSize: {x: 0.2, y: 0.2}
_disabledOffset: {x: 0, y: 0.2, z: 0.165}
_fixedLocalScale: {x: 0.2, y: 0.2}
_disabledColor: {r: 0.6627451, g: 0.6627451, b: 0.6627451, a: 0.5}
--- !u!114 &1332098886975329103
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -12,7 +12,7 @@ public abstract class PropUiDisplayComponent<T> : SerializedMonoBehaviour where
[SerializeField]
protected Sprite _defaultSprite;
private IInteractionSubsystemObject<T> _interactionSubsystemObject;
private Dictionary<T, Material> _materialDictionary;
private Dictionary<T, Material> _internalMaterials;
private T _currentInteractionType;
protected IInteractable _interactable;
protected SpriteRenderer _spriteRenderer;
@ -22,7 +22,7 @@ private void Awake()
Initialize();
}
protected abstract Dictionary<T, Material> SetMaterialDictionary();
protected abstract Dictionary<T, Material> GetInteractionDisplayMaterials();
protected virtual void Initialize()
{
@ -44,7 +44,7 @@ protected virtual void Initialize()
uiGameObject.layer = LayerMask.NameToLayer("WorldUI");
UpdateSpriteTransform();
_materialDictionary = SetMaterialDictionary();
_internalMaterials = GetInteractionDisplayMaterials();
}
protected virtual void UpdateSpriteTransform()
@ -109,7 +109,7 @@ virtual protected Color GetSpriteColor()
private bool UpdateSpriteMaterial(T state)
{
if (!_materialDictionary.TryGetValue(state, out var material) || material == null)
if (!_internalMaterials.TryGetValue(state, out var material) || material == null)
{
// TODO 캔버스 다운
_spriteRenderer.enabled = false;

View File

@ -19,11 +19,16 @@ public class RestaurantUiDisplayComponent : PropUiDisplayComponent<RestaurantOrd
private Color _disabledColor = new Color(Color.darkGray.r, Color.darkGray.g, Color.darkGray.b, 0.5f);
[OdinSerialize]
private Dictionary<RestaurantOrderType, Material> _materialDictionary = new();
protected override Dictionary<RestaurantOrderType, Material> SetMaterialDictionary()
protected override Dictionary<RestaurantOrderType, Material> GetInteractionDisplayMaterials()
{
return _materialDictionary;
}
protected override void Initialize()
{
base.Initialize();
}
protected override void UpdateSpriteTransform()
{
base.UpdateSpriteTransform();