Prop World Ui 수정
This commit is contained in:
parent
49a709b3c4
commit
92f24af250
@ -9,7 +9,6 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1664322405549350652}
|
||||
- component: {fileID: 8522104897182006738}
|
||||
m_Layer: 0
|
||||
m_Name: InteractionPoint
|
||||
m_TagString: Untagged
|
||||
@ -32,61 +31,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3697702677815423220}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &8522104897182006738
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3857692527302447930}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: c607300554a0c44469620484fccbf239, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 5.12, y: 5.12}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &4103096974375017811
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -102,7 +46,6 @@ GameObject:
|
||||
- component: {fileID: 29040892075516248}
|
||||
- component: {fileID: 1332098886975329103}
|
||||
- component: {fileID: 3786917981383564029}
|
||||
- component: {fileID: 1886819858489010523}
|
||||
m_Layer: 7
|
||||
m_Name: RestaurantOrder
|
||||
m_TagString: Untagged
|
||||
@ -223,7 +166,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
Data: 2
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@ -236,6 +179,18 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 3
|
||||
Data: 4
|
||||
- Name: $v
|
||||
Entry: 10
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
@ -269,7 +224,7 @@ MonoBehaviour:
|
||||
_unavailableStyle:
|
||||
Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
Width: 0.5
|
||||
Opacity: 0.5
|
||||
Opacity: 1
|
||||
_objectiveStyle:
|
||||
Color: {r: 0, g: 1, b: 1, a: 1}
|
||||
Width: 0.5
|
||||
@ -480,64 +435,9 @@ MonoBehaviour:
|
||||
seeThroughTextureUVSpace: 0
|
||||
seeThroughTextureScale: 1
|
||||
seeThroughChildrenSortingMode: 0
|
||||
rmsCount: 2
|
||||
rmsCount: 0
|
||||
hitFxInitialIntensity: 0
|
||||
hitFxMode: 0
|
||||
hitFxFadeOutDuration: 0.25
|
||||
hitFxColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
hitFxRadius: 0.5
|
||||
--- !u!212 &1886819858489010523
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4103096974375017811}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: c607300554a0c44469620484fccbf239, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 5.12, y: 5.12}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
|
@ -7,10 +7,10 @@ namespace DDD.Restaurant
|
||||
{
|
||||
public abstract class PropUiDisplayComponent<T> : SerializedMonoBehaviour where T : Enum
|
||||
{
|
||||
[SerializeField]
|
||||
protected Vector3 _offset = new Vector3(0.0f, 0.75f, 0.675f);
|
||||
[SerializeField]
|
||||
protected Vector3 _rotation = new Vector3(40.0f, 0, 0);
|
||||
[SerializeField]
|
||||
protected Sprite _defaultSprite;
|
||||
private IInteractionSubsystemObject<T> _interactionSubsystemObject;
|
||||
private Dictionary<T, Material> _materialDictionary;
|
||||
private T _currentInteractionType;
|
||||
@ -35,16 +35,19 @@ protected virtual void Initialize()
|
||||
|
||||
// TODO: 임시 나중에 제대로 수정할 것
|
||||
var uiGameObject = Instantiate(new GameObject("TemporaryUi"), transform);
|
||||
|
||||
_spriteRenderer = uiGameObject.AddComponent<SpriteRenderer>();
|
||||
_spriteRenderer.sprite = GetDisplaySprite();
|
||||
_spriteRenderer.enabled = false;
|
||||
|
||||
_spriteTransform = uiGameObject.transform;
|
||||
uiGameObject.layer = LayerMask.NameToLayer("WorldUI");
|
||||
UpdateSpriteTransform();
|
||||
|
||||
_spriteRenderer = uiGameObject.AddComponent<SpriteRenderer>();
|
||||
_spriteRenderer.enabled = false;
|
||||
|
||||
_materialDictionary = SetMaterialDictionary();
|
||||
}
|
||||
|
||||
private void UpdateSpriteTransform()
|
||||
protected virtual void UpdateSpriteTransform()
|
||||
{
|
||||
_spriteTransform.position = GetDisplayPosition();
|
||||
_spriteTransform.rotation = Quaternion.Euler(GetDisplayRotation());
|
||||
@ -57,9 +60,14 @@ private bool GetOwnerInteractable(out IInteractable interactable)
|
||||
return isInteractionSubsystem;
|
||||
}
|
||||
|
||||
protected virtual Sprite GetDisplaySprite()
|
||||
{
|
||||
return _defaultSprite;
|
||||
}
|
||||
|
||||
protected virtual Vector3 GetDisplayPosition()
|
||||
{
|
||||
return transform.position + _offset;
|
||||
return transform.position;
|
||||
}
|
||||
|
||||
protected virtual Vector3 GetDisplayRotation()
|
||||
|
@ -9,7 +9,7 @@ namespace DDD.Restaurant
|
||||
public class RestaurantUiDisplayComponent : PropUiDisplayComponent<RestaurantOrderType>
|
||||
{
|
||||
[SerializeField]
|
||||
private Sprite _temporarySprite;
|
||||
protected Vector3 _offset = new Vector3(0.0f, 0.75f, 0.675f);
|
||||
[SerializeField]
|
||||
private Vector2 _fixedSpriteSize = new Vector2(.2f, .2f);
|
||||
[OdinSerialize]
|
||||
@ -19,10 +19,9 @@ protected override Dictionary<RestaurantOrderType, Material> SetMaterialDictiona
|
||||
return _materialDictionary;
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
protected override void UpdateSpriteTransform()
|
||||
{
|
||||
base.Initialize();
|
||||
_spriteRenderer.sprite = _temporarySprite;
|
||||
base.UpdateSpriteTransform();
|
||||
_spriteRenderer.transform.localScale = _fixedSpriteSize;
|
||||
}
|
||||
|
||||
@ -31,18 +30,13 @@ protected override Vector3 GetDisplayPosition()
|
||||
if (GetCurrentInteractionType() == RestaurantOrderType.Order)
|
||||
{
|
||||
// Find interaction points from interactable owner
|
||||
if (_interactable == null)
|
||||
{
|
||||
return base.GetDisplayPosition();
|
||||
}
|
||||
|
||||
var points = _interactable.GetInteractionPoints();
|
||||
var points = _interactable?.GetInteractionPoints();
|
||||
if (points is { Length: > 0 })
|
||||
{
|
||||
return points[0] + _offset;
|
||||
}
|
||||
}
|
||||
return base.GetDisplayPosition();
|
||||
return transform.position;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user