diff --git a/Assets/01.Scenes/01.Tycoon.unity b/Assets/01.Scenes/01.Tycoon.unity index b6ac20ca2..7137cfd5a 100644 --- a/Assets/01.Scenes/01.Tycoon.unity +++ b/Assets/01.Scenes/01.Tycoon.unity @@ -1658,6 +1658,81 @@ MonoBehaviour: SwitchMapsClosed: 1 _rectTransform: {fileID: 102499728} k__BackingField: {fileID: 139042448} +--- !u!1 &104342230 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 104342231} + - component: {fileID: 104342233} + - component: {fileID: 104342232} + m_Layer: 5 + m_Name: Liqueur + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &104342231 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104342230} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 936772049} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -250, y: 0} + m_SizeDelta: {x: 200, y: 200} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &104342232 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104342230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: a8c45767f0a3ec245a47087c7ada2b50, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &104342233 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104342230} + m_CullTransparentMesh: 1 --- !u!1 &106186566 GameObject: m_ObjectHideFlags: 0 @@ -3048,6 +3123,7 @@ MonoBehaviour: shakeLimit: 10 fallSpeed: 200 shakeInterval: 0.01 + ResultUi: {fileID: 0} --- !u!1 &177060249 GameObject: m_ObjectHideFlags: 0 @@ -3175,7 +3251,7 @@ MonoBehaviour: card01: {fileID: 5785355462301107295, guid: 2116ffd228314c745b8615652b11d19e, type: 3} card02: {fileID: 5785355462301107295, guid: 2116ffd228314c745b8615652b11d19e, type: 3} card03: {fileID: 5785355462301107295, guid: 2116ffd228314c745b8615652b11d19e, type: 3} - _upgradePopup: {fileID: 272053700} + _upgradePopup: {fileID: 454484352} --- !u!1 &194818728 GameObject: m_ObjectHideFlags: 0 @@ -4035,58 +4111,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 270061732} m_CullTransparentMesh: 1 ---- !u!1 &272053700 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 272053701} - - component: {fileID: 272053702} - m_Layer: 5 - m_Name: Upgrade_Popup - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &272053701 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 272053700} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 1 - m_Children: - - {fileID: 1444408144} - m_Father: {fileID: 1049919592} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &272053702 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 272053700} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 53190759a9125774885ff29574bb98c0, type: 3} - m_Name: - m_EditorClassIdentifier: - _panel: {fileID: 1444408143} - _animationController: {fileID: 547484574} - information: {fileID: 1827455912} --- !u!1 &272969422 GameObject: m_ObjectHideFlags: 0 @@ -4608,6 +4632,118 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 327744319} m_CullTransparentMesh: 1 +--- !u!1 &332294395 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 332294396} + - component: {fileID: 332294400} + - component: {fileID: 332294399} + - component: {fileID: 332294398} + - component: {fileID: 332294397} + m_Layer: 5 + m_Name: BackgroundPaper + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &332294396 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 332294395} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1560233564} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1000, y: 600} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &332294397 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 332294395} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 17488a2bea6f4126a7877ce5d934f865, type: 3} + m_Name: + m_EditorClassIdentifier: + _animator: {fileID: 332294398} +--- !u!95 &332294398 +Animator: + serializedVersion: 7 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 332294395} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 321b6014bde8a4d44aa6a3c1200a26cc, type: 2} + m_CullingMode: 0 + m_UpdateMode: 2 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_AnimatePhysics: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!114 &332294399 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 332294395} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &332294400 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 332294395} + m_CullTransparentMesh: 1 --- !u!1 &338206470 GameObject: m_ObjectHideFlags: 0 @@ -6182,6 +6318,59 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 450220854} m_CullTransparentMesh: 1 +--- !u!1 &454484352 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 454484353} + - component: {fileID: 454484354} + m_Layer: 5 + m_Name: Upgrade_Ui + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &454484353 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 454484352} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 1560233564} + m_Father: {fileID: 1049919592} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &454484354 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 454484352} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 53190759a9125774885ff29574bb98c0, type: 3} + m_Name: + m_EditorClassIdentifier: + _panel: {fileID: 1560233563} + _animationController: {fileID: 332294397} + information: {fileID: 936772050} + liqueurImage: {fileID: 104342232} --- !u!1 &473619455 GameObject: m_ObjectHideFlags: 0 @@ -6841,118 +7030,6 @@ MonoBehaviour: m_EditorClassIdentifier: BoundingVolume: {fileID: 1589932377} SlowingDistance: 100 ---- !u!1 &547484572 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 547484573} - - component: {fileID: 547484577} - - component: {fileID: 547484576} - - component: {fileID: 547484575} - - component: {fileID: 547484574} - m_Layer: 5 - m_Name: BackgroundPaper - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &547484573 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 547484572} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1444408144} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 1000, y: 600} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &547484574 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 547484572} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 17488a2bea6f4126a7877ce5d934f865, type: 3} - m_Name: - m_EditorClassIdentifier: - _animator: {fileID: 547484575} ---- !u!95 &547484575 -Animator: - serializedVersion: 7 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 547484572} - m_Enabled: 1 - m_Avatar: {fileID: 0} - m_Controller: {fileID: 9100000, guid: 321b6014bde8a4d44aa6a3c1200a26cc, type: 2} - m_CullingMode: 0 - m_UpdateMode: 2 - m_ApplyRootMotion: 0 - m_LinearVelocityBlending: 0 - m_StabilizeFeet: 0 - m_AnimatePhysics: 0 - m_WarningMessage: - m_HasTransformHierarchy: 1 - m_AllowConstantClipSamplingOptimization: 1 - m_KeepAnimatorStateOnDisable: 0 - m_WriteDefaultValuesOnDisable: 0 ---- !u!114 &547484576 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 547484572} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &547484577 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 547484572} - m_CullTransparentMesh: 1 --- !u!1 &562911823 GameObject: m_ObjectHideFlags: 0 @@ -11707,6 +11784,82 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 912229365} m_CullTransparentMesh: 1 +--- !u!1 &936772048 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 936772049} + - component: {fileID: 936772051} + - component: {fileID: 936772050} + m_Layer: 5 + m_Name: Information + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &936772049 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 936772048} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 104342231} + m_Father: {fileID: 1560233564} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1000, y: 1000} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &936772050 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 936772048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: ea9a47744b51f7b46958a79a03d0cca6, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &936772051 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 936772048} + m_CullTransparentMesh: 1 --- !u!1001 &947672648 PrefabInstance: m_ObjectHideFlags: 0 @@ -13186,7 +13339,7 @@ RectTransform: - {fileID: 2032162537} - {fileID: 1701833860} - {fileID: 186139408} - - {fileID: 272053701} + - {fileID: 454484353} - {fileID: 175652153} - {fileID: 2055805161} m_Father: {fileID: 0} @@ -18494,7 +18647,7 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1434161266} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: @@ -18503,7 +18656,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -51, y: 21} + m_AnchoredPosition: {x: 60, y: 70} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1434161268 @@ -18826,43 +18979,6 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 5685570007726524012, guid: 7e6ba4001b3b92a4d8fdd586f6d0f731, type: 3} m_PrefabInstance: {fileID: 1438594026} m_PrefabAsset: {fileID: 0} ---- !u!1 &1444408143 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1444408144} - m_Layer: 5 - m_Name: Panel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &1444408144 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1444408143} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 547484573} - - {fileID: 1827455911} - m_Father: {fileID: 272053701} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1445223406 GameObject: m_ObjectHideFlags: 0 @@ -20551,6 +20667,43 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1559580035} m_CullTransparentMesh: 1 +--- !u!1 &1560233563 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1560233564} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1560233564 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560233563} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 332294396} + - {fileID: 936772049} + m_Father: {fileID: 454484353} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &1562271984 PrefabInstance: m_ObjectHideFlags: 0 @@ -22672,6 +22825,8 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: {fileID: 11400000, guid: 5fd0220da8e388e4c872a9fcc80d2c76, type: 2} _mushroomObject: {fileID: 9017181398980009727, guid: 6ae3ef0fd03a4f14bb60802eb4fc0fa8, type: 3} + PlayerServingCount: 0 + PlayerCleaningCount: 0 --- !u!114 &1665075873 MonoBehaviour: m_ObjectHideFlags: 0 @@ -25832,81 +25987,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1821459830} m_CullTransparentMesh: 1 ---- !u!1 &1827455910 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1827455911} - - component: {fileID: 1827455913} - - component: {fileID: 1827455912} - m_Layer: 5 - m_Name: Information - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1827455911 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1827455910} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1444408144} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 1000, y: 1000} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1827455912 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1827455910} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: ea9a47744b51f7b46958a79a03d0cca6, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1827455913 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1827455910} - m_CullTransparentMesh: 1 --- !u!1 &1834176991 GameObject: m_ObjectHideFlags: 0 @@ -26220,24 +26300,24 @@ MonoBehaviour: m_EditorClassIdentifier: _billPrefab: {fileID: 3359733629073227380, guid: 8e1b25c375bfe2748993aba6d9af3fb5, type: 3} _chain: {fileID: 1434161268} - _spawnPosition: {x: 400, y: -120, z: 0} + _spawnPosition: {x: 400, y: -65, z: 0} _spawnLocation: {fileID: 128638924} _billInfos: - IsEmpty: 1 IsMoving: 0 - k__BackingField: {x: -290, y: -120, z: 0} + k__BackingField: {x: -220, y: -65, z: 0} - IsEmpty: 1 IsMoving: 0 - k__BackingField: {x: -170, y: -120, z: 0} + k__BackingField: {x: -110, y: -65, z: 0} - IsEmpty: 1 IsMoving: 0 - k__BackingField: {x: -50, y: -120, z: 0} + k__BackingField: {x: 0, y: -65, z: 0} - IsEmpty: 1 IsMoving: 0 - k__BackingField: {x: 70, y: -120, z: 0} + k__BackingField: {x: 110, y: -65, z: 0} - IsEmpty: 1 IsMoving: 0 - k__BackingField: {x: 190, y: -120, z: 0} + k__BackingField: {x: 220, y: -65, z: 0} --- !u!1 &1858488034 GameObject: m_ObjectHideFlags: 0 @@ -29923,6 +30003,63 @@ MonoBehaviour: _healthPointPrefab: {fileID: 4356182340925070836, guid: b7ec42093fecf23439afbcf6ebd755db, type: 3} _maxHeartCount: 5 _healthPoints: [] +--- !u!1001 &1232916638049353559 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8379768038421875437, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_Name + value: LocalizationManager + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9131977339796530822, guid: 1614514235215fe4b877ab0945881d27, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1614514235215fe4b877ab0945881d27, type: 3} --- !u!1001 &5626406452199475265 PrefabInstance: m_ObjectHideFlags: 0 @@ -32061,6 +32198,7 @@ SceneRoots: - {fileID: 1628404463} - {fileID: 91463582} - {fileID: 1472541870} + - {fileID: 1232916638049353559} - {fileID: 1665075868} - {fileID: 338206472} - {fileID: 141729588} diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/EatCocktail.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/EatCocktail.cs index ec7473163..3cc21ad60 100644 --- a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/EatCocktail.cs +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/EatCocktail.cs @@ -31,7 +31,7 @@ namespace BlueWater.BehaviorTrees.Actions return TaskStatus.Running; } - _customer.PayMoney(); + _customer.FinishFood(); return TaskStatus.Success; } } diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/MoveMoneyCounterPosition.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/MoveMoneyCounterPosition.cs new file mode 100644 index 000000000..d803e5b3f --- /dev/null +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/MoveMoneyCounterPosition.cs @@ -0,0 +1,26 @@ +using System; +using BehaviorDesigner.Runtime.Tasks; +using BlueWater.Npcs.Customers; +using Action = BehaviorDesigner.Runtime.Tasks.Action; + +namespace BlueWater.BehaviorTrees.Actions +{ + [TaskCategory("Custom/Npc/Customer")] + [Serializable] + public class MoveMoneyCounterPosition : Action + { + private Customer _customer; + + public override void OnAwake() + { + _customer = GetComponent(); + } + + public override TaskStatus OnUpdate() + { + _customer.MoveMoneyCounter(); + + return TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/MoveMoneyCounterPosition.cs.meta b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/MoveMoneyCounterPosition.cs.meta new file mode 100644 index 000000000..e8affe0d8 --- /dev/null +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/MoveMoneyCounterPosition.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 17c5828cdf648f44a9783d1495a16150 diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/PayMoney.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/PayMoney.cs new file mode 100644 index 000000000..5e941cd7b --- /dev/null +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/PayMoney.cs @@ -0,0 +1,32 @@ +using System; +using BehaviorDesigner.Runtime.Tasks; +using BlueWater.Npcs.Customers; +using Action = BehaviorDesigner.Runtime.Tasks.Action; + +namespace BlueWater.BehaviorTrees.Actions +{ + [TaskCategory("Custom/Npc/Customer")] + [Serializable] + public class PayMoney : Action + { + private Customer _customer; + + public override void OnAwake() + { + _customer = GetComponent(); + } + + public override void OnStart() + { + _customer.MoveMoneyCounter(); + } + + public override TaskStatus OnUpdate() + { + if (!_customer.CanMoneyCounterInteractionPosition()) return TaskStatus.Running; + + _customer.PayMoney(); + return TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/PayMoney.cs.meta b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/PayMoney.cs.meta new file mode 100644 index 000000000..7cc53deb2 --- /dev/null +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/PayMoney.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c2d5880b15c2a2f49bf07a3e5743cb3a diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/Vomit.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/Vomit.cs index e425606e1..f6a4676f4 100644 --- a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/Vomit.cs +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/Vomit.cs @@ -1,10 +1,8 @@ using System; using BehaviorDesigner.Runtime.Tasks; using BlueWater.Npcs.Customers; -using BlueWater.Tycoons; using UnityEngine; using Action = BehaviorDesigner.Runtime.Tasks.Action; -using Random = UnityEngine.Random; namespace BlueWater.BehaviorTrees.Actions { @@ -13,7 +11,6 @@ namespace BlueWater.BehaviorTrees.Actions public class Vomit : Action { private Customer _customer; - private bool _canVomit; private bool _isVomiting; private Vector3 _vomitingPosition; @@ -22,21 +19,8 @@ namespace BlueWater.BehaviorTrees.Actions _customer = GetComponent(); } - public override void OnStart() - { - var random = Random.Range(0f, 100f); - if (random <= TycoonManager.Instance.TycoonStageController.StageDataSo.VomitingPercent) - { - _canVomit = true; - _vomitingPosition = _customer.AIMovement.SetRandomPoint(); - _customer.AIMovement.Move(_vomitingPosition); - } - } - public override TaskStatus OnUpdate() { - if (!_canVomit) return TaskStatus.Success; - if (!_customer.AIMovement.HasReachedDestination()) return TaskStatus.Running; if (!_isVomiting) diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/CanVomit.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/CanVomit.cs new file mode 100644 index 000000000..0e8785dae --- /dev/null +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/CanVomit.cs @@ -0,0 +1,41 @@ +using System; +using BehaviorDesigner.Runtime.Tasks; +using BlueWater.Npcs.Customers; +using BlueWater.Tycoons; +using UnityEngine; +using Random = UnityEngine.Random; + +namespace BlueWater.BehaviorTrees.Actions +{ + [TaskCategory("Custom/Npc/Customer")] + [Serializable] + public class CanVomit : Conditional + { + private Customer _customer; + private bool _canVomit; + private bool _isVomiting; + private Vector3 _vomitingPosition; + + public override void OnAwake() + { + _customer = GetComponent(); + } + + public override void OnStart() + { + _customer.MoveMoneyCounter(); + var random = Random.Range(0f, 100f); + if (random <= TycoonManager.Instance.TycoonStageController.StageDataSo.VomitingPercent) + { + _canVomit = true; + _vomitingPosition = _customer.AIMovement.SetRandomPoint(); + _customer.AIMovement.Move(_vomitingPosition); + } + } + + public override TaskStatus OnUpdate() + { + return _canVomit ? TaskStatus.Success : TaskStatus.Failure; + } + } +} \ No newline at end of file diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/CanVomit.cs.meta b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/CanVomit.cs.meta new file mode 100644 index 000000000..c25a91bc2 --- /dev/null +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/CanVomit.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2d82bbde851a23b42835bd04ca3d3d25 diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/PayMoney.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/PayMoney.cs deleted file mode 100644 index 823171d4b..000000000 --- a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/PayMoney.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using BehaviorDesigner.Runtime.Tasks; -using BlueWater.Npcs.Customers; -using BlueWater.Uis; -using PixelCrushers.DialogueSystem; - -namespace BlueWater.BehaviorTrees.Actions -{ - [TaskCategory("Custom/Npc/Customer")] - [Serializable] - public class PayMoney : Conditional - { - // private Customer _customer; - // private CustomerData _customerData; - // private BalloonUi _balloonUi; - // private int _goldIdx; - // private bool _isPaidMoney; - // - // public override void OnAwake() - // { - // _customer = GetComponent(); - // _customerData = _customer.CustomerData; - // } - // - // public override void OnStart() - // { - // _balloonUi = _customer.BalloonUi; - // _balloonUi.PayMoney(_customerData.WaitTime, _customerData.HurryTime); - // _customer.OnInteraction += HandlePayMoneyInteraction; - // _customer.RegisterPlayerInteraction(); - // } - // - // public override TaskStatus OnUpdate() - // { - // if (_isPaidMoney) - // { - // return TaskStatus.Success; - // } - // - // if (_balloonUi.IsWaitTimeOver()) - // { - // _customer.OnInteraction -= HandlePayMoneyInteraction; - // _customer.UnregisterPlayerInteraction(); - // _balloonUi.CancelOrder(); - // _balloonUi.HideUi(); - // // _customer.AddHappyPoint(-3); - // // if (_customer.HappyPoint <= 0) - // // { - // // _foodBalloonUi.CancelOrder(); - // // _customer.Bark("CancelOrder"); - // // } - // return TaskStatus.Failure; - // } - // - // return TaskStatus.Running; - // } - // - // private void HandlePayMoneyInteraction() - // { - // var tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer; - // var foodPrice = _customer.ItemData.Price; - // float tipCoefficient; - // string barkName; - // switch (_customer.HappyPoint) - // { - // case >= 3: - // tipCoefficient = 2f; - // barkName = "SatisfactoryEvaluation"; - // break; - // case >= 2: - // tipCoefficient = 1.5f; - // barkName = "MediocreEvaluation"; - // break; - // case >= 1: - // tipCoefficient = 1.1f; - // barkName = "MediocreEvaluation"; - // break; - // default: - // tipCoefficient = 1f; - // barkName = "UnsatisfactoryEvaluation"; - // break; - // } - // - // var tipAmount = foodPrice * (int)tipCoefficient; - // var paidAmount = foodPrice + tipAmount; - // tycoonPlayer.GetMoney(paidAmount); - // _customer.PayMoney(foodPrice, tipAmount); - // _balloonUi.HideUi(); - // _customer.OnInteraction -= HandlePayMoneyInteraction; - // _customer.Bark(barkName, BarkOrder.FirstValid); - // _customer.UnregisterPlayerInteraction(); - // _balloonUi.CancelOrder(); - // - // _isPaidMoney = true; - // } - } -} \ No newline at end of file diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/PayMoney.cs.meta b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/PayMoney.cs.meta deleted file mode 100644 index 35061a393..000000000 --- a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Conditional/PayMoney.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: b9c5679271731774f908d8d3119761c9 diff --git a/Assets/02.Scripts/Character/Npc/Crew/Bartender/BartenderCrew.cs b/Assets/02.Scripts/Character/Npc/Crew/Bartender/BartenderCrew.cs index 28aa54f94..048acc210 100644 --- a/Assets/02.Scripts/Character/Npc/Crew/Bartender/BartenderCrew.cs +++ b/Assets/02.Scripts/Character/Npc/Crew/Bartender/BartenderCrew.cs @@ -1,3 +1,4 @@ +using System; using BlueWater.Interfaces; using BlueWater.Items; using BlueWater.Npcs.Customers; @@ -20,15 +21,34 @@ namespace BlueWater.Npcs.Crews.Bartender public IStateMachine MakingCocktailState { get; private set; } private CocktailData _makingCocktailData; + private bool _isFeverTime; + private float _feverTime; + private float _feverMultiply = 1f; protected override void Update() { StateMachineController.UpdateState(this); base.Update(); + + if (_isFeverTime) + { + if (_feverTime > 0f) + { + _feverTime -= Time.deltaTime; + } + else + { + _feverTime = 0f; + _feverMultiply = 1f; + _isFeverTime = false; + } + } } public override void Initialize() { + EventManager.OnCleaningBonus += FeverTime; + IdleState = new IdleState(); MakingCocktailState = new MakingCocktailState(); @@ -36,7 +56,12 @@ namespace BlueWater.Npcs.Crews.Bartender base.Initialize(); } - + + private void OnDestroy() + { + EventManager.OnCleaningBonus -= FeverTime; + } + public override void ResetMission() { CrewInteraction = null; @@ -69,7 +94,7 @@ namespace BlueWater.Npcs.Crews.Bartender OrderedCustomer.CurrentBill.BartenderMakingCocktail(); } - var makingTime = _makingCocktailTime - TycoonManager.Instance.TycoonStatus.BartenderMakingReduction; + var makingTime = (_makingCocktailTime - TycoonManager.Instance.TycoonStatus.BartenderMakingReduction) / _feverMultiply; BalloonUi.OrderItem(_makingCocktailData.Idx, 0, makingTime); IsMakingCocktail = true; @@ -86,5 +111,12 @@ namespace BlueWater.Npcs.Crews.Bartender EventManager.InvokeCocktailCompleted(_makingCocktailData, false); ResetMission(); } + + public void FeverTime(int feverTime, float multiply) + { + _feverTime += feverTime; + _feverMultiply = multiply; + _isFeverTime = true; + } } } \ No newline at end of file diff --git a/Assets/02.Scripts/Character/Npc/Customer/Customer.cs b/Assets/02.Scripts/Character/Npc/Customer/Customer.cs index d2d31aa6d..fbce3fce3 100644 --- a/Assets/02.Scripts/Character/Npc/Customer/Customer.cs +++ b/Assets/02.Scripts/Character/Npc/Customer/Customer.cs @@ -90,7 +90,7 @@ namespace BlueWater.Npcs.Customers public float InteractionRadius { get; private set; } = 2f; [field: SerializeField] - public string InteractionMessage { get; private set; } + public string InteractionMessage { get; set; } [SerializeField] private Vomiting _vomiting; @@ -140,6 +140,7 @@ namespace BlueWater.Npcs.Customers private IAstarAI _astarAi; private Transform _spawnTransform; + private MoneyCounter _moneyCounter; private int _paidAmount; private int _foodPrice; private int _tipAmount; @@ -212,6 +213,7 @@ namespace BlueWater.Npcs.Customers public void Initialize(LevelData levelData, Transform spawnTransform) { + _moneyCounter = FindAnyObjectByType(); CurrentLevelData = levelData; _spawnTransform = spawnTransform; @@ -279,9 +281,14 @@ namespace BlueWater.Npcs.Customers CurrentTableSeat.SetFood(); StateMachineController.TransitionToState(HappyState, this); - var tip = 0; + int tip; if (IsServedPlayer) { + if (TycoonManager.Instance.TycoonStatus.CurrentPassiveCard == PassiveCard.ServingBonus) + { + TycoonManager.Instance.TycoonStageController.ServingBonus(); + } + tip = (int)(CurrentLevelData.Gold * TycoonManager.Instance.TycoonStatus.TipMultiplier); } else @@ -366,6 +373,7 @@ namespace BlueWater.Npcs.Customers { SpineController.EnableCustomMaterial(); EventManager.InvokeShowInteractionUi(InteractionMessage); + EventManager.InvokeHoldInteracting(0f); } public virtual void HideInteractionUi() @@ -412,7 +420,7 @@ namespace BlueWater.Npcs.Customers return isWaitTimeOver; } - public void PayMoney() + public void FinishFood() { var random = Random.Range(0f, 100f); if (random <= TycoonManager.Instance.TycoonStageController.StageDataSo.DirtyTablePercent) @@ -424,11 +432,23 @@ namespace BlueWater.Npcs.Customers CurrentTableSeat.CleanTable(); } + GainExp(); + } + + private void GainExp() + { var exp = (int)(CurrentLevelData.Exp * TycoonManager.Instance.TycoonStatus.ExpMultiplier); EventManager.InvokeChangeExp(exp); } + public void PayMoney() + { + var gold = (int)(CurrentLevelData.Gold * TycoonManager.Instance.TycoonStatus.GoldMultiplier); + + _moneyCounter.AddCurrentMoney(gold); + } + public void Vomit() { AIMovement.StopMove(); @@ -472,7 +492,6 @@ namespace BlueWater.Npcs.Customers { IsReceivedItem = false; IsOrderedSucceed = false; - InteractionMessage = "칵테일 전달"; OrderedCocktailData = TycoonManager.Instance.TycoonIngredientController.GetRandomCocktailData(); var hurryTime = CurrentLevelData.HurryTime + TycoonManager.Instance.TycoonStatus.CustomerHurryTimeIncrease; BalloonUi.OrderItem(OrderedCocktailData.Idx, CurrentLevelData.WaitTime, hurryTime); @@ -482,15 +501,40 @@ namespace BlueWater.Npcs.Customers EventManager.InvokeOrderedCocktail(this); } + public void MovePosition(Vector3 targetPosition) + { + AIMovement.Move(targetPosition); + StateMachineController.TransitionToState(WalkingState, this); + } + + public bool CanMoneyCounterInteractionPosition() + { + if (_moneyCounter.CenterTransform == null) return false; + + return AIMovement.HasReachedDestination() || + Vector3.Distance(_moneyCounter.CenterTransform.position, transform.position) <= + _moneyCounter.InteractionRadius; + } + + public void MoveMoneyCounter() + { + VacateTable(); + MovePosition(_moneyCounter.transform.position); + } + public void MoveSpawnPosition() + { + VacateTable(); + MovePosition(_spawnTransform.position); + } + + public void VacateTable() { if (CurrentTableSeat) { CurrentTableSeat.VacateSeat(); CurrentTableSeat = null; } - AIMovement.Move(_spawnTransform.position); - StateMachineController.TransitionToState(WalkingState, this); } public void ResetGauge() diff --git a/Assets/02.Scripts/Character/Player/Tycoon/TycoonPickupHandler.cs b/Assets/02.Scripts/Character/Player/Tycoon/TycoonPickupHandler.cs index b956871c7..5b6f460e9 100644 --- a/Assets/02.Scripts/Character/Player/Tycoon/TycoonPickupHandler.cs +++ b/Assets/02.Scripts/Character/Player/Tycoon/TycoonPickupHandler.cs @@ -89,6 +89,14 @@ namespace BlueWater.Players.Tycoons IsPickedUpItem = false; } + public void ChangeItem(IPickup item) + { + IsUnfinishedCocktailPickedUp = false; + _currentPickupItem = item; + _itemRenderer.enabled = false; + IsPickedUpItem = true; + } + public IPickup GetCurrentPickupItem() => _currentPickupItem; public bool IsServablePickupItem() => IsPickedUpItem && _currentPickupItem.Idx != "Cocktail000"; diff --git a/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs b/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs index 3f7a290f4..c9a5b4bc1 100644 --- a/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs +++ b/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs @@ -61,6 +61,12 @@ namespace BlueWater.Players.Tycoons [field: SerializeField] public TycoonPickupHandler TycoonPickupHandler { get; private set; } + [SerializeField] + private PayMoneyUi _payMoneyUiObject; + + [SerializeField] + private Vector3 _offset = new(0f, 1.5f, 0f); + public bool IsCleaningFloor { get; set; } public bool IsCleaningTable { get; set; } public bool IsMakingCocktail { get; set; } @@ -100,6 +106,7 @@ namespace BlueWater.Players.Tycoons EventManager.OnMakeCocktailCompleted += MakeCocktailCompleted; EventManager.OnCocktailDiscarded += DiscardCocktail; EventManager.OnCocktailServedToCustomer += ServedCocktail; + EventManager.OnChangedRandomCocktail += ChangeCocktail; IdleState = new IdleState(); WalkingState = new WalkingState(); @@ -127,6 +134,7 @@ namespace BlueWater.Players.Tycoons EventManager.OnMakeCocktailCompleted -= MakeCocktailCompleted; EventManager.OnCocktailDiscarded -= DiscardCocktail; EventManager.OnCocktailServedToCustomer -= ServedCocktail; + EventManager.OnChangedRandomCocktail -= ChangeCocktail; } #endregion @@ -172,6 +180,16 @@ namespace BlueWater.Players.Tycoons if (!isMadePlayer) return; InteractionCanvas.BalloonUi.SetItemImage(cocktailData); + + if (TycoonManager.Instance.TycoonStatus.CurrentPassiveCard != PassiveCard.MakingBonus || cocktailData.Idx == "Cocktail000") return; + + var tip = (int)(TycoonManager.Instance.GetCurrentLevelData().Gold * TycoonManager.Instance.TycoonStatus.TipMultiplier); + if (tip > 0) + { + var payMoneyUi = Instantiate(_payMoneyUiObject, transform.position + _offset, + Quaternion.identity, TycoonUiManager.Instance.WorldCanvas.transform); + payMoneyUi.Initialize(tip); + } } public void DiscardCocktail(CocktailData cocktailData, bool isDiscardedPlayer) @@ -190,6 +208,12 @@ namespace BlueWater.Players.Tycoons InteractionCanvas.BalloonUi.DiscardItem(); } + public void ChangeCocktail(CocktailData cocktailData) + { + InteractionCanvas.BalloonUi.SetItemImage(cocktailData); + TycoonPickupHandler.ChangeItem(cocktailData); + } + private void Dash() { if (!TycoonMovement.CanDash()) return; diff --git a/Assets/02.Scripts/EventManager.cs b/Assets/02.Scripts/EventManager.cs index 8f50d42b6..dee2a5cbe 100644 --- a/Assets/02.Scripts/EventManager.cs +++ b/Assets/02.Scripts/EventManager.cs @@ -202,6 +202,13 @@ namespace BlueWater OnOrderResult?.Invoke(orderedCustomer, orderedSucceed); } + // 손님이 나갈 때, 계산대에 돈을 두고 가는 이벤트 + public static Action OnAddedMoneyCounter; + public static void InvokeAddedMoneyCounter(int money) + { + OnAddedMoneyCounter?.Invoke(money); + } + // 손님의 기다림 게이지를 초기화 시키는 이벤트 public static Action OnGaugeResetCustomers; public static void InvokeGaugeResetCustomers() @@ -228,11 +235,19 @@ namespace BlueWater OnCreateBartenderCrew?.Invoke(); } + // 인게임 UI 최신화 이벤트 public static Action OnUpdateCrewUi; public static void InvokeUpdateCrewUi(int bartenderCount, int serverCount, int cleanerCount) { OnUpdateCrewUi?.Invoke(bartenderCount, serverCount, cleanerCount); } + + // 패시브 카드 (청소 보너스)로 바텐더 제작 속도 증가 이벤트 + public static Action OnCleaningBonus; + public static void InvokeCleaningBonus(int feverTime, float multiply) + { + OnCleaningBonus?.Invoke(feverTime, multiply); + } // Props // 레스토랑을 전부 청소 이벤트 @@ -269,6 +284,27 @@ namespace BlueWater { OnCreateMold?.Invoke(); } + + // 계산대 골드 자동 회수 이벤트 + public static Action OnGainAutoMoneyCounter; + public static void InvokeGainAutoMoneyCounter(int gainWaitTime) + { + OnGainAutoMoneyCounter?.Invoke(gainWaitTime); + } + + // 휴지통이 랜덤한 칵테일로 변하는 패시브 카드 이벤트 + public static Action OnSelectedRandomChangeCard; + public static void InvokeChangeRandomCard() + { + OnSelectedRandomChangeCard?.Invoke(); + } + + // 휴지통이 랜덤한 칵테일로 변하는 패시브 카드 이벤트 + public static Action OnChangedRandomCocktail; + public static void InvokeChangedRandomCocktail(CocktailData changedCocktailData) + { + OnChangedRandomCocktail?.Invoke(changedCocktailData); + } #endregion } diff --git a/Assets/02.Scripts/LocalizationManager.cs b/Assets/02.Scripts/LocalizationManager.cs new file mode 100644 index 000000000..a061c72ea --- /dev/null +++ b/Assets/02.Scripts/LocalizationManager.cs @@ -0,0 +1,62 @@ +using System.Collections; +using Sirenix.OdinInspector; +using UnityEngine.Localization.Settings; + +namespace BlueWater +{ + public enum LocaleType + { + 한국어 = 0, + English = 1 + } + + public class LocalizationManager : Singleton + { + private bool _isChanging; + + private void Start() + { + var index = ES3.Load("Locale", GetCurrentLocaleIndex()); + ChangeLocale((LocaleType)index); + } + + /// + /// 0 - 한국어 + /// 1 - 영어 + /// + /// + [Button("언어 변경")] + public void ChangeLocale(LocaleType localeType) + { + if (_isChanging) return; + + StartCoroutine(ChangeLocaleCoroutine(localeType)); + } + + private IEnumerator ChangeLocaleCoroutine(LocaleType localeType) + { + _isChanging = true; + + yield return LocalizationSettings.InitializationOperation; + LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[(int)localeType]; + ES3.Save("Locale", (int)localeType); + + _isChanging = false; + } + + private int GetCurrentLocaleIndex() + { + var selectedLocale = LocalizationSettings.SelectedLocale; + var locales = LocalizationSettings.AvailableLocales.Locales; + + for (var i = 0; i < locales.Count; i++) + { + if (locales[i] == selectedLocale) + { + return i; + } + } + return -1; + } + } +} diff --git a/Assets/02.Scripts/LocalizationManager.cs.meta b/Assets/02.Scripts/LocalizationManager.cs.meta new file mode 100644 index 000000000..a1b7e3e57 --- /dev/null +++ b/Assets/02.Scripts/LocalizationManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 34c314af086484147ab3b78d4da361a6 \ No newline at end of file diff --git a/Assets/02.Scripts/Prop/Tycoon/Barrel.cs b/Assets/02.Scripts/Prop/Tycoon/Barrel.cs index aa7f9ff71..cfbdb625b 100644 --- a/Assets/02.Scripts/Prop/Tycoon/Barrel.cs +++ b/Assets/02.Scripts/Prop/Tycoon/Barrel.cs @@ -1,5 +1,6 @@ using System; using BlueWater.Items; +using BlueWater.Uis; using Sirenix.OdinInspector; using UnityEngine; @@ -59,7 +60,6 @@ namespace BlueWater.Tycoons EventManager.OnAutoSupplyBarrels += AutoSupply; _liquidImage.sprite = IsActivated ? _liquidData.Sprite : DataManager.Instance.SpriteDataSo.BarrelLock; - InteractionMessage = $"{_liquidData.Name} 따르기"; _instanceMaterial.SetColor(LiquidColorHash, _liquidData.Color * _colorIntensity); } diff --git a/Assets/02.Scripts/Prop/Tycoon/InteractionFuniture.cs b/Assets/02.Scripts/Prop/Tycoon/InteractionFuniture.cs index c07ed1c96..379491b67 100644 --- a/Assets/02.Scripts/Prop/Tycoon/InteractionFuniture.cs +++ b/Assets/02.Scripts/Prop/Tycoon/InteractionFuniture.cs @@ -1,8 +1,10 @@ +using System.Collections; using BlueWater.Interfaces; using BlueWater.Players.Tycoons; using BlueWater.Uis; using Sirenix.OdinInspector; using UnityEngine; +using UnityEngine.Localization.Components; namespace BlueWater.Tycoons { @@ -21,6 +23,9 @@ namespace BlueWater.Tycoons [field: SerializeField, Required, BoxGroup("컴포넌트")] public Material OutlineMaterial { get; private set; } + [field: SerializeField, BoxGroup("컴포넌트")] + public LocalizeStringEvent LocalizeStringEvent { get; protected set; } + [BoxGroup("변수")] [field: SerializeField, BoxGroup("변수")] public bool EnableInteraction { get; private set; } = true; @@ -29,7 +34,7 @@ namespace BlueWater.Tycoons public float InteractionRadius { get; private set; } = 2f; [field: SerializeField, BoxGroup("변수")] - public string InteractionMessage { get; protected set; } + public string InteractionMessage { get; set; } [Title("실시간 데이터")] [SerializeField] @@ -92,7 +97,8 @@ namespace BlueWater.Tycoons } VisualLook = transform.Find("VisualLook").GetComponent(); - InteractionCanvas = transform.GetComponentInChildren(); + InteractionCanvas = transform.Find("InteractionCanvas").GetComponent(); + LocalizeStringEvent = transform.GetComponent(); CurrentTycoonPlayer = GameManager.Instance.CurrentTycoonPlayer; } @@ -146,5 +152,30 @@ namespace BlueWater.Tycoons { IsOpened = false; } + + protected void UpdateLocalizedString(string entryName) + { + if (!LocalizeStringEvent) return; + + LocalizeStringEvent.StringReference.TableReference = "StringDataTable"; + LocalizeStringEvent.StringReference.TableEntryReference = entryName; + + StartCoroutine(LoadLocalizedString()); + } + + protected IEnumerator LoadLocalizedString() + { + var getLocalizedStringOperation = LocalizeStringEvent.StringReference.GetLocalizedStringAsync(); + yield return getLocalizedStringOperation; + + if (getLocalizedStringOperation.IsDone) + { + InteractionMessage = getLocalizedStringOperation.Result; + } + else + { + Debug.LogError("Failed to load localized string."); + } + } } } \ No newline at end of file diff --git a/Assets/02.Scripts/Prop/Tycoon/MoneyCounter.cs b/Assets/02.Scripts/Prop/Tycoon/MoneyCounter.cs new file mode 100644 index 000000000..8de595bb8 --- /dev/null +++ b/Assets/02.Scripts/Prop/Tycoon/MoneyCounter.cs @@ -0,0 +1,165 @@ + +using System; +using System.Collections; +using BlueWater.Uis; +using BlueWater.Utility; +using Sirenix.OdinInspector; +using UnityEngine; + +namespace BlueWater.Tycoons +{ + [Serializable] + public class MoneyCounter : InteractionFurniture + { + [SerializeField] + private float _playerHoldingTime = 3f; + + [SerializeField] + private PayMoneyUi _payMoneyUiObject; + + [SerializeField] + private Vector3 _offset = new(0f, 1.5f, 0f); + + [SerializeField] + private Sprite _empty; + + [SerializeField] + private Sprite _level1; + + [SerializeField] + private Sprite _level2; + + [SerializeField] + private Sprite _level3; + + [field: Title("실시간 데이터")] + [field: SerializeField] + public int CurrentMoney { get; private set; } + + private SpriteRenderer _spriteRenderer; + private Coroutine _gainAutoInstance; + private bool _isPlayerInteracting; + + protected override void Awake() + { + base.Awake(); + + EventManager.OnAddedMoneyCounter += AddCurrentMoney; + EventManager.OnGainAutoMoneyCounter += GainAuto; + } + + protected override void OnEnable() + { + base.OnEnable(); + + Initialize(); + } + + private void Update() + { + if (IsShowing) + { + EventManager.InvokeHoldInteracting(HoldingElapsedTime); + } + + if (HoldingElapsedTime >= 1f) + { + GainMoney(); + } + + if (_isPlayerInteracting) + { + HoldingElapsedTime += Time.deltaTime / _playerHoldingTime; + } + else + { + if (HoldingElapsedTime > 0f) + { + HoldingElapsedTime -= Time.deltaTime; + } + } + } + + private void OnDestroy() + { + if (_gainAutoInstance != null) + { + StopCoroutine(_gainAutoInstance); + _gainAutoInstance = null; + } + + EventManager.OnAddedMoneyCounter -= AddCurrentMoney; + EventManager.OnGainAutoMoneyCounter -= GainAuto; + } + + public void Initialize() + { + _spriteRenderer = VisualLook.GetComponent(); + } + + public override void Interaction() + { + _isPlayerInteracting = true; + } + + public override void CancelInteraction() + { + _isPlayerInteracting = false; + } + + public override bool CanInteraction() + { + return CurrentMoney > 0 && !GameManager.Instance.CurrentTycoonPlayer.TycoonPickupHandler.IsPickedUpAnything(); + } + + public void AddCurrentMoney(int money) + { + CurrentMoney += money; + + ChangeSprite(); + } + + private void ChangeSprite() + { + var sprite = CurrentMoney switch + { + > 1000 => _level3, + > 500 => _level2, + > 0 => _level1, + _ => _empty + }; + + _spriteRenderer.sprite = sprite; + } + + public void GainMoney() + { + _isPlayerInteracting = false; + HoldingElapsedTime = 0f; + + var payMoneyUi = Instantiate(_payMoneyUiObject, transform.position + _offset, + Quaternion.identity, TycoonUiManager.Instance.WorldCanvas.transform); + payMoneyUi.Initialize(CurrentMoney); + CurrentMoney = 0; + ChangeSprite(); + } + + public void GainAuto(int waitTime) + { + Utils.StartUniqueCoroutine(this, ref _gainAutoInstance, GainAutoCoroutine(waitTime)); + } + + private IEnumerator GainAutoCoroutine(int waitTime) + { + while (true) + { + yield return new WaitForSeconds(waitTime); + + if (CurrentMoney > 0) + { + GainMoney(); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/02.Scripts/Prop/Tycoon/MoneyCounter.cs.meta b/Assets/02.Scripts/Prop/Tycoon/MoneyCounter.cs.meta new file mode 100644 index 000000000..5af1619bc --- /dev/null +++ b/Assets/02.Scripts/Prop/Tycoon/MoneyCounter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9750cc69bc8edf74da6603280ffbb977 diff --git a/Assets/02.Scripts/Prop/Tycoon/ServingTable.cs b/Assets/02.Scripts/Prop/Tycoon/ServingTable.cs index 58e2cef3e..76b9788a1 100644 --- a/Assets/02.Scripts/Prop/Tycoon/ServingTable.cs +++ b/Assets/02.Scripts/Prop/Tycoon/ServingTable.cs @@ -93,7 +93,15 @@ namespace BlueWater.Tycoons public override void ShowInteractionUi() { - InteractionMessage = CurrentPickupItem != null ? "음료 들기" : "음료 내려놓기"; + if (CurrentPickupItem != null) + { + UpdateLocalizedString("InteractionServingTablePickUp"); + } + else + { + UpdateLocalizedString("InteractionServingTablePutDown"); + } + base.ShowInteractionUi(); CocktailGlassImage.material = OutlineMaterial; diff --git a/Assets/02.Scripts/Prop/Tycoon/TableSeat.cs b/Assets/02.Scripts/Prop/Tycoon/TableSeat.cs index 544d69906..99bf567f9 100644 --- a/Assets/02.Scripts/Prop/Tycoon/TableSeat.cs +++ b/Assets/02.Scripts/Prop/Tycoon/TableSeat.cs @@ -90,6 +90,11 @@ namespace BlueWater.Tycoons { if (_isPlayerInteracting) { + if (TycoonManager.Instance.TycoonStatus.CurrentPassiveCard == PassiveCard.CleaningBonus) + { + TycoonManager.Instance.TycoonStageController.CleaningBonus(); + } + var tip = (int)(_currentLevelData.Gold * TycoonManager.Instance.TycoonStatus.TipMultiplier); if (tip > 0) { diff --git a/Assets/02.Scripts/Prop/Tycoon/TrashCan.cs b/Assets/02.Scripts/Prop/Tycoon/TrashCan.cs index be8204ff1..31a84870e 100644 --- a/Assets/02.Scripts/Prop/Tycoon/TrashCan.cs +++ b/Assets/02.Scripts/Prop/Tycoon/TrashCan.cs @@ -1,10 +1,104 @@ using BlueWater.Items; +using UnityEngine; namespace BlueWater.Tycoons { public class TrashCan : InteractionFurniture { + [SerializeField] + private float _playerHoldingTime = 1f; + + [SerializeField] + private bool _canRandomChange; + + private SpriteRenderer _spriteRenderer; + private bool _isPlayerInteracting; + private bool _isRandomChange; + private bool _canInteraction = true; + + protected override void Awake() + { + base.Awake(); + + EventManager.OnSelectedRandomChangeCard += SetRandomChange; + } + + private void Update() + { + if (_isRandomChange) + { + if (InteractionCanvas.BalloonUi.IsWaitTimeOver()) + { + _canInteraction = true; + } + } + + if (IsShowing) + { + EventManager.InvokeHoldInteracting(HoldingElapsedTime); + } + + if (HoldingElapsedTime >= 1f) + { + if (_isRandomChange) + { + ChangeRandomCocktail(); + } + else + { + DiscardItem(); + } + } + + if (_isPlayerInteracting) + { + HoldingElapsedTime += Time.deltaTime / _playerHoldingTime; + } + else + { + if (HoldingElapsedTime > 0f) + { + HoldingElapsedTime -= Time.deltaTime; + } + } + } + + private void OnDestroy() + { + EventManager.OnSelectedRandomChangeCard -= SetRandomChange; + } + public override void Interaction() + { + _isPlayerInteracting = true; + } + + public override void CancelInteraction() + { + _isPlayerInteracting = false; + } + + public override bool CanInteraction() + { + return CurrentTycoonPlayer.TycoonPickupHandler.IsPickedUpAnything() && + (_isRandomChange && _canInteraction || !_isRandomChange); + } + + public override void ShowInteractionUi() + { + if (_isRandomChange) + { + UpdateLocalizedString("InteractionTrashCanChange"); + } + else + { + UpdateLocalizedString("InteractionTrashCanDiscard"); + } + + base.ShowInteractionUi(); + } + + private void DiscardItem() { CocktailData discardCocktailData = null; if (!CurrentTycoonPlayer.TycoonPickupHandler.IsUnfinishedCocktailPickedUp) @@ -14,11 +108,28 @@ namespace BlueWater.Tycoons } EventManager.InvokeCocktailDiscarded(discardCocktailData, true); + + HoldingElapsedTime = 0f; + _isPlayerInteracting = false; } - - public override bool CanInteraction() + + private void ChangeRandomCocktail() { - return CurrentTycoonPlayer.TycoonPickupHandler.IsPickedUpAnything(); + var randomCocktail = TycoonManager.Instance.TycoonIngredientController.GetRandomCocktailData(); + EventManager.InvokeChangedRandomCocktail(randomCocktail); + InteractionCanvas.BalloonUi.OrderItem(DataManager.Instance.SpriteDataSo.Waiting, 0, + TycoonManager.Instance.TycoonStageController.StageDataSo.RandomChangeWaitTime); + + HoldingElapsedTime = 0f; + _canInteraction = false; + _isPlayerInteracting = false; + } + + private void SetRandomChange() + { + if (!_canRandomChange) return; + + _isRandomChange = true; } } } \ No newline at end of file diff --git a/Assets/02.Scripts/ScriptableObject/CardDataTable.asset b/Assets/02.Scripts/ScriptableObject/CardDataTable.asset index 90a56ddba..75a6f2e70 100644 --- a/Assets/02.Scripts/ScriptableObject/CardDataTable.asset +++ b/Assets/02.Scripts/ScriptableObject/CardDataTable.asset @@ -16,7 +16,7 @@ MonoBehaviour: - k__BackingField: HeartSlotPlus k__BackingField: k__BackingField: HeartSlotPlus - k__BackingField: "\uD558\uD2B8 \uD55C\uCE78 \uCD94\uAC00" + k__BackingField: "\uD558\uD2B8 \uD55C\uCE78\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 3 k__BackingField: 5 k__BackingField: 0 @@ -26,7 +26,7 @@ MonoBehaviour: - k__BackingField: HeartRecovery k__BackingField: k__BackingField: HeartRecovery - k__BackingField: "\uD558\uD2B8 \uD55C\uCE78 \uD68C\uBCF5" + k__BackingField: "\uD558\uD2B8 \uD55C\uCE78\uC744 \uD68C\uBCF5\uD569\uB2C8\uB2E4." k__BackingField: 10 k__BackingField: 0 k__BackingField: 0 @@ -36,7 +36,7 @@ MonoBehaviour: - k__BackingField: FullHeartRecovery k__BackingField: k__BackingField: FullHeartRecovery - k__BackingField: "\uD558\uD2B8 \uC804\uCCB4 \uD68C\uBCF5" + k__BackingField: "\uD558\uD2B8 \uC804\uCCB4\uB97C \uD68C\uBCF5\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 5 k__BackingField: 0 @@ -46,7 +46,7 @@ MonoBehaviour: - k__BackingField: AddLiquidB k__BackingField: k__BackingField: AddLiquidB - k__BackingField: "B \uC220\uC744 4000ml \uCD94\uAC00" + k__BackingField: "B\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -56,7 +56,7 @@ MonoBehaviour: - k__BackingField: AddLiquidC k__BackingField: k__BackingField: AddLiquidC - k__BackingField: "C \uC220\uC744 4000ml \uCD94\uAC00" + k__BackingField: "C\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -66,7 +66,7 @@ MonoBehaviour: - k__BackingField: AddLiquidD k__BackingField: k__BackingField: AddLiquidD - k__BackingField: "D \uC220\uC744 4000ml \uCD94\uAC00" + k__BackingField: "D\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -76,7 +76,7 @@ MonoBehaviour: - k__BackingField: AddLiquidE k__BackingField: k__BackingField: AddLiquidE - k__BackingField: "E \uC220\uC744 4000ml \uCD94\uAC00" + k__BackingField: "E\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -86,7 +86,8 @@ MonoBehaviour: - k__BackingField: AddGarnish1 k__BackingField: k__BackingField: AddGarnish1 - k__BackingField: "1\uBC88 \uAC00\uB2C8\uC26C\uB97C 4000ml \uCD94\uAC00" + k__BackingField: "1\uBC88 \uAC00\uB2C8\uC26C \uC7AC\uB8CC\uB97C + 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -96,7 +97,8 @@ MonoBehaviour: - k__BackingField: AddGarnish2 k__BackingField: k__BackingField: AddGarnish2 - k__BackingField: "2\uBC88 \uAC00\uB2C8\uC26C\uB97C 4000ml \uCD94\uAC00" + k__BackingField: "2\uBC88 \uAC00\uB2C8\uC26C \uC7AC\uB8CC\uB97C + 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -106,7 +108,7 @@ MonoBehaviour: - k__BackingField: AllLiquidAdd k__BackingField: k__BackingField: AllLiquidAdd - k__BackingField: "\uC804\uCCB4 \uC7AC\uB8CC 1000ml \uCD94\uAC00" + k__BackingField: "\uBAA8\uB4E0 \uC220 \uC7AC\uB8CC 1000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 5 k__BackingField: 0 @@ -116,7 +118,7 @@ MonoBehaviour: - k__BackingField: ServerNpcAdd k__BackingField: k__BackingField: ServerNpcAdd - k__BackingField: "\uC11C\uBE59 \uC885\uC5C5\uC6D0 \uCD94\uAC00" + k__BackingField: "\uC11C\uBE59 \uC885\uC5C5\uC6D0\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 5 k__BackingField: 0 @@ -126,7 +128,7 @@ MonoBehaviour: - k__BackingField: CleanerNpcAdd k__BackingField: k__BackingField: CleanerNpcAdd - k__BackingField: "\uCCAD\uC18C \uC885\uC5C5\uC6D0 \uCD94\uAC00" + k__BackingField: "\uCCAD\uC18C \uC885\uC5C5\uC6D0\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 5 k__BackingField: 0 @@ -136,7 +138,7 @@ MonoBehaviour: - k__BackingField: BartenderNpcAdd k__BackingField: k__BackingField: BartenderNpcAdd - k__BackingField: "\uBC14\uD150\uD130 \uC885\uC5C5\uC6D0 \uCD94\uAC00" + k__BackingField: "\uBC14\uD150\uD130 \uC885\uC5C5\uC6D0\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 6 k__BackingField: 5 k__BackingField: 0 @@ -146,8 +148,8 @@ MonoBehaviour: - k__BackingField: SpeedBoost k__BackingField: k__BackingField: SpeedBoost - k__BackingField: "\uD50C\uB808\uC774\uC5B4 \uC774\uB3D9 \uC18D\uB3C4 - 10% \uC99D\uAC00" + k__BackingField: "\uD50C\uB808\uC774\uC5B4\uC758 \uC774\uB3D9\uC18D\uB3C4\uAC00 + 10% \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 10 k__BackingField: 5 k__BackingField: 0 @@ -157,7 +159,8 @@ MonoBehaviour: - k__BackingField: ExpBoost k__BackingField: k__BackingField: ExpBoost - k__BackingField: "\uACBD\uD5D8\uCE58 \uD68D\uB4DD 20% \uC99D\uAC00" + k__BackingField: "\uACBD\uD5D8\uCE58 \uD68D\uB4DD\uB7C9\uC774 20% + \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 10 k__BackingField: 4 k__BackingField: 0 @@ -167,7 +170,7 @@ MonoBehaviour: - k__BackingField: GoldBoost k__BackingField: k__BackingField: GoldBoost - k__BackingField: "\uACE8\uB4DC \uD68D\uB4DD 20% \uC99D\uAC00" + k__BackingField: "\uACE8\uB4DC \uD68D\uB4DD 20%\uC774 \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 10 k__BackingField: 4 k__BackingField: 0 @@ -177,7 +180,7 @@ MonoBehaviour: - k__BackingField: AllCleanUp k__BackingField: k__BackingField: AllCleanUp - k__BackingField: "\uB808\uC2A4\uD1A0\uB791 \uD55C\uBC88\uC5D0 \uCCAD\uC18C" + k__BackingField: "\uB808\uC2A4\uD1A0\uB791\uC744 \uC804\uBD80 \uCCAD\uC18C\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 4 k__BackingField: 0 @@ -188,7 +191,7 @@ MonoBehaviour: k__BackingField: k__BackingField: GaugeReset k__BackingField: "\uBAA8\uB4E0 \uC190\uB2D8\uB4E4\uC758 \uAE30\uB2E4\uB9BC - \uCD08\uAE30\uD654" + \uAC8C\uC774\uC9C0\uB97C \uCD08\uAE30\uD654\uD569\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 @@ -198,7 +201,8 @@ MonoBehaviour: - k__BackingField: DashCooldownReduction k__BackingField: k__BackingField: DashCooldownReduction - k__BackingField: "\uB300\uC2DC \uCFE8\uD0C0\uC784 \uAC10\uC18C" + k__BackingField: "\uD50C\uB808\uC774\uC5B4\uC758 \uB300\uC2DC \uCFE8\uD0C0\uC784\uC774 + 1\uCD08 \uAC10\uC18C\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 4 k__BackingField: 0 @@ -208,7 +212,7 @@ MonoBehaviour: - k__BackingField: TipBoost k__BackingField: k__BackingField: TipBoost - k__BackingField: "\uD301 \uD68D\uB4DD\uB7C9 20% \uC99D\uAC00" + k__BackingField: "\uD301 \uD68D\uB4DD\uB7C9\uC774 20% \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 4 k__BackingField: 0 @@ -218,8 +222,8 @@ MonoBehaviour: - k__BackingField: EndGoldBoost k__BackingField: k__BackingField: EndGoldBoost - k__BackingField: "\uAC8C\uC784 \uC624\uBC84 \uD6C4 \uD68D\uB4DD - \uACE8\uB4DC 10% \uC99D\uAC00" + k__BackingField: "\uAC8C\uC784\uC624\uBC84 \uD6C4 \uD68D\uB4DD + \uACE8\uB4DC\uB7C9\uC774 10% \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 10 k__BackingField: 4 k__BackingField: 0 @@ -229,7 +233,7 @@ MonoBehaviour: - k__BackingField: AllCustomerPurification k__BackingField: k__BackingField: AllCustomerPurification - k__BackingField: "\uC190\uB2D8\uB4E4 \uC804\uBD80 \uC815\uD654" + k__BackingField: "\uC190\uB2D8\uB4E4\uC744 \uC804\uBD80 \uC815\uD654\uC2DC\uD0B5\uB2C8\uB2E4." k__BackingField: 0 k__BackingField: 4 k__BackingField: 0 @@ -239,8 +243,8 @@ MonoBehaviour: - k__BackingField: GaugeTimeUp k__BackingField: k__BackingField: GaugeTimeUp - k__BackingField: "\uC190\uB2D8\uB4E4\uC758 \uAE30\uB2E4\uB9BC \uC2DC\uAC04 - 3\uCD08 \uC99D\uAC00" + k__BackingField: "\uC190\uB2D8\uB4E4\uC758 \uAE30\uB2E4\uB9BC \uC2DC\uAC04\uC774 + 3\uCD08 \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 5 k__BackingField: 0 @@ -250,8 +254,8 @@ MonoBehaviour: - k__BackingField: ServerNpcUpgrade k__BackingField: k__BackingField: ServerNpcUpgrade - k__BackingField: "\uC11C\uBE59 \uC885\uC5C5\uC6D0 \uC5C5\uADF8\uB808\uC774\uB4DC - (\uD301 \uD68D\uB4DD \uBE44\uC728 \uC99D\uAC00)" + k__BackingField: "\uC885\uC5C5\uC6D0\uC774 \uC11C\uBE59 \uC911 + \uD301 \uD68D\uB4DD\uB7C9\uC774 20% \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 5 k__BackingField: 0 @@ -261,8 +265,8 @@ MonoBehaviour: - k__BackingField: CleanerNpcUpgrade k__BackingField: k__BackingField: CleanerNpcUpgrade - k__BackingField: "\uCCAD\uC18C \uC885\uC5C5\uC6D0 \uC5C5\uADF8\uB808\uC774\uB4DC - (\uCCAD\uC18C \uC18D\uB3C4 \uC99D\uAC00)" + k__BackingField: "\uC885\uC5C5\uC6D0\uC758 \uCCAD\uC18C \uC2DC\uAC04\uC774 + 1\uCD08 \uAC10\uC18C\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 5 k__BackingField: 0 @@ -272,41 +276,20 @@ MonoBehaviour: - k__BackingField: BartenderNpcUpgrade k__BackingField: k__BackingField: BartenderNpcUpgrade - k__BackingField: "\uBC14\uD150\uD130 \uC885\uC5C5\uC6D0 \uC5C5\uADF8\uB808\uC774\uB4DC - (\uC220 \uC81C\uC870 \uC18D\uB3C4 \uC99D\uAC00)" + k__BackingField: "\uC885\uC5C5\uC6D0\uC758 \uC220 \uC81C\uC870 + \uC18D\uB3C4\uAC00 1\uCD08 \uAC10\uC18C\uD569\uB2C8\uB2E4." k__BackingField: 5 k__BackingField: 5 k__BackingField: 0 k__BackingField: 1 k__BackingField: 300 k__BackingField: {fileID: 0} - - k__BackingField: DoubleServing - k__BackingField: - k__BackingField: DoubleServing - k__BackingField: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC591\uC190\uC5D0 - \uC11C\uBE59 \uAC00\uB2A5" - k__BackingField: 1 - k__BackingField: 2 - k__BackingField: 1 - k__BackingField: 1 - k__BackingField: 1000 - k__BackingField: {fileID: 0} - - k__BackingField: RandomChange - k__BackingField: - k__BackingField: RandomChange - k__BackingField: "\uD734\uC9C0\uD1B5\uC744 \uB79C\uB364 \uC81C\uC870\uD1B5\uC73C\uB85C - \uBCC0\uACBD" - k__BackingField: 1 - k__BackingField: 2 - k__BackingField: 1 - k__BackingField: 1 - k__BackingField: 1000 - k__BackingField: {fileID: 0} - k__BackingField: PassiveMakingBonus k__BackingField: k__BackingField: PassiveMakingBonus - k__BackingField: "\uC220 \uC81C\uC870 \uC131\uACF5 \uC2DC \uACE8\uB4DC - \uCD94\uAC00 \uD68D\uB4DD" + k__BackingField: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC220 \uC81C\uC870 + \uC131\uACF5 \uC2DC \uD301 \uD68D\uB4DD\uB7C9\uB9CC\uD07C \uCD94\uAC00\uB85C + \uACE8\uB4DC\uB97C \uD68D\uB4DD\uD569\uB2C8\uB2E4." k__BackingField: 1 k__BackingField: 2 k__BackingField: 1 @@ -316,8 +299,9 @@ MonoBehaviour: - k__BackingField: PassiveServingBonus k__BackingField: k__BackingField: PassiveServingBonus - k__BackingField: "\uC11C\uBE59 3\uBC88 \uC131\uACF5 \uC2DC \uD558\uD2B8 - \uBC18\uAC1C \uD68C\uBCF5" + k__BackingField: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC11C\uBE59\uC744 + 3\uBC88 \uC131\uACF5\uD560 \uB54C\uB9C8\uB2E4 \uD558\uD2B8\uB97C \uBC18 \uAC1C + \uD68C\uBCF5\uD569\uB2C8\uB2E4." k__BackingField: 1 k__BackingField: 2 k__BackingField: 1 @@ -327,8 +311,10 @@ MonoBehaviour: - k__BackingField: PassiveCleaningBonus k__BackingField: k__BackingField: PassiveCleaningBonus - k__BackingField: "\uCCAD\uC18C 5\uBC88 \uC131\uACF5 \uC2DC \uBC14\uD150\uB354 - \uC81C\uC870 \uC18D\uB3C4 \uC99D\uAC00" + k__BackingField: "\uD50C\uB808\uC774\uC5B4\uAC00 \uCCAD\uC18C\uB97C + 5\uBC88 \uC131\uACF5\uD560 \uB54C\uB9C8\uB2E4 \uC0C8\uB85C \uC81C\uC791\uB418\uB294 + \uC885\uC5C5\uC6D0\uC758 \uC220 \uC81C\uC870 \uC18D\uB3C4\uB97C 10\uCD08\uAC04 + 2\uBC30\uB85C \uC99D\uAC00\uD569\uB2C8\uB2E4." k__BackingField: 1 k__BackingField: 2 k__BackingField: 1 @@ -338,19 +324,41 @@ MonoBehaviour: - k__BackingField: BarrelAutoSupply k__BackingField: k__BackingField: BarrelAutoSupply - k__BackingField: "\uBAA8\uB4E0 \uC220 \uC7AC\uB8CC \uC790\uB3D9 - \uCDA9\uCC9C (1\uCD08\uC5D0 N\uB9AC\uD130)" + k__BackingField: "\uBAA8\uB4E0 \uC220 \uC7AC\uB8CC\uB97C \uCD08\uB2F9 + 2ml \uCD94\uAC00\uB85C \uC790\uB3D9 \uCDA9\uC804\uD569\uB2C8\uB2E4." k__BackingField: 10 k__BackingField: 5 k__BackingField: 0 k__BackingField: 1 k__BackingField: 1500 k__BackingField: {fileID: 0} - - k__BackingField: GoldAutoGain + - k__BackingField: PassiveDoubleServing k__BackingField: - k__BackingField: GoldAutoGain + k__BackingField: PassiveDoubleServing + k__BackingField: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC591\uC190\uC5D0 + \uC11C\uBE59\uC774 \uAC00\uB2A5\uD574\uC9D1\uB2C8\uB2E4." + k__BackingField: 1 + k__BackingField: 2 + k__BackingField: 1 + k__BackingField: 1 + k__BackingField: 1000 + k__BackingField: {fileID: 0} + - k__BackingField: PassiveRandomChange + k__BackingField: + k__BackingField: PassiveRandomChange + k__BackingField: "\uD2B9\uC815 \uD734\uC9C0\uD1B5\uC5D0\uC11C \uC644\uC131\uB41C + \uCE75\uD14C\uC77C \uC911 \uB79C\uB364\uC73C\uB85C \uBCC0\uACBD \uAC00\uB2A5\uD574\uC9D1\uB2C8\uB2E4." + k__BackingField: 1 + k__BackingField: 2 + k__BackingField: 1 + k__BackingField: 1 + k__BackingField: 1000 + k__BackingField: {fileID: 0} + - k__BackingField: PassiveGoldAutoGain + k__BackingField: + k__BackingField: PassiveGoldAutoGain k__BackingField: "\uC790\uB3D9\uC73C\uB85C 60\uCD08\uB9C8\uB2E4 - \uB3C8\uD1B5\uC758 \uACE8\uB4DC \uD68C\uC218" + \uACC4\uC0B0\uB300\uC758 \uACE8\uB4DC\uB97C \uD68C\uC218\uD569\uB2C8\uB2E4." k__BackingField: 1 k__BackingField: 2 k__BackingField: 1 diff --git a/Assets/02.Scripts/ScriptableObject/SpriteData.asset b/Assets/02.Scripts/ScriptableObject/SpriteData.asset index 5d6188320..9dc39c092 100644 --- a/Assets/02.Scripts/ScriptableObject/SpriteData.asset +++ b/Assets/02.Scripts/ScriptableObject/SpriteData.asset @@ -18,3 +18,4 @@ MonoBehaviour: k__BackingField: {fileID: 21300000, guid: c0cab5e7cc9fc5147b3f0aef86b2feab, type: 3} k__BackingField: {fileID: 21300000, guid: 9e508ffd6f8853c4c8b20b63ad90622d, type: 3} k__BackingField: {fileID: 21300000, guid: e9275315ca60c1f479efa8f9393c7627, type: 3} + k__BackingField: {fileID: 21300000, guid: 1d6e6fd96eb499f42b79f04f3510af87, type: 3} diff --git a/Assets/02.Scripts/SpriteDataSo.cs b/Assets/02.Scripts/SpriteDataSo.cs index bf018fecc..112aa150d 100644 --- a/Assets/02.Scripts/SpriteDataSo.cs +++ b/Assets/02.Scripts/SpriteDataSo.cs @@ -22,5 +22,8 @@ namespace BlueWater [field: SerializeField] public Sprite BartenderTable { get; private set; } + + [field: SerializeField] + public Sprite Waiting { get; private set; } } } \ No newline at end of file diff --git a/Assets/02.Scripts/Tycoon/Liquid.cs b/Assets/02.Scripts/Tycoon/Liquid.cs index a88c220fc..cf4407ab6 100644 --- a/Assets/02.Scripts/Tycoon/Liquid.cs +++ b/Assets/02.Scripts/Tycoon/Liquid.cs @@ -5,6 +5,9 @@ namespace BlueWater.Tycoons { public class Liquid : LiquidIngredient { + [SerializeField] + private float _autoDestroyTime = 2f; + private IObjectPool _managedPool; public void Initialize(Vector3 spawnPosition, Quaternion rotation, Collider2D targetCollider, Vector3 pushForce, Color color) @@ -18,13 +21,22 @@ namespace BlueWater.Tycoons CanInteraction = true; gameObject.SetActive(true); Rigidbody2D.AddForce(pushForce, ForceMode2D.Impulse); + + Invoke(nameof(ReachedObject), _autoDestroyTime); } public void SetManagedPool(IObjectPool pool) => _managedPool = pool; - public void Destroy() => _managedPool.Release(this); + + public void Destroy() + { + CancelInvoke(nameof(ReachedObject)); + _managedPool.Release(this); + } public override void ReachedObject() { + base.ReachedObject(); + CanInteraction = false; Destroy(); } diff --git a/Assets/02.Scripts/Tycoon/LiquidController.cs b/Assets/02.Scripts/Tycoon/LiquidController.cs index 61a5a45f4..b89318b14 100644 --- a/Assets/02.Scripts/Tycoon/LiquidController.cs +++ b/Assets/02.Scripts/Tycoon/LiquidController.cs @@ -154,6 +154,7 @@ namespace BlueWater EventManager.OnCocktailDiscarded += ReleaseAllObject; EventManager.OnPlaceOnServingTable += ReleaseAllObject; EventManager.OnCocktailServedToCustomer += ReleaseAllObject; + EventManager.OnChangedRandomCocktail += ReleaseAllObject; LiquidIngredient.OnReachedTarget += OnTargetReached; Barrel.OnBarrelInteracted += HandleBarrelInteraction; Barrel.OnBarrelCancelInteracted += HandleBarrelCancelInteraction; @@ -228,6 +229,7 @@ namespace BlueWater EventManager.OnCocktailDiscarded -= ReleaseAllObject; EventManager.OnPlaceOnServingTable -= ReleaseAllObject; EventManager.OnCocktailServedToCustomer -= ReleaseAllObject; + EventManager.OnChangedRandomCocktail -= ReleaseAllObject; LiquidIngredient.OnReachedTarget -= OnTargetReached; Barrel.OnBarrelInteracted -= HandleBarrelInteraction; Barrel.OnBarrelCancelInteracted -= HandleBarrelCancelInteraction; @@ -318,22 +320,16 @@ namespace BlueWater HidePanel(); } + public void ReleaseAllObject(CocktailData cocktailData) + { + ReleaseAllObject(); + } + public void ReleaseAllObject(CocktailData cocktailData, bool isServedPlayer) { if (!isServedPlayer) return; - // 리스트 삭제는 뒤에서부터 해야 오류가 없음 - for (var i = _activeLiquidDatas.Count - 1; i >= 0; i--) - { - _activeLiquidDatas[i].Destroy(); - } - - _liquidDataCounts.Clear(); - _isCompleted = false; - _instanceLiquidCount = 0; - _instanceMaterial.SetFloat(LiquidAmountHash, 0f); - SetCurrentAmount(0f); - HidePanel(); + ReleaseAllObject(); } public void HandleBarrelInteraction(Barrel barrel) diff --git a/Assets/02.Scripts/Tycoon/LiquidIngredient.cs b/Assets/02.Scripts/Tycoon/LiquidIngredient.cs index 92ce5d594..beb54bdd9 100644 --- a/Assets/02.Scripts/Tycoon/LiquidIngredient.cs +++ b/Assets/02.Scripts/Tycoon/LiquidIngredient.cs @@ -31,11 +31,13 @@ namespace BlueWater.Tycoons if (distance < _distanceThreshold) { - OnReachedTarget?.Invoke(); ReachedObject(); } } - - public abstract void ReachedObject(); + + public virtual void ReachedObject() + { + OnReachedTarget?.Invoke(); + } } } \ No newline at end of file diff --git a/Assets/02.Scripts/Tycoon/StageDataSo.cs b/Assets/02.Scripts/Tycoon/StageDataSo.cs index b9dff8497..7933a4163 100644 --- a/Assets/02.Scripts/Tycoon/StageDataSo.cs +++ b/Assets/02.Scripts/Tycoon/StageDataSo.cs @@ -22,5 +22,23 @@ namespace BlueWater.Tycoons [field: SerializeField] public int MushroomWaitTime { get; private set; } = 30; + + [field: SerializeField] + public int ServingBonusCount { get; private set; } = 3; + + [field: SerializeField] + public int CleaningBonusCount { get; private set; } = 5; + + [field: SerializeField] + public int CleaningBonusMakingSpeedUpTime { get; private set; } = 10; + + [field: SerializeField] + public float CleaningBonusMakingSpeedMultiply { get; private set; } = 2f; + + [field: SerializeField] + public int AutoGainWaitTime { get; private set; } = 60; + + [field: SerializeField] + public int RandomChangeWaitTime { get; private set; } = 5; } } \ No newline at end of file diff --git a/Assets/02.Scripts/Tycoon/TycoonStageController.cs b/Assets/02.Scripts/Tycoon/TycoonStageController.cs index 57c546f15..7cbd8e98a 100644 --- a/Assets/02.Scripts/Tycoon/TycoonStageController.cs +++ b/Assets/02.Scripts/Tycoon/TycoonStageController.cs @@ -19,16 +19,21 @@ namespace BlueWater.Tycoons public Dictionary InstanceCocktailDatas { get; private set; } = new(); public static int VomitCount; + public int PlayerServingCount; + public int PlayerCleaningCount; private bool _isClosedTime; private TycoonManager _tycoonManager; - private AstarPath _astarPath; private Coroutine _startStageCoroutineInstance; private TimeSpan _closedTime; private void Awake() { - _astarPath = FindAnyObjectByType(); + EventManager.OnInitializedPlayerInput += StartStage; + EventManager.OnMakeCocktailCompleted += AddInstanceCocktail; + EventManager.OnCocktailServedToCustomer += RemoveInstanceCocktail; + EventManager.OnCocktailDiscarded += RemoveInstanceCocktail; + EventManager.OnCreateMushroom += CreateMushroom; } private void Start() @@ -36,12 +41,8 @@ namespace BlueWater.Tycoons _tycoonManager = TycoonManager.Instance; VomitCount = 0; - - EventManager.OnInitializedPlayerInput += StartStage; - EventManager.OnMakeCocktailCompleted += AddInstanceCocktail; - EventManager.OnCocktailServedToCustomer += RemoveInstanceCocktail; - EventManager.OnCocktailDiscarded += RemoveInstanceCocktail; - EventManager.OnCreateMushroom += CreateMushroom; + PlayerServingCount = 0; + PlayerCleaningCount = 0; } private void OnDestroy() @@ -124,5 +125,25 @@ namespace BlueWater.Tycoons var mushroom = Instantiate(_mushroomObject, spawnPosition, _mushroomObject.transform.rotation); mushroom.Initialize(); } + + public void ServingBonus() + { + PlayerServingCount++; + + if (PlayerServingCount < StageDataSo.ServingBonusCount) return; + + PlayerServingCount = 0; + TycoonManager.Instance.TycoonStatus.CurrentPlayerHealth++; + } + + public void CleaningBonus() + { + PlayerCleaningCount++; + + if (PlayerCleaningCount < StageDataSo.CleaningBonusCount) return; + + PlayerCleaningCount = 0; + EventManager.InvokeCleaningBonus(StageDataSo.CleaningBonusMakingSpeedUpTime, StageDataSo.CleaningBonusMakingSpeedMultiply); + } } } \ No newline at end of file diff --git a/Assets/02.Scripts/Tycoon/TycoonStatus.cs b/Assets/02.Scripts/Tycoon/TycoonStatus.cs index b3ef3627f..f32f70bda 100644 --- a/Assets/02.Scripts/Tycoon/TycoonStatus.cs +++ b/Assets/02.Scripts/Tycoon/TycoonStatus.cs @@ -11,9 +11,9 @@ namespace BlueWater.Tycoons DoubleServing = 1, RandomChange = 2, GoldAutoGain = 3, - PassiveMakingBonus = 4, - PassiveServingBonus = 5, - PassiveCleaningBonus = 6 + MakingBonus = 4, + ServingBonus = 5, + CleaningBonus = 6 } [Serializable] diff --git a/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs b/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs index d66d28cba..268858ec5 100644 --- a/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs +++ b/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs @@ -89,7 +89,7 @@ namespace BlueWater.Uis SetEmpty(); } - public void OrderItem(string itemIdx, int waitTime, int hurryTime) + public void OrderItem(string itemIdx, float waitTime, float hurryTime) { _orderCocktailData = ItemManager.Instance.CocktailDataSo.GetDataByIdx(itemIdx); _isOrdered = true; @@ -100,7 +100,7 @@ namespace BlueWater.Uis SetTween(waitTime, hurryTime); } - public void OrderItem(Sprite sprite, int waitTime, int hurryTime) + public void OrderItem(Sprite sprite, float waitTime, float hurryTime) { _isOrdered = true; _isWaitTimeOver = false; @@ -111,7 +111,7 @@ namespace BlueWater.Uis SetTween(waitTime, hurryTime); } - public void SetTween(int waitTime, int hurryTime) + public void SetTween(float waitTime, float hurryTime) { _tween?.Kill(); _tween = _fillImage.DOFillAmount(1f, hurryTime) diff --git a/Assets/02.Scripts/Ui/Tycoon/TycoonCard.cs b/Assets/02.Scripts/Ui/Tycoon/TycoonCard.cs index 167b78a33..7d59ec363 100644 --- a/Assets/02.Scripts/Ui/Tycoon/TycoonCard.cs +++ b/Assets/02.Scripts/Ui/Tycoon/TycoonCard.cs @@ -3,10 +3,14 @@ using System.Collections; using BlueWater; using BlueWater.Tycoons; using BlueWater.Uis; +using BlueWater.Utility; using Sirenix.OdinInspector; using UnityEngine; using TMPro; using UnityEngine.EventSystems; +using UnityEngine.Localization; +using UnityEngine.Localization.Settings; +using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.Serialization; using UnityEngine.UI; using Object = UnityEngine.Object; @@ -14,9 +18,10 @@ using Object = UnityEngine.Object; public class TycoonCard : MonoBehaviour { private TycoonSelectCard _selectCardUi; - - [field: Title("카드 속성")] - + + [Title("카드 속성")] + [SerializeField] + private TMP_Text _informationText; internal CardData CardDataForIdx; //[field: SerializeField, CLabel("IDX"), ReadOnly] //private string _cardData = "AddAllLiquid"; @@ -49,6 +54,7 @@ public class TycoonCard : MonoBehaviour private RectTransform _rectTransform; private Transform _cardComTransform; private TycoonCardArea _cardArea; + private Coroutine _changedLocaleInstance; private void Awake() { @@ -59,9 +65,9 @@ public class TycoonCard : MonoBehaviour _cardArea = transform.Find("Area").GetComponent(); } - void Start() + private void Start() { - + LocalizationSettings.SelectedLocaleChanged += OnChangedLocale; } private void Update() @@ -70,15 +76,35 @@ public class TycoonCard : MonoBehaviour //카메라 기준 캐릭터의 위치를 가져옴 } + private void OnDestroy() + { + LocalizationSettings.SelectedLocaleChanged -= OnChangedLocale; + } + + private void OnChangedLocale(Locale locale) + { + Utils.StartUniqueCoroutine(this, ref _changedLocaleInstance, ChangeLocaleCoroutine(locale)); + StartCoroutine(ChangeLocaleCoroutine(locale)); + } + + private IEnumerator ChangeLocaleCoroutine(Locale locale) + { + var loadingOperation = Utils.GetTableAsync(); + yield return loadingOperation; + + if (loadingOperation.Status == AsyncOperationStatus.Succeeded) + { + var table = loadingOperation.Result; + var textValue = table.GetEntry(CardDataForIdx.Idx)?.GetLocalizedString(); + _informationText.text = textValue; + } + } + //지정된 IDX값으로 정보값 초기화 public void SetCard(string cardIdx) { CardDataForIdx = TycoonManager.Instance.CardDataSo.GetDataByIdx(cardIdx); - - Transform infoTransform = transform.Find("CardCom/Infomation"); - TextMeshProUGUI infotextComponent = infoTransform.GetComponent(); - infotextComponent.text = CardDataForIdx.ScriptText; - + _informationText.text = Utils.GetLocalizedString(cardIdx); _image.sprite = CardDataForIdx.Sprite; } diff --git a/Assets/02.Scripts/Ui/Tycoon/TycoonSelectCard.cs b/Assets/02.Scripts/Ui/Tycoon/TycoonSelectCard.cs index 1452563b7..87b0dd7f0 100644 --- a/Assets/02.Scripts/Ui/Tycoon/TycoonSelectCard.cs +++ b/Assets/02.Scripts/Ui/Tycoon/TycoonSelectCard.cs @@ -33,7 +33,6 @@ namespace BlueWater.Uis [field: SerializeField, CLabel("업그레이드_스크립트")] private GameObject _upgradePopup; - private void Awake() { EventManager.OnLevelUp += CreateCardEvent; @@ -254,7 +253,7 @@ namespace BlueWater.Uis { EventManager.InvokeAutoSupplyBarrels(); } - _tycoonStatus.BarrelAutoIncrease += 5; + _tycoonStatus.BarrelAutoIncrease += 2; break; case "ServerNpcUpgrade": _tycoonStatus.ServerTipMultiplier += 0.1f; @@ -265,23 +264,25 @@ namespace BlueWater.Uis case "BartenderNpcUpgrade": _tycoonStatus.BartenderMakingReduction += 1; break; - case "DoubleServing": + case "PassiveDoubleServing": _tycoonStatus.CurrentPassiveCard = PassiveCard.DoubleServing; break; - case "RandomChange": + case "PassiveRandomChange": _tycoonStatus.CurrentPassiveCard = PassiveCard.RandomChange; + EventManager.InvokeChangeRandomCard(); break; - case "GoldAutoGain": + case "PassiveGoldAutoGain": _tycoonStatus.CurrentPassiveCard = PassiveCard.GoldAutoGain; + EventManager.InvokeGainAutoMoneyCounter(_tycoonManager.TycoonStageController.StageDataSo.AutoGainWaitTime); break; case "PassiveMakingBonus": - _tycoonStatus.CurrentPassiveCard = PassiveCard.PassiveMakingBonus; + _tycoonStatus.CurrentPassiveCard = PassiveCard.MakingBonus; break; case "PassiveServingBonus": - _tycoonStatus.CurrentPassiveCard = PassiveCard.PassiveServingBonus; + _tycoonStatus.CurrentPassiveCard = PassiveCard.ServingBonus; break; case "PassiveCleaningBonus": - _tycoonStatus.CurrentPassiveCard = PassiveCard.PassiveCleaningBonus; + _tycoonStatus.CurrentPassiveCard = PassiveCard.CleaningBonus; break; default: Debug.Log("Not Found Card : IDX" + currTycoonCard.CardDataForIdx.Idx); return; } diff --git a/Assets/02.Scripts/Ui/Tycoon/Upgrade_Popup.cs b/Assets/02.Scripts/Ui/Tycoon/Upgrade_Popup.cs index 9ac75a3cf..1cdb54137 100644 --- a/Assets/02.Scripts/Ui/Tycoon/Upgrade_Popup.cs +++ b/Assets/02.Scripts/Ui/Tycoon/Upgrade_Popup.cs @@ -55,13 +55,12 @@ public class Upgrade_Popup : PopupUi { switch (int.Parse(currentLevelData.Idx)) { - case 5:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidA").Sprite; break; - case 10:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidB").Sprite; break; - case 15:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidC").Sprite; break; - case 20:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidD").Sprite; break; - case 25:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidE").Sprite; break; - case 30:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("Garnish1").Sprite; break; - case 35:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("Garnish2").Sprite; break; + case 5:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidB").Sprite; break; + case 10:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidC").Sprite; break; + case 15:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidD").Sprite; break; + case 20:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("LiquidE").Sprite; break; + case 25:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("Garnish1").Sprite; break; + case 30:liqueurImage.sprite = ItemManager.Instance.LiquidDataSo.GetDataByIdx("Garnish2").Sprite; break; } diff --git a/Assets/02.Scripts/Utility/Utils.cs b/Assets/02.Scripts/Utility/Utils.cs index 6a3479a91..065b3f358 100644 --- a/Assets/02.Scripts/Utility/Utils.cs +++ b/Assets/02.Scripts/Utility/Utils.cs @@ -3,6 +3,9 @@ using System.Collections; using System.Collections.Generic; using Pathfinding; using UnityEngine; +using UnityEngine.Localization.Settings; +using UnityEngine.Localization.Tables; +using UnityEngine.ResourceManagement.AsyncOperations; using Random = UnityEngine.Random; namespace BlueWater.Utility @@ -90,5 +93,15 @@ namespace BlueWater.Utility // 선택한 노드의 위치 반환 return (Vector3)randomNode.position; } + + public static string GetLocalizedString(string key) + { + return LocalizationSettings.StringDatabase.GetLocalizedString("StringDataTable", key, LocalizationSettings.SelectedLocale); + } + + public static AsyncOperationHandle GetTableAsync() + { + return LocalizationSettings.StringDatabase.GetTableAsync("StringDataTable"); + } } } \ No newline at end of file diff --git a/Assets/03.Images/Props/Furniture/MoneyCounter01.png b/Assets/03.Images/Props/Furniture/MoneyCounter01.png new file mode 100644 index 000000000..c848044e9 Binary files /dev/null and b/Assets/03.Images/Props/Furniture/MoneyCounter01.png differ diff --git a/Assets/03.Images/Props/Furniture/MoneyCounter01.png.meta b/Assets/03.Images/Props/Furniture/MoneyCounter01.png.meta new file mode 100644 index 000000000..349ff0dde --- /dev/null +++ b/Assets/03.Images/Props/Furniture/MoneyCounter01.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 217c5c30fa315ab4c8e0fe76ef1d18f7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 7 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 512 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WindowsStoreApps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/03.Images/Props/Furniture/MoneyCounter02.png b/Assets/03.Images/Props/Furniture/MoneyCounter02.png new file mode 100644 index 000000000..68a690dd4 Binary files /dev/null and b/Assets/03.Images/Props/Furniture/MoneyCounter02.png differ diff --git a/Assets/03.Images/Props/Furniture/MoneyCounter02.png.meta b/Assets/03.Images/Props/Furniture/MoneyCounter02.png.meta new file mode 100644 index 000000000..1f073b1be --- /dev/null +++ b/Assets/03.Images/Props/Furniture/MoneyCounter02.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: ffbde217e84dd754ab6e6d721618490b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 7 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 512 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WindowsStoreApps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/03.Images/Props/Furniture/MoneyCounter03.png b/Assets/03.Images/Props/Furniture/MoneyCounter03.png new file mode 100644 index 000000000..c600e3313 Binary files /dev/null and b/Assets/03.Images/Props/Furniture/MoneyCounter03.png differ diff --git a/Assets/03.Images/Props/Furniture/MoneyCounter03.png.meta b/Assets/03.Images/Props/Furniture/MoneyCounter03.png.meta new file mode 100644 index 000000000..bb7b24e7d --- /dev/null +++ b/Assets/03.Images/Props/Furniture/MoneyCounter03.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 5c3538f8606c62847a8dfd21aa39a2fe +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 7 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 512 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WindowsStoreApps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/03.Images/Props/Furniture/MoneyCounterEmpty.png b/Assets/03.Images/Props/Furniture/MoneyCounterEmpty.png new file mode 100644 index 000000000..76665fbf5 Binary files /dev/null and b/Assets/03.Images/Props/Furniture/MoneyCounterEmpty.png differ diff --git a/Assets/03.Images/Props/Furniture/MoneyCounterEmpty.png.meta b/Assets/03.Images/Props/Furniture/MoneyCounterEmpty.png.meta new file mode 100644 index 000000000..cd955dc0d --- /dev/null +++ b/Assets/03.Images/Props/Furniture/MoneyCounterEmpty.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 3da5d6eace330f04397ef9c546a69ced +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 7 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 512 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WindowsStoreApps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/05.Prefabs/Characters/Npcs/Customer.prefab b/Assets/05.Prefabs/Characters/Npcs/Customer.prefab index 6c81630c0..8999818a8 100644 --- a/Assets/05.Prefabs/Characters/Npcs/Customer.prefab +++ b/Assets/05.Prefabs/Characters/Npcs/Customer.prefab @@ -551,6 +551,7 @@ GameObject: - component: {fileID: 5279376384905517670} - component: {fileID: 17978457728262906} - component: {fileID: -2302002259734456648} + - component: {fileID: 2085349091043731492} m_Layer: 14 m_Name: Customer m_TagString: Untagged @@ -856,6 +857,46 @@ MonoBehaviour: k__BackingField: 0 k__BackingField: 0 _customerInteractionType: 0 +--- !u!114 &2085349091043731492 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7260635347182713621} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 52080177065984 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: -2302002259734456648} + m_TargetAssemblyTypeName: BlueWater.Npcs.Customers.Customer, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!1 &7812544424410854405 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/05.Prefabs/Characters/Players/TycoonPlayer.prefab b/Assets/05.Prefabs/Characters/Players/TycoonPlayer.prefab index 1dc43c314..e9cd695ed 100644 --- a/Assets/05.Prefabs/Characters/Players/TycoonPlayer.prefab +++ b/Assets/05.Prefabs/Characters/Players/TycoonPlayer.prefab @@ -617,6 +617,8 @@ MonoBehaviour: k__BackingField: {fileID: 1674052485383758547} k__BackingField: {fileID: 4836489897218844789} k__BackingField: {fileID: 909302231676134912} + _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} + _offset: {x: 0, y: 1.5, z: 0} --- !u!114 &6662554121718997272 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/05.Prefabs/Managers/LocalizationManager.prefab b/Assets/05.Prefabs/Managers/LocalizationManager.prefab new file mode 100644 index 000000000..a65ad05a7 --- /dev/null +++ b/Assets/05.Prefabs/Managers/LocalizationManager.prefab @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8379768038421875437 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9131977339796530822} + - component: {fileID: 8665445414907968758} + m_Layer: 0 + m_Name: LocalizationManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9131977339796530822 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8379768038421875437} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8665445414907968758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8379768038421875437} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 34c314af086484147ab3b78d4da361a6, type: 3} + m_Name: + m_EditorClassIdentifier: + _persistent: 1 diff --git a/Assets/05.Prefabs/Props/Mini/Column 1.prefab.meta b/Assets/05.Prefabs/Managers/LocalizationManager.prefab.meta similarity index 74% rename from Assets/05.Prefabs/Props/Mini/Column 1.prefab.meta rename to Assets/05.Prefabs/Managers/LocalizationManager.prefab.meta index a2c582259..da4154ebd 100644 --- a/Assets/05.Prefabs/Props/Mini/Column 1.prefab.meta +++ b/Assets/05.Prefabs/Managers/LocalizationManager.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b23ca5f12ec57c34aa306900e3450fe1 +guid: 1614514235215fe4b877ab0945881d27 PrefabImporter: externalObjects: {} userData: diff --git a/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab b/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab index ff4bfee53..a6d8b08b2 100644 --- a/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab +++ b/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab @@ -5203,6 +5203,7 @@ Transform: - {fileID: 4798925548635759970} - {fileID: 3032369304281183765} - {fileID: 334852209123821565} + - {fileID: 6993580701352060546} m_Father: {fileID: 4449232531499695111} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8697754653569273504 @@ -6056,6 +6057,10 @@ PrefabInstance: propertyPath: _idx value: Garnish1 objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "Garnish1 \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -1.3 @@ -6096,6 +6101,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1653087204473300138, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: m_StringReference.m_TableEntryReference.m_KeyId + value: 41099917012992 + objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_Name value: Garnish1 @@ -6266,6 +6275,10 @@ PrefabInstance: propertyPath: _idx value: LiquidD objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidD \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -1.6 @@ -6310,6 +6323,10 @@ PrefabInstance: propertyPath: m_ConstrainProportionsScale value: 0 objectReference: {fileID: 0} + - target: {fileID: 1653087204473300138, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: m_StringReference.m_TableEntryReference.m_KeyId + value: 41096481878016 + objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_Name value: LiquidD @@ -7587,6 +7604,10 @@ PrefabInstance: propertyPath: _idx value: LiquidA objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} propertyPath: m_LocalScale.x value: 5.5 @@ -8818,6 +8839,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1829148020791446333} m_Modifications: + - target: {fileID: -8278684978296943735, guid: f0b7d93a3fd80be429e7fdac2a2cce39, type: 3} + propertyPath: _canRandomChange + value: 1 + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: f0b7d93a3fd80be429e7fdac2a2cce39, type: 3} propertyPath: m_LocalScale.x value: 0.7 @@ -11809,6 +11834,10 @@ PrefabInstance: propertyPath: _idx value: LiquidC objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidC \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 4.5 @@ -11849,6 +11878,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1653087204473300138, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: m_StringReference.m_TableEntryReference.m_KeyId + value: 41088755970048 + objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_Name value: LiquidC @@ -12743,6 +12776,10 @@ PrefabInstance: propertyPath: _idx value: LiquidB objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidB \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -2.4 @@ -12783,6 +12820,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1653087204473300138, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: m_StringReference.m_TableEntryReference.m_KeyId + value: 41071488020480 + objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_Name value: LiquidB @@ -13317,6 +13358,10 @@ PrefabInstance: propertyPath: _idx value: LiquidE objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidE \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 3.8 @@ -13357,6 +13402,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1653087204473300138, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: m_StringReference.m_TableEntryReference.m_KeyId + value: 41098067324928 + objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_Name value: LiquidE @@ -14000,6 +14049,68 @@ Transform: m_CorrespondingSourceObject: {fileID: 1061695247072719575, guid: 28c8f2cd9a2817345b5d1fe15e1bebd3, type: 3} m_PrefabInstance: {fileID: 7582115575141085924} m_PrefabAsset: {fileID: 0} +--- !u!1001 &7652502438688209504 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1402113424960589398} + m_Modifications: + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalPosition.x + value: 2.9500003 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalPosition.z + value: -11.95 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5897095096647521783, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + propertyPath: m_Name + value: MoneyCounter + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} +--- !u!4 &6993580701352060546 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 809828747251277026, guid: 9e5375e8c94af9f49a9661227294f024, type: 3} + m_PrefabInstance: {fileID: 7652502438688209504} + m_PrefabAsset: {fileID: 0} --- !u!1001 &7689873542727583674 PrefabInstance: m_ObjectHideFlags: 0 @@ -14361,6 +14472,10 @@ PrefabInstance: propertyPath: _idx value: Garnish2 objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "Garnish2 \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 3.6 @@ -14401,6 +14516,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1653087204473300138, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: m_StringReference.m_TableEntryReference.m_KeyId + value: 41100923645952 + objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_Name value: Garnish2 diff --git a/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 2.prefab b/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 2.prefab index 1abee38bd..dc129f41c 100644 --- a/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 2.prefab +++ b/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 2.prefab @@ -5923,7 +5923,6 @@ Transform: - {fileID: 3965676124384496161} - {fileID: 7992502685712917166} - {fileID: 7326867266483086187} - - {fileID: 889899601421890047} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9067969438214262816 @@ -6441,6 +6440,10 @@ PrefabInstance: propertyPath: _idx value: Garnish1 objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -5.63 @@ -6853,6 +6856,10 @@ PrefabInstance: propertyPath: _idx value: LiquidD objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -4.48 @@ -8503,6 +8510,10 @@ PrefabInstance: propertyPath: _idx value: LiquidA objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -13267,6 +13278,10 @@ PrefabInstance: propertyPath: _idx value: LiquidC objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 3.19 @@ -13967,6 +13982,10 @@ PrefabInstance: propertyPath: _idx value: LiquidB objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -3.2 @@ -14581,88 +14600,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 6457232975130062969, guid: 76b794a931e63304f88a6cb498795c4c, type: 3} m_PrefabInstance: {fileID: 6358444859538525529} m_PrefabAsset: {fileID: 0} ---- !u!1001 &6499337379013114210 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 2700294535905665279} - m_Modifications: - - target: {fileID: 652625962474261424, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: 'm_Materials.Array.data[0]' - value: - objectReference: {fileID: 2100000, guid: 470021da37a3b244ab004fb80b151574, type: 2} - - target: {fileID: 900825868516819336, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_Name - value: WallBar - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.x - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.y - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.z - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.x - value: -4.866 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.z - value: -5.46 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6882913462236487221, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.z - value: -0.011 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: ba2f04db324864e48936c27164f91e49, type: 3} ---- !u!4 &889899601421890047 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - m_PrefabInstance: {fileID: 6499337379013114210} - m_PrefabAsset: {fileID: 0} --- !u!1001 &6526153460580896826 PrefabInstance: m_ObjectHideFlags: 0 @@ -15091,6 +15028,10 @@ PrefabInstance: propertyPath: _idx value: LiquidE objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 4.54 @@ -16702,6 +16643,10 @@ PrefabInstance: propertyPath: _idx value: Garnish2 objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 5.6 diff --git a/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 3.prefab b/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 3.prefab index b38a3eba0..6a7a4f724 100644 --- a/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 3.prefab +++ b/Assets/05.Prefabs/Maps/Tycoon/TycoonMap 3.prefab @@ -3924,7 +3924,6 @@ Transform: - {fileID: 9018991239389689224} - {fileID: 5417258537655965207} - {fileID: 6259194641275220530} - - {fileID: 889899601421890047} m_Father: {fileID: 4449232531499695111} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6100274519667895078 @@ -7241,6 +7240,10 @@ PrefabInstance: propertyPath: _idx value: LiquidD objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: -0.47000015 @@ -8541,6 +8544,10 @@ PrefabInstance: propertyPath: _idx value: LiquidA objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} propertyPath: m_LocalScale.x value: 5.5 @@ -13593,6 +13600,10 @@ PrefabInstance: propertyPath: _idx value: LiquidC objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 7.33 @@ -14449,6 +14460,10 @@ PrefabInstance: propertyPath: _idx value: LiquidB objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 1.8479998 @@ -14869,104 +14884,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 6457232975130062969, guid: 76b794a931e63304f88a6cb498795c4c, type: 3} m_PrefabInstance: {fileID: 6358444859538525529} m_PrefabAsset: {fileID: 0} ---- !u!1001 &6499337379013114210 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 7906693004392999617} - m_Modifications: - - target: {fileID: 652625962474261424, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: 'm_Materials.Array.data[0]' - value: - objectReference: {fileID: 2100000, guid: 470021da37a3b244ab004fb80b151574, type: 2} - - target: {fileID: 900825868516819336, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_Name - value: WallBar - objectReference: {fileID: 0} - - target: {fileID: 900825868516819336, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.x - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.y - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.z - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.x - value: -5.57 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.y - value: -0.15 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.z - value: -5.65 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6882913462236487221, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.z - value: -0.011 - objectReference: {fileID: 0} - - target: {fileID: 6882913462236487221, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.w - value: 0.9063079 - objectReference: {fileID: 0} - - target: {fileID: 6882913462236487221, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.x - value: 0.42261827 - objectReference: {fileID: 0} - - target: {fileID: 6882913462236487221, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 50 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: ba2f04db324864e48936c27164f91e49, type: 3} ---- !u!4 &889899601421890047 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - m_PrefabInstance: {fileID: 6499337379013114210} - m_PrefabAsset: {fileID: 0} --- !u!1001 &6526153460580896826 PrefabInstance: m_ObjectHideFlags: 0 @@ -15419,6 +15336,10 @@ PrefabInstance: propertyPath: _idx value: LiquidE objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalPosition.x value: 9.32 diff --git a/Assets/05.Prefabs/Maps/Tycoon/TycoonMapUpsideDown.prefab b/Assets/05.Prefabs/Maps/Tycoon/TycoonMapUpsideDown.prefab index f3138df02..5a08a728d 100644 --- a/Assets/05.Prefabs/Maps/Tycoon/TycoonMapUpsideDown.prefab +++ b/Assets/05.Prefabs/Maps/Tycoon/TycoonMapUpsideDown.prefab @@ -3827,7 +3827,6 @@ Transform: - {fileID: 468591085198452646} - {fileID: 4430136714909607311} - {fileID: 6259194641275220530} - - {fileID: 889899601421890047} m_Father: {fileID: 4449232531499695111} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6100274519667895078 @@ -6205,6 +6204,10 @@ PrefabInstance: propertyPath: _idx value: Garnish1 objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalScale.x value: 2.31057 @@ -6629,6 +6632,10 @@ PrefabInstance: propertyPath: _idx value: LiquidD objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalScale.x value: 2.31057 @@ -8073,6 +8080,10 @@ PrefabInstance: propertyPath: _idx value: LiquidA objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: a95c8459c64ddc0429e25ed5876f2120, type: 3} propertyPath: m_LocalScale.x value: 4.62114 @@ -12171,6 +12182,10 @@ PrefabInstance: propertyPath: _idx value: LiquidC objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalScale.x value: 2.31057 @@ -12887,6 +12902,10 @@ PrefabInstance: propertyPath: _idx value: LiquidB objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalScale.x value: 2.31057 @@ -13365,92 +13384,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 6457232975130062969, guid: 76b794a931e63304f88a6cb498795c4c, type: 3} m_PrefabInstance: {fileID: 6358444859538525529} m_PrefabAsset: {fileID: 0} ---- !u!1001 &6499337379013114210 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 7906693004392999617} - m_Modifications: - - target: {fileID: 652625962474261424, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: 'm_Materials.Array.data[0]' - value: - objectReference: {fileID: 2100000, guid: 470021da37a3b244ab004fb80b151574, type: 2} - - target: {fileID: 900825868516819336, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_Name - value: WallBar - objectReference: {fileID: 0} - - target: {fileID: 900825868516819336, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.x - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.y - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalScale.z - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.x - value: -4.866 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.z - value: -5.46 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6882913462236487221, guid: ba2f04db324864e48936c27164f91e49, type: 3} - propertyPath: m_LocalPosition.z - value: -0.011 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: ba2f04db324864e48936c27164f91e49, type: 3} ---- !u!4 &889899601421890047 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 6227288689240557725, guid: ba2f04db324864e48936c27164f91e49, type: 3} - m_PrefabInstance: {fileID: 6499337379013114210} - m_PrefabAsset: {fileID: 0} --- !u!1001 &6526153460580896826 PrefabInstance: m_ObjectHideFlags: 0 @@ -13887,6 +13820,10 @@ PrefabInstance: propertyPath: _idx value: LiquidE objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalScale.x value: 2.31057 @@ -15370,6 +15307,10 @@ PrefabInstance: propertyPath: _idx value: Garnish2 objectReference: {fileID: 0} + - target: {fileID: 223172209862223209, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} + propertyPath: k__BackingField + value: "LiquidA \uB530\uB974\uAE30" + objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 224465767a13abb44b0d3adb16ca76c1, type: 3} propertyPath: m_LocalScale.x value: 2.31057 diff --git a/Assets/05.Prefabs/Particles/PayMoneyParticle.prefab b/Assets/05.Prefabs/Particles/PayMoneyParticle.prefab index 131fa0e49..288b2be9a 100644 --- a/Assets/05.Prefabs/Particles/PayMoneyParticle.prefab +++ b/Assets/05.Prefabs/Particles/PayMoneyParticle.prefab @@ -43,7 +43,7 @@ ParticleSystem: serializedVersion: 8 lengthInSec: 3 simulationSpeed: 1 - stopAction: 0 + stopAction: 2 cullingMode: 0 ringBufferMode: 0 ringBufferLoopRange: {x: 0, y: 1} diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/BartenderTable02.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/BartenderTable02.prefab index 22e61c8d4..69d874b7a 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/BartenderTable02.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/BartenderTable02.prefab @@ -263,6 +263,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 4366825669518001782} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 3330559944751018385} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!4 &203741387490724426 stripped Transform: @@ -295,11 +298,52 @@ MonoBehaviour: k__BackingField: {fileID: 6077686033771388879} k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 3330559944751018385} k__BackingField: 1 k__BackingField: 0.7 k__BackingField: IsOpened: 0 CocktailGlassImage: {fileID: 535721072425912087} +--- !u!114 &3330559944751018385 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 49661431001088 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4366825669518001782} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab index f6f0736b1..98378d929 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 7272068659984017056} - component: {fileID: 6277647266874368514} + - component: {fileID: 3964937737965122596} m_Layer: 8 m_Name: TableSeat02 m_TagString: Untagged @@ -54,7 +55,7 @@ MonoBehaviour: k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} k__BackingField: 1 k__BackingField: 0.6 - k__BackingField: Cleaning up table + k__BackingField: IsOpened: 0 _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} _offset: {x: 0, y: 1.5, z: 0} @@ -67,6 +68,46 @@ MonoBehaviour: TableNumber: 0 _playerHoldingTime: 3 _crewHoldingTime: 9 +--- !u!114 &3964937737965122596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 321954324799972663} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 42907288743936 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6277647266874368514} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!1 &1352874222752200122 GameObject: m_ObjectHideFlags: 0 @@ -338,6 +379,7 @@ GameObject: m_Component: - component: {fileID: 1796875075399045521} - component: {fileID: 6383913593085221228} + - component: {fileID: 4593866383055317665} m_Layer: 8 m_Name: TableSeat01 m_TagString: Untagged @@ -382,7 +424,7 @@ MonoBehaviour: k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} k__BackingField: 1 k__BackingField: 0.6 - k__BackingField: Cleaning up table + k__BackingField: IsOpened: 0 _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} _offset: {x: 0, y: 1.5, z: 0} @@ -395,6 +437,46 @@ MonoBehaviour: TableNumber: 0 _playerHoldingTime: 3 _crewHoldingTime: 9 +--- !u!114 &4593866383055317665 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5899113663160612507} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 42907288743936 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6277647266874368514} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!1 &6493535781353555306 GameObject: m_ObjectHideFlags: 0 @@ -892,7 +974,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 353433a78f14e1b42bef6e12dd1f5700, type: 3} m_Name: m_EditorClassIdentifier: - _carpetObject: {fileID: 0} _tableSeats: - {fileID: 6383913593085221228} - {fileID: 6277647266874368514} diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidBarrel01.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidBarrel01.prefab index 846f79f19..755413d00 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidBarrel01.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidBarrel01.prefab @@ -533,6 +533,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 223172209862223209} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 1653087204473300138} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!4 &203741387490724426 stripped Transform: @@ -558,12 +561,15 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: {fileID: 5927803667513949971} k__BackingField: {fileID: 6077686033771388879} - k__BackingField: {fileID: 8975593228546502023} + k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 1653087204473300138} k__BackingField: 1 k__BackingField: 0.8 k__BackingField: IsOpened: 0 + _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} + _offset: {x: 0, y: 1.5, z: 0} _liquidImage: {fileID: 6817574259189873408} _fill: {fileID: 7052380446467937511} _colorIntensity: 2 @@ -577,6 +583,54 @@ MonoBehaviour: k__BackingField: {r: 0, g: 0, b: 0, a: 0} k__BackingField: 0 k__BackingField: 0 + k__BackingField: 0 +--- !u!114 &1653087204473300138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 34976455471104 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: + - name: global + variable: + rid: 5889118636641091760 + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 223172209862223209} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + references: + version: 2 + RefIds: + - rid: 5889118636641091760 + type: {class: NestedVariablesGroup, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: {fileID: 11400000, guid: f81887433cf7f6c4a991e214ea0eda59, type: 2} --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} @@ -587,8 +641,14 @@ SpriteRenderer: m_CorrespondingSourceObject: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} ---- !u!223 &8975593228546502023 stripped -Canvas: - m_CorrespondingSourceObject: {fileID: 1830317875510668177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} +--- !u!114 &6533109861150454071 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4558604739080582945, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidStatue.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidStatue.prefab index c68da4844..2827123d4 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidStatue.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/LiquidStatue.prefab @@ -259,7 +259,7 @@ SpriteRenderer: m_Size: {x: 1, y: 1} m_AdaptiveModeThreshold: 0.5 m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 + m_WasSpriteAssigned: 0 m_MaskInteraction: 0 m_SpriteSortPoint: 0 --- !u!1001 &7343451337687172630 @@ -391,6 +391,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 223172209862223209} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 7967298876764243330} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!4 &203741387490724426 stripped Transform: @@ -416,12 +419,15 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: {fileID: 5927803667513949971} k__BackingField: {fileID: 6077686033771388879} - k__BackingField: {fileID: 8975593228546502023} + k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 7967298876764243330} k__BackingField: 1 k__BackingField: 0.8 k__BackingField: IsOpened: 0 + _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} + _offset: {x: 0, y: 1.5, z: 0} _liquidImage: {fileID: 6817574259189873408} _fill: {fileID: 7052380446467937511} _colorIntensity: 2 @@ -434,7 +440,55 @@ MonoBehaviour: k__BackingField: {fileID: 0} k__BackingField: {r: 0, g: 0, b: 0, a: 0} k__BackingField: 0 - _isActivated: 0 + k__BackingField: 0 + k__BackingField: 0 +--- !u!114 &7967298876764243330 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 34976455471104 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: + - name: global + variable: + rid: 5889118636641091760 + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 223172209862223209} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + references: + version: 2 + RefIds: + - rid: 5889118636641091760 + type: {class: NestedVariablesGroup, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: {fileID: 11400000, guid: f81887433cf7f6c4a991e214ea0eda59, type: 2} --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} @@ -445,8 +499,14 @@ SpriteRenderer: m_CorrespondingSourceObject: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} ---- !u!223 &8975593228546502023 stripped -Canvas: - m_CorrespondingSourceObject: {fileID: 1830317875510668177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} +--- !u!114 &6533109861150454071 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4558604739080582945, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/MoneyCounter.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/MoneyCounter.prefab new file mode 100644 index 000000000..8c98060a0 --- /dev/null +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/MoneyCounter.prefab @@ -0,0 +1,267 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &7343451337687172630 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1180174675498993111, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 40 + objectReference: {fileID: 0} + - target: {fileID: 2106642157007834423, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 80 + objectReference: {fileID: 0} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 3da5d6eace330f04397ef9c546a69ced, type: 3} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_SortingOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_WasSpriteAssigned + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: 'm_Materials.Array.data[0]' + value: + objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - target: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Name + value: MoneyCounter + objectReference: {fileID: 0} + - target: {fileID: 5024482427928425524, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5953080908505751474, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: a327d1fc80d90bd438cfcd1ad2b219c7, type: 3} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Color.g + value: 0.026785713 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Color.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_FillAmount + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_FillMethod + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_FillOrigin + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 7122983875714221022, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7438534416270888028, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8780093359852370517, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: b93d1d9adc811a74fb4192ade70fd3cc, type: 3} + - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 3da5d6eace330f04397ef9c546a69ced, type: 3} + - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_WasSpriteAssigned + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 1580388353006505547} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 2621544615787308462} + m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} +--- !u!1 &5897095096647521783 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1580388353006505547 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9750cc69bc8edf74da6603280ffbb977, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: {fileID: 5927803667513949971} + k__BackingField: {fileID: 6077686033771388879} + k__BackingField: {fileID: 6533109861150454071} + k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: 1 + k__BackingField: 0.8 + k__BackingField: + IsOpened: 0 + _playerHoldingTime: 3 + _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} + _offset: {x: 0, y: 1.5, z: 0} + _empty: {fileID: 21300000, guid: 3da5d6eace330f04397ef9c546a69ced, type: 3} + _level1: {fileID: 21300000, guid: 217c5c30fa315ab4c8e0fe76ef1d18f7, type: 3} + _level2: {fileID: 21300000, guid: ffbde217e84dd754ab6e6d721618490b, type: 3} + _level3: {fileID: 21300000, guid: 5c3538f8606c62847a8dfd21aa39a2fe, type: 3} + k__BackingField: 0 +--- !u!114 &2621544615787308462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 43510928781312 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1580388353006505547} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] +--- !u!4 &5927803667513949971 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!212 &6077686033771388879 stripped +SpriteRenderer: + m_CorrespondingSourceObject: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6533109861150454071 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4558604739080582945, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/05.Prefabs/Props/Mini/Column.prefab.meta b/Assets/05.Prefabs/Props/Furniture/Interactions/MoneyCounter.prefab.meta similarity index 74% rename from Assets/05.Prefabs/Props/Mini/Column.prefab.meta rename to Assets/05.Prefabs/Props/Furniture/Interactions/MoneyCounter.prefab.meta index bd524c8f9..34564fc5a 100644 --- a/Assets/05.Prefabs/Props/Mini/Column.prefab.meta +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/MoneyCounter.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dfa7ae42d29c44044a8bca8e68c9db21 +guid: 9e5375e8c94af9f49a9661227294f024 PrefabImporter: externalObjects: {} userData: diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/Mushroom.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/Mushroom.prefab index 7dd882106..8a0b3efb9 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/Mushroom.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/Mushroom.prefab @@ -12,10 +12,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.x value: 40 objectReference: {fileID: 0} - - target: {fileID: 1702261025824090784, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} - propertyPath: m_SortingOrder - value: 3 - objectReference: {fileID: 0} - target: {fileID: 2106642157007834423, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_IsActive value: 1 @@ -44,6 +40,10 @@ PrefabInstance: propertyPath: m_Sprite value: objectReference: {fileID: 21300000, guid: 9b1a96853ff579e448f90dd066ea0eb0, type: 3} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_SortingOrder + value: 5 + objectReference: {fileID: 0} - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_WasSpriteAssigned value: 1 @@ -171,6 +171,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 9017181398980009727} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 9176172352370892430} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!1 &5897095096647521783 stripped GameObject: @@ -195,9 +198,49 @@ MonoBehaviour: k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} k__BackingField: 1 k__BackingField: 0.6 - k__BackingField: Cleaning up mushroom + k__BackingField: IsOpened: 0 _playerHoldingTime: 3 +--- !u!114 &9176172352370892430 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 43158066180096 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 9017181398980009727} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/Pump.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/Pump.prefab index 629f76515..0064e254d 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/Pump.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/Pump.prefab @@ -176,6 +176,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 2713540284264789073} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 2898669091630925434} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!1 &5897095096647521783 stripped GameObject: @@ -198,15 +201,55 @@ MonoBehaviour: k__BackingField: {fileID: 6077686033771388879} k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 0} k__BackingField: 1 k__BackingField: 1 k__BackingField: "\uD38C\uD504 \uC791\uB3D9" IsOpened: 0 _interactionHoldingTime: 1 _pumpingMessageObject: {fileID: 7690724424382746193, guid: 206dfaa20a9d03d40a76e55ba01170c8, type: 3} - _instanceLocation: {fileID: 0} _offset: {x: 0, y: 1.5, z: 0} addedLiquid: 400 +--- !u!114 &2898669091630925434 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 53404088152064 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2713540284264789073} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/RandomChangeTrashCan.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/RandomChangeTrashCan.prefab new file mode 100644 index 000000000..75d64423b --- /dev/null +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/RandomChangeTrashCan.prefab @@ -0,0 +1,204 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &7343451337687172630 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1180174675498993111, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 40 + objectReference: {fileID: 0} + - target: {fileID: 2106642157007834423, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 80 + objectReference: {fileID: 0} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 3efc550bddc68a345b5400a832fb9a6a, type: 3} + - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_WasSpriteAssigned + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Name + value: RandomChangeTrashCan + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 3efc550bddc68a345b5400a832fb9a6a, type: 3} + - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_WasSpriteAssigned + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 2724648112398126851} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 5411673223561907087} + m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} +--- !u!1 &5897095096647521783 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!114 &2724648112398126851 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bfafa6669b5fa8a48b8e610286e1a192, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: {fileID: 5927803667513949971} + k__BackingField: {fileID: 6077686033771388879} + k__BackingField: {fileID: 6533109861150454071} + k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 5411673223561907087} + k__BackingField: 1 + k__BackingField: 0.7 + k__BackingField: + IsOpened: 0 +--- !u!114 &5411673223561907087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: + m_TableEntryReference: + m_KeyId: 0 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] +--- !u!4 &5927803667513949971 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!212 &6077686033771388879 stripped +SpriteRenderer: + m_CorrespondingSourceObject: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6533109861150454071 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4558604739080582945, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/05.Prefabs/Props/Mini/NPCTable.prefab.meta b/Assets/05.Prefabs/Props/Furniture/Interactions/RandomChangeTrashCan.prefab.meta similarity index 74% rename from Assets/05.Prefabs/Props/Mini/NPCTable.prefab.meta rename to Assets/05.Prefabs/Props/Furniture/Interactions/RandomChangeTrashCan.prefab.meta index 0637833e4..f25b18b5f 100644 --- a/Assets/05.Prefabs/Props/Mini/NPCTable.prefab.meta +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/RandomChangeTrashCan.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 094fc2c5e04bd7f4cafd9d08a9c5e15d +guid: eaa55356a4b11e047a47332f0d6a9d1a PrefabImporter: externalObjects: {} userData: diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/ServingTable02.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/ServingTable02.prefab index aff595ff9..f7348406e 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/ServingTable02.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/ServingTable02.prefab @@ -225,6 +225,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 5584299599595477975} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 2690585816417773486} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!4 &203741387490724426 stripped Transform: @@ -250,13 +253,42 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: {fileID: 5927803667513949971} k__BackingField: {fileID: 6077686033771388879} - k__BackingField: {fileID: 8975593228546502023} + k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 2690585816417773486} k__BackingField: 1 k__BackingField: 0.7 k__BackingField: IsOpened: 0 CocktailGlassImage: {fileID: 535721072425912087} +--- !u!114 &2690585816417773486 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: + m_TableEntryReference: + m_KeyId: 0 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: [] + references: + version: 2 + RefIds: [] --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} @@ -267,8 +299,14 @@ SpriteRenderer: m_CorrespondingSourceObject: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} ---- !u!223 &8975593228546502023 stripped -Canvas: - m_CorrespondingSourceObject: {fileID: 1830317875510668177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} +--- !u!114 &6533109861150454071 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4558604739080582945, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/TrashCan.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/TrashCan.prefab index 2753a390c..cb6b87ca7 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/TrashCan.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/TrashCan.prefab @@ -14,7 +14,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2106642157007834423, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2301048832536013177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_LocalScale.x @@ -44,6 +44,38 @@ PrefabInstance: propertyPath: m_Name value: TrashCan objectReference: {fileID: 0} + - target: {fileID: 5953080908505751474, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: a327d1fc80d90bd438cfcd1ad2b219c7, type: 3} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Color.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Color.r + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_FillAmount + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_FillMethod + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 6365458266480896368, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_FillOrigin + value: 2 + objectReference: {fileID: 0} - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_LocalScale.x value: 1 @@ -96,6 +128,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 8780093359852370517, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: b93d1d9adc811a74fb4192ade70fd3cc, type: 3} - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_Sprite value: @@ -111,6 +147,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: -8278684978296943735} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 5411673223561907087} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!1 &5897095096647521783 stripped GameObject: @@ -131,12 +170,43 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: {fileID: 5927803667513949971} k__BackingField: {fileID: 6077686033771388879} - k__BackingField: {fileID: 8975593228546502023} + k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} + k__BackingField: {fileID: 5411673223561907087} k__BackingField: 1 k__BackingField: 0.7 - k__BackingField: "\uC4F0\uB808\uAE30 \uBC84\uB9AC\uAE30" + k__BackingField: IsOpened: 0 + _playerHoldingTime: 1 + _canRandomChange: 0 +--- !u!114 &5411673223561907087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: + m_TableEntryReference: + m_KeyId: 0 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: [] + references: + version: 2 + RefIds: [] --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} @@ -147,8 +217,14 @@ SpriteRenderer: m_CorrespondingSourceObject: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} ---- !u!223 &8975593228546502023 stripped -Canvas: - m_CorrespondingSourceObject: {fileID: 1830317875510668177, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} +--- !u!114 &6533109861150454071 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4558604739080582945, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/Vomiting.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/Vomiting.prefab index a1623f769..000d8ffd1 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/Vomiting.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/Vomiting.prefab @@ -183,6 +183,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 7264946127367919962} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 1488784826241318952} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!1 &5897095096647521783 stripped GameObject: @@ -207,12 +210,52 @@ MonoBehaviour: k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} k__BackingField: 1 k__BackingField: 0.5 - k__BackingField: Cleaning up vomiting + k__BackingField: IsOpened: 0 _payMoneyUiObject: {fileID: 1722793422445764049, guid: d89dc1946bb6ee448a113d28d6bf2dce, type: 3} _offset: {x: 0, y: 1.5, z: 0} _playerHoldingTime: 3 _crewHoldingTime: 9 +--- !u!114 &1488784826241318952 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:0f00ef9cea8f57e4e952e1881becfed7 + m_TableEntryReference: + m_KeyId: 42020407357440 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 7264946127367919962} + m_TargetAssemblyTypeName: BlueWater.Tycoons.InteractionFurniture, Assembly-CSharp + m_MethodName: set_InteractionMessage + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + references: + version: 2 + RefIds: [] --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/Barrel.prefab b/Assets/05.Prefabs/Props/Mini/Barrel.prefab deleted file mode 100644 index e72077bd7..000000000 --- a/Assets/05.Prefabs/Props/Mini/Barrel.prefab +++ /dev/null @@ -1,71 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &8250971885031797383 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 652625962474261424, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 9f7d82fbc664fbb4d98842fc46db319d, type: 3} - - target: {fileID: 900825868516819336, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Name - value: Barrel - objectReference: {fileID: 0} - - target: {fileID: 4985587680422744605, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 9f7d82fbc664fbb4d98842fc46db319d, type: 3} - - target: {fileID: 5603748789724571281, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Size.x - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/Column 1.prefab b/Assets/05.Prefabs/Props/Mini/Column 1.prefab deleted file mode 100644 index a9597c5e1..000000000 --- a/Assets/05.Prefabs/Props/Mini/Column 1.prefab +++ /dev/null @@ -1,67 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &3546911982502979613 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 652625962474261424, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: f4c17f53385195f4e98fdf1f0da515d3, type: 3} - - target: {fileID: 900825868516819336, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Name - value: Column 1 - objectReference: {fileID: 0} - - target: {fileID: 4985587680422744605, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: f4c17f53385195f4e98fdf1f0da515d3, type: 3} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/Column.prefab b/Assets/05.Prefabs/Props/Mini/Column.prefab deleted file mode 100644 index fb744c150..000000000 --- a/Assets/05.Prefabs/Props/Mini/Column.prefab +++ /dev/null @@ -1,75 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &2044797857068986449 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 652625962474261424, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 06a2c6aed62612e41ad12d29e64f669e, type: 3} - - target: {fileID: 652625962474261424, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_WasSpriteAssigned - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 900825868516819336, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Name - value: Column - objectReference: {fileID: 0} - - target: {fileID: 4985587680422744605, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 06a2c6aed62612e41ad12d29e64f669e, type: 3} - - target: {fileID: 4985587680422744605, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_WasSpriteAssigned - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/NPCTable.prefab b/Assets/05.Prefabs/Props/Mini/NPCTable.prefab deleted file mode 100644 index 8b4b8f910..000000000 --- a/Assets/05.Prefabs/Props/Mini/NPCTable.prefab +++ /dev/null @@ -1,67 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &8805598650455662079 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 652625962474261424, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 702bd7ea217003e47be28d81a79dd99c, type: 3} - - target: {fileID: 900825868516819336, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Name - value: NPCTable - objectReference: {fileID: 0} - - target: {fileID: 4985587680422744605, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 702bd7ea217003e47be28d81a79dd99c, type: 3} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6227288689240557725, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1496e34f13636804a82b6e1c438a74e2, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/TrashCan.prefab b/Assets/05.Prefabs/Props/Mini/TrashCan.prefab deleted file mode 100644 index 608c0412b..000000000 --- a/Assets/05.Prefabs/Props/Mini/TrashCan.prefab +++ /dev/null @@ -1,67 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &4355904791066675117 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2395388827384788821, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 3efc550bddc68a345b5400a832fb9a6a, type: 3} - - target: {fileID: 2643849317649087853, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_Name - value: TrashCan - objectReference: {fileID: 0} - - target: {fileID: 7854536393926979320, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: 3efc550bddc68a345b5400a832fb9a6a, type: 3} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9104995012213585016, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7601c5b68d6bab142b581e0a63d4743c, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/TrashCan.prefab.meta b/Assets/05.Prefabs/Props/Mini/TrashCan.prefab.meta deleted file mode 100644 index 49ad3f0a2..000000000 --- a/Assets/05.Prefabs/Props/Mini/TrashCan.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b51ba0e08743f4947898c76771fa87e2 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/05.Prefabs/Props/Mini/WallBar.prefab b/Assets/05.Prefabs/Props/Mini/WallBar.prefab deleted file mode 100644 index 698a32ddd..000000000 --- a/Assets/05.Prefabs/Props/Mini/WallBar.prefab +++ /dev/null @@ -1,67 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &1460291065197099848 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 1784444314929232576, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_Name - value: WallBar - objectReference: {fileID: 0} - - target: {fileID: 2111459413474029816, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: e8b27b82f6af50849b71aa8fbabb80f4, type: 3} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5869214406492465493, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: e8b27b82f6af50849b71aa8fbabb80f4, type: 3} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/WallBar.prefab.meta b/Assets/05.Prefabs/Props/Mini/WallBar.prefab.meta deleted file mode 100644 index a644f3091..000000000 --- a/Assets/05.Prefabs/Props/Mini/WallBar.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ba2f04db324864e48936c27164f91e49 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/05.Prefabs/Props/Mini/WoodenBeerMug.prefab b/Assets/05.Prefabs/Props/Mini/WoodenBeerMug.prefab deleted file mode 100644 index 36f3a947a..000000000 --- a/Assets/05.Prefabs/Props/Mini/WoodenBeerMug.prefab +++ /dev/null @@ -1,67 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &1460291065197099848 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 1784444314929232576, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_Name - value: WoodenBeerMug - objectReference: {fileID: 0} - - target: {fileID: 2111459413474029816, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: cda1d961a563b6143a024170ed6f0f44, type: 3} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4767122796570620885, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5869214406492465493, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} - propertyPath: m_Sprite - value: - objectReference: {fileID: 21300000, guid: cda1d961a563b6143a024170ed6f0f44, type: 3} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: b51ba0e08743f4947898c76771fa87e2, type: 3} diff --git a/Assets/05.Prefabs/Props/Mini/WoodenBeerMug.prefab.meta b/Assets/05.Prefabs/Props/Mini/WoodenBeerMug.prefab.meta deleted file mode 100644 index f70394abf..000000000 --- a/Assets/05.Prefabs/Props/Mini/WoodenBeerMug.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1496e34f13636804a82b6e1c438a74e2 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/05.Prefabs/Uis/InteractionCanvas.prefab b/Assets/05.Prefabs/Uis/InteractionCanvas.prefab index 7ec1f48cf..d01e582dd 100644 --- a/Assets/05.Prefabs/Uis/InteractionCanvas.prefab +++ b/Assets/05.Prefabs/Uis/InteractionCanvas.prefab @@ -85,7 +85,7 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 + m_PresetInfoIsWorld: 0 --- !u!114 &5028824454365225125 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/05.Prefabs/Uis/Tycoons/Card.prefab b/Assets/05.Prefabs/Uis/Tycoons/Card.prefab index 889800d40..6d5f59984 100644 --- a/Assets/05.Prefabs/Uis/Tycoons/Card.prefab +++ b/Assets/05.Prefabs/Uis/Tycoons/Card.prefab @@ -375,7 +375,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1e080f1606bf24d4cb31f55f7958812a, type: 3} m_Name: m_EditorClassIdentifier: - _cardData: AddAllLiquid + _informationText: {fileID: 6023757579985556140} cardName: cardText: rotationDurationCard: 1 diff --git a/Assets/11.BehaviorTree/Customer.asset b/Assets/11.BehaviorTree/Customer.asset index d222ed098..2f37116af 100644 --- a/Assets/11.BehaviorTree/Customer.asset +++ b/Assets/11.BehaviorTree/Customer.asset @@ -34,9 +34,12 @@ MonoBehaviour: Failure Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.OrderFail","NodeData":{"Offset":"(-171.836426,139.17836)"},"ID":12,"Name":"Order Fail","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.MoveSpawnPosition","NodeData":{"Offset":"(-3.28204346,144.4049)"},"ID":13,"Name":"Move Spawn Position","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.CheckOut","NodeData":{"Offset":"(152.261658,140)"},"ID":14,"Name":"Check - Out","Instant":true}]}]}]},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(742.794,147.214279)","Comment":"\ud1f4\uc7a5\ud55c\ub2e4"},"ID":15,"Name":"Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.MoveSpawnPosition","NodeData":{"Offset":"(-298.843353,152.3807)"},"ID":16,"Name":"Move - Spawn Position","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.Vomit","NodeData":{"Offset":"(-134.094391,154.430084)"},"ID":17,"Name":"Vomit","Instant":true},{"Type":"BehaviorDesigner.Runtime.Tasks.Wait","NodeData":{"Offset":"(-2.775899,148.649414)"},"ID":18,"Name":"Wait","Instant":true,"SharedFloatwaitTime":{"Type":"BehaviorDesigner.Runtime.SharedFloat","Name":null,"SinglemValue":1},"SharedBoolrandomWait":{"Type":"BehaviorDesigner.Runtime.SharedBool","Name":null,"BooleanmValue":false},"SharedFloatrandomWaitMin":{"Type":"BehaviorDesigner.Runtime.SharedFloat","Name":null,"SinglemValue":1},"SharedFloatrandomWaitMax":{"Type":"BehaviorDesigner.Runtime.SharedFloat","Name":null,"SinglemValue":1}},{"Type":"BlueWater.BehaviorTrees.Actions.MoveSpawnPosition","NodeData":{"Offset":"(140.7489,148.095245)"},"ID":19,"Name":"Move - Spawn Position","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.CheckOut","NodeData":{"Offset":"(290.7482,150)"},"ID":20,"Name":"Check + Out","Instant":true}]}]}]},{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(974.972046,147.214279)","Comment":"\ud1f4\uc7a5\ud55c\ub2e4"},"ID":15,"Name":"Check + Out Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.ReturnSuccess","NodeData":{"Offset":"(-242.7356,145.119171)"},"ID":16,"Name":"Return + Success","Instant":true,"Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.ConditionalEvaluator","NodeData":{"Offset":"(0,150)"},"ID":17,"Name":"Conditional + Evaluator","Instant":true,"SharedBoolreevaluate":{"Type":"BehaviorDesigner.Runtime.SharedBool","Name":null,"BooleanmValue":false},"ConditionalconditionalTask":{"Type":"BlueWater.BehaviorTrees.Actions.CanVomit"},"BooleangraphLabel":false,"Children":[{"Type":"BehaviorDesigner.Runtime.Tasks.Sequence","NodeData":{"Offset":"(-3.03159523,145.85321)"},"ID":18,"Name":"Sequence","Instant":true,"AbortTypeabortType":"None","Children":[{"Type":"BlueWater.BehaviorTrees.Actions.Vomit","NodeData":{"Offset":"(-97.7254639,151.771912)"},"ID":19,"Name":"Vomit","Instant":true},{"Type":"BehaviorDesigner.Runtime.Tasks.Wait","NodeData":{"Offset":"(112.4491,153.061523)"},"ID":20,"Name":"Wait","Instant":true,"SharedFloatwaitTime":{"Type":"BehaviorDesigner.Runtime.SharedFloat","Name":null,"SinglemValue":1},"SharedBoolrandomWait":{"Type":"BehaviorDesigner.Runtime.SharedBool","Name":null,"BooleanmValue":false},"SharedFloatrandomWaitMin":{"Type":"BehaviorDesigner.Runtime.SharedFloat","Name":null,"SinglemValue":1},"SharedFloatrandomWaitMax":{"Type":"BehaviorDesigner.Runtime.SharedFloat","Name":null,"SinglemValue":1}}]}]}]},{"Type":"BlueWater.BehaviorTrees.Actions.PayMoney","NodeData":{"Offset":"(-65.23828,147.618866)"},"ID":21,"Name":"Pay + Money","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.MoveSpawnPosition","NodeData":{"Offset":"(94.76172,147.618866)"},"ID":22,"Name":"Move + Spawn Position","Instant":true},{"Type":"BlueWater.BehaviorTrees.Actions.CheckOut","NodeData":{"Offset":"(264.761719,147.618866)"},"ID":23,"Name":"Check Out","Instant":true}]}]},"Variables":[{"Type":"BehaviorDesigner.Runtime.SharedGameObject","Name":"MyObj","IsShared":true}]}' fieldSerializationData: typeName: [] diff --git a/Assets/13.Localization.meta b/Assets/13.Localization.meta new file mode 100644 index 000000000..47bbe89b3 --- /dev/null +++ b/Assets/13.Localization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f6a196bdf3967df4cb131430d151cd7b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/English (en).asset b/Assets/13.Localization/English (en).asset new file mode 100644 index 000000000..75fa104b6 --- /dev/null +++ b/Assets/13.Localization/English (en).asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bb1838fe8befb0429646b938e757ff3, type: 3} + m_Name: English (en) + m_EditorClassIdentifier: + m_Identifier: + m_Code: en + m_Metadata: + m_Items: [] + m_LocaleName: English (en) + m_CustomFormatCultureCode: + m_UseCustomFormatter: 0 + m_SortOrder: 1 + references: + version: 2 + RefIds: [] diff --git a/Assets/13.Localization/English (en).asset.meta b/Assets/13.Localization/English (en).asset.meta new file mode 100644 index 000000000..8008a718b --- /dev/null +++ b/Assets/13.Localization/English (en).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ba2b82aba69b944e80ad1f44deaae84 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Global Variables Group Asset.asset b/Assets/13.Localization/Global Variables Group Asset.asset new file mode 100644 index 000000000..078d2146c --- /dev/null +++ b/Assets/13.Localization/Global Variables Group Asset.asset @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1e3e22ff9634e441a479f01f905a2f7, type: 3} + m_Name: Global Variables Group Asset + m_EditorClassIdentifier: + m_Variables: + - name: liquidE + variable: + rid: 5889118636641091764 + - name: liquidD + variable: + rid: 5889118636641091763 + - name: liquidC + variable: + rid: 5889118636641091762 + - name: liquidB + variable: + rid: 5889118636641091761 + - name: liquidA + variable: + rid: 5889118636641091755 + - name: garnish1 + variable: + rid: 5889118636641091769 + - name: garnish2 + variable: + rid: 5889118636641091770 + references: + version: 2 + RefIds: + - rid: 5889118636641091755 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: LiquidA + - rid: 5889118636641091761 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: LiquidB + - rid: 5889118636641091762 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: LiquidC + - rid: 5889118636641091763 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: LiquidD + - rid: 5889118636641091764 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: LiquidE + - rid: 5889118636641091769 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: Garnish1 + - rid: 5889118636641091770 + type: {class: StringVariable, ns: UnityEngine.Localization.SmartFormat.PersistentVariables, asm: Unity.Localization} + data: + m_Value: Garnish2 diff --git a/Assets/13.Localization/Global Variables Group Asset.asset.meta b/Assets/13.Localization/Global Variables Group Asset.asset.meta new file mode 100644 index 000000000..bd20f0bb6 --- /dev/null +++ b/Assets/13.Localization/Global Variables Group Asset.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f81887433cf7f6c4a991e214ea0eda59 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Korean (ko).asset b/Assets/13.Localization/Korean (ko).asset new file mode 100644 index 000000000..712c816ab --- /dev/null +++ b/Assets/13.Localization/Korean (ko).asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bb1838fe8befb0429646b938e757ff3, type: 3} + m_Name: Korean (ko) + m_EditorClassIdentifier: + m_Identifier: + m_Code: ko + m_Metadata: + m_Items: [] + m_LocaleName: Korean (ko) + m_CustomFormatCultureCode: + m_UseCustomFormatter: 0 + m_SortOrder: 0 + references: + version: 2 + RefIds: [] diff --git a/Assets/13.Localization/Korean (ko).asset.meta b/Assets/13.Localization/Korean (ko).asset.meta new file mode 100644 index 000000000..4750f5605 --- /dev/null +++ b/Assets/13.Localization/Korean (ko).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e69cad9a5a67a1e4cb71c511420ca0c9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Localization Settings.asset b/Assets/13.Localization/Localization Settings.asset new file mode 100644 index 000000000..bc4bbdcfe --- /dev/null +++ b/Assets/13.Localization/Localization Settings.asset @@ -0,0 +1,213 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a07b5cd0b1b829245bc8c4b6978793e8, type: 3} + m_Name: Localization Settings + m_EditorClassIdentifier: + m_StartupSelectors: + - rid: 5889118636641091584 + - rid: 5889118636641091585 + - rid: 5889118636641091586 + - rid: 5889118636641091608 + m_AvailableLocales: + rid: 5889118636641091587 + m_AssetDatabase: + rid: 5889118636641091588 + m_StringDatabase: + rid: 5889118636641091589 + m_Metadata: + m_Items: [] + m_ProjectLocaleIdentifier: + m_Code: ko + m_PreloadBehavior: 1 + m_InitializeSynchronously: 0 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } + - rid: 5889118636641091584 + type: {class: CommandLineLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_CommandLineArgument: -language= + - rid: 5889118636641091585 + type: {class: SystemLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + - rid: 5889118636641091586 + type: {class: SpecificLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_LocaleId: + m_Code: ko + - rid: 5889118636641091587 + type: {class: LocalesProvider, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + - rid: 5889118636641091588 + type: {class: LocalizedAssetDatabase, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_DefaultTableReference: + m_TableCollectionName: + m_CustomTableProvider: + rid: -2 + m_CustomTablePostprocessor: + rid: -2 + m_AsynchronousBehaviour: 0 + m_UseFallback: 0 + - rid: 5889118636641091589 + type: {class: LocalizedStringDatabase, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_DefaultTableReference: + m_TableCollectionName: + m_CustomTableProvider: + rid: -2 + m_CustomTablePostprocessor: + rid: -2 + m_AsynchronousBehaviour: 0 + m_UseFallback: 0 + m_MissingTranslationState: 1 + m_NoTranslationFoundMessage: No translation found for '{key}' in {table.TableCollectionName} + m_SmartFormat: + rid: 5889118636641091590 + - rid: 5889118636641091590 + type: {class: SmartFormatter, ns: UnityEngine.Localization.SmartFormat, asm: Unity.Localization} + data: + m_Settings: + rid: 5889118636641091591 + m_Parser: + rid: 5889118636641091592 + m_Sources: + - rid: 5889118636641091593 + - rid: 5889118636641091594 + - rid: 5889118636641091595 + - rid: 5889118636641091596 + - rid: 5889118636641091597 + - rid: 5889118636641091598 + - rid: 5889118636641091599 + m_Formatters: + - rid: 5889118636641091593 + - rid: 5889118636641091600 + - rid: 5889118636641091601 + - rid: 5889118636641091602 + - rid: 5889118636641091603 + - rid: 5889118636641091604 + - rid: 5889118636641091605 + - rid: 5889118636641091606 + - rid: 5889118636641091607 + - rid: 5889118636641091591 + type: {class: SmartSettings, ns: UnityEngine.Localization.SmartFormat.Core.Settings, asm: Unity.Localization} + data: + m_FormatErrorAction: 0 + m_ParseErrorAction: 0 + m_CaseSensitivity: 0 + m_ConvertCharacterStringLiterals: 1 + - rid: 5889118636641091592 + type: {class: Parser, ns: UnityEngine.Localization.SmartFormat.Core.Parsing, asm: Unity.Localization} + data: + m_OpeningBrace: 123 + m_ClosingBrace: 125 + m_Settings: + rid: 5889118636641091591 + m_AlphanumericSelectors: 1 + m_AllowedSelectorChars: _- + m_Operators: '[]().,' + m_AlternativeEscaping: 0 + m_AlternativeEscapeChar: 92 + - rid: 5889118636641091593 + type: {class: ListFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - list + - l + - + m_SmartSettings: + rid: 5889118636641091591 + - rid: 5889118636641091594 + type: {class: PersistentVariablesSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Groups: [] + - rid: 5889118636641091595 + type: {class: DictionarySource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 5889118636641091596 + type: {class: ValueTupleSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 5889118636641091597 + type: {class: XmlSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 5889118636641091598 + type: {class: ReflectionSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 5889118636641091599 + type: {class: DefaultSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 5889118636641091600 + type: {class: PluralLocalizationFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - plural + - p + - + m_DefaultTwoLetterISOLanguageName: en + - rid: 5889118636641091601 + type: {class: ConditionalFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - conditional + - cond + - + - rid: 5889118636641091602 + type: {class: TimeFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - timespan + - time + - t + - + m_DefaultFormatOptions: 4646 + - rid: 5889118636641091603 + type: {class: XElementFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - xelement + - xml + - x + - + - rid: 5889118636641091604 + type: {class: ChooseFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - choose + - c + m_SplitChar: 124 + - rid: 5889118636641091605 + type: {class: SubStringFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - substr + m_ParameterDelimiter: 44 + m_NullDisplayString: (null) + m_OutOfRangeBehavior: 0 + - rid: 5889118636641091606 + type: {class: IsMatchFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - ismatch + - rid: 5889118636641091607 + type: {class: DefaultFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - default + - d + - + - rid: 5889118636641091608 + type: {class: SpecificLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_LocaleId: + m_Code: en diff --git a/Assets/13.Localization/Localization Settings.asset.meta b/Assets/13.Localization/Localization Settings.asset.meta new file mode 100644 index 000000000..b5ba412d7 --- /dev/null +++ b/Assets/13.Localization/Localization Settings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 112e4950c7d9b7a429feb9bb058a93a7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/StringDataTable.csv b/Assets/13.Localization/StringDataTable.csv new file mode 100644 index 000000000..a91bc95b3 --- /dev/null +++ b/Assets/13.Localization/StringDataTable.csv @@ -0,0 +1,51 @@ +Key,Korean(ko),English(en) +"HeartSlotPlus","하트 한칸을 추가합니다.","Add one heart slot." +"HeartRecovery","하트 한칸을 회복합니다.","Recover one heart." +"FullHeartRecovery","하트 전체를 회복합니다.","Recover all hearts." +"AddLiquidB","B술 재료를 4000ml 추가합니다.","Add 4000ml of LiquidB." +"AddLiquidC","C술 재료를 4000ml 추가합니다.","Add 4000ml of LiquidC." +"AddLiquidD","D술 재료를 4000ml 추가합니다.","Add 4000ml of LiquidD." +"AddLiquidE","E술 재료를 4000ml 추가합니다.","Add 4000ml of LiquidE." +"AddGarnish1","1번 가니쉬 재료를 4000ml 추가합니다.","Add 4000ml of Garnish1." +"AddGarnish2","2번 가니쉬 재료를 4000ml 추가합니다.","Add 4000ml of Garnish2." +"AllLiquidAdd","모든 술 재료 1000ml 추가합니다.","Add all ingredients." +"ServerNpcAdd","서빙 종업원을 추가합니다.","Add a server NPC." +"CleanerNpcAdd","청소 종업원을 추가합니다.","Add a cleaner NPC." +"BartenderNpcAdd","바텐터 종업원을 추가합니다.","Add a bartender NPC." +"SpeedBoost","플레이어의 이동속도가 10% 증가합니다.","Increase movement speed by 10%." +"ExpBoost","경험치 획득량이 20% 증가합니다.","Increase EXP gain by 20%." +"GoldBoost","골드 획득 20%이 증가합니다.","Increase gold gain by 20%." +"AllCleanUp","레스토랑을 전부 청소합니다.","Clean up the restaurant." +"GaugeReset","모든 손님들의 기다림 게이지를 초기화합니다.","Reset all customer waiting gauges." +"DashCooldownReduction","플레이어의 대시 쿨타임이 1초 감소합니다.","Reduce dash cooldown time by half." +"TipBoost","팁 획득량이 20% 증가합니다.","Increase tip gain by 20%." +"EndGoldBoost","게임오버 후 획득 골드량이 10% 증가합니다.","Increase gold gain after the game by 10%." +"AllCustomerPurification","손님들을 전부 정화시킵니다.","Purify all customers." +"GaugeTimeUp","손님들의 기다림 시간이 3초 증가합니다.","Increase customer waiting time by 3 seconds." +"BarrelAutoSupply","모든 술 재료를 초당 2ml 추가로 자동 충전합니다.","Automatically refill ingredient barrels every 2 minutes." +"ServerNpcUpgrade","종업원이 서빙 중 팁 획득량이 20% 증가합니다.","Increase server NPC's tip gain by 20%." +"CleanerNpcUpgrade","종업원의 청소 시간이 1초 감소합니다.","Decrease cleaner NPC’s cleaning time by 1 second." +"BartenderNpcUpgrade","종업원의 술 제조 속도가 1초 감소합니다.","Decrease bartender NPC’s drink crafting speed by 1 second." +"PassiveDoubleServing","플레이어가 양손에 서빙이 가능해집니다.","Allow the player to serve two customers simultaneously." +"PassiveRandomChange","특정 휴지통에서 완성된 칵테일 중 랜덤으로 변경 가능해집니다.","Allow changing one completed cocktail in the inventory to a random one." +"PassiveGoldAutoGain","자동으로 60초마다 계산대의 골드를 회수합니다.","Automatically gain a set amount of gold every 60 seconds." +"PassiveMakingBonus","플레이어가 술 제조 성공 시 팁 획득량만큼 추가로 골드를 획득합니다.","Gain additional gold equal to the tip amount each time the player successfully makes a drink." +"PassiveServingBonus","플레이어가 서빙을 3번 성공할 때마다 하트를 반 개 회복합니다.","Recover half a heart each time the player successfully serves three drinks." +"PassiveCleaningBonus","플레이어가 청소를 5번 성공할 때마다 새로 제작되는 종업원의 술 제조 속도를 10초간 2배로 증가합니다.","Double the crafting speed of the cleaner NPC’s drinks for 10 seconds every time the player cleans five times successfully." +"InteractionLiquidBarrelA","{global.liquidA} 따르기","Pour {global.liquidA}" +"InteractionLiquidBarrelB","{global.liquidB} 따르기","Pour {global.liquidB}" +"InteractionLiquidBarrelC","{global.liquidC} 따르기","Pour {global.liquidC}" +"InteractionLiquidBarrelD","{global.liquidD} 따르기","Pour {global.liquidD}" +"InteractionLiquidBarrelE","{global.liquidE} 따르기","Pour {global.liquidE}" +"InteractionGarnishBarrel1","{global.garnish1} 따르기","Pour {global.garnish1}" +"InteractionGarnishBarrel2","{global.garnish2} 따르기","Pour {global.garnish2}" +"InteractionVomiting","구토 치우기","Cleaning up vomiting" +"InteractionTableSeat","책상 치우기","Cleaning up table" +"InteractionMushroom","버섯 치우기","Cleaning up mushroom" +"InteractionMoneyCounter","골드 회수하기","Money collected" +"InteractionServingTablePickUp","칵테일 들기","Pick up cocktail" +"InteractionServingTablePutDown","칵테일 내려놓기","Put down cocktail" +"InteractionCustomer","칵테일 서빙하기","Serve cocktail" +"InteractionPump","펌프 작동하기","Operate pump" +"InteractionTrashCanDiscard","칵테일 버리기","Discard cocktail" +"InteractionTrashCanChange","무작위 칵테일 변경","Change random cocktail" diff --git a/Assets/05.Prefabs/Props/Mini/Barrel.prefab.meta b/Assets/13.Localization/StringDataTable.csv.meta similarity index 62% rename from Assets/05.Prefabs/Props/Mini/Barrel.prefab.meta rename to Assets/13.Localization/StringDataTable.csv.meta index c8d391bab..875bade61 100644 --- a/Assets/05.Prefabs/Props/Mini/Barrel.prefab.meta +++ b/Assets/13.Localization/StringDataTable.csv.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 80d491129e76216469e1484503d636e4 -PrefabImporter: +guid: 06c6d0977a544f64baf3f66b9a41087c +TextScriptImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/13.Localization/Tables.meta b/Assets/13.Localization/Tables.meta new file mode 100644 index 000000000..e6cd6ec36 --- /dev/null +++ b/Assets/13.Localization/Tables.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a6d3c1a912b19444c8df56917dfc3bd8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Tables/StringDataTable Shared Data.asset b/Assets/13.Localization/Tables/StringDataTable Shared Data.asset new file mode 100644 index 000000000..b9ce75566 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable Shared Data.asset @@ -0,0 +1,232 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5b11a58205ec3474ca216360e9fa74a8, type: 3} + m_Name: StringDataTable Shared Data + m_EditorClassIdentifier: + m_TableCollectionName: StringDataTable + m_TableCollectionNameGuidString: 0f00ef9cea8f57e4e952e1881becfed7 + m_Entries: + - m_Id: 12185710637056 + m_Key: HeartSlotPlus + m_Metadata: + m_Items: [] + - m_Id: 12185765163008 + m_Key: HeartRecovery + m_Metadata: + m_Items: [] + - m_Id: 12185765163009 + m_Key: FullHeartRecovery + m_Metadata: + m_Items: [] + - m_Id: 12185765163010 + m_Key: AddLiquidB + m_Metadata: + m_Items: [] + - m_Id: 12185765163011 + m_Key: AddLiquidC + m_Metadata: + m_Items: [] + - m_Id: 12185765163012 + m_Key: AddLiquidD + m_Metadata: + m_Items: [] + - m_Id: 12185765163013 + m_Key: AddLiquidE + m_Metadata: + m_Items: [] + - m_Id: 12185765163014 + m_Key: AddGarnish1 + m_Metadata: + m_Items: [] + - m_Id: 12185765163015 + m_Key: AddGarnish2 + m_Metadata: + m_Items: [] + - m_Id: 12185765163016 + m_Key: AllLiquidAdd + m_Metadata: + m_Items: [] + - m_Id: 12185765163017 + m_Key: ServerNpcAdd + m_Metadata: + m_Items: [] + - m_Id: 12185765163018 + m_Key: CleanerNpcAdd + m_Metadata: + m_Items: [] + - m_Id: 12185765163019 + m_Key: BartenderNpcAdd + m_Metadata: + m_Items: [] + - m_Id: 12185765163020 + m_Key: SpeedBoost + m_Metadata: + m_Items: [] + - m_Id: 12185765163021 + m_Key: ExpBoost + m_Metadata: + m_Items: [] + - m_Id: 12185765163022 + m_Key: GoldBoost + m_Metadata: + m_Items: [] + - m_Id: 12185765163023 + m_Key: AllCleanUp + m_Metadata: + m_Items: [] + - m_Id: 12185765163024 + m_Key: GaugeReset + m_Metadata: + m_Items: [] + - m_Id: 12185765163025 + m_Key: DashCooldownReduction + m_Metadata: + m_Items: [] + - m_Id: 12185765163026 + m_Key: TipBoost + m_Metadata: + m_Items: [] + - m_Id: 12185765163027 + m_Key: EndGoldBoost + m_Metadata: + m_Items: [] + - m_Id: 12185765163028 + m_Key: AllCustomerPurification + m_Metadata: + m_Items: [] + - m_Id: 12185765163029 + m_Key: GaugeTimeUp + m_Metadata: + m_Items: [] + - m_Id: 12185765163030 + m_Key: BarrelAutoSupply + m_Metadata: + m_Items: [] + - m_Id: 12185765163031 + m_Key: ServerNpcUpgrade + m_Metadata: + m_Items: [] + - m_Id: 12185765163032 + m_Key: CleanerNpcUpgrade + m_Metadata: + m_Items: [] + - m_Id: 12185765163033 + m_Key: BartenderNpcUpgrade + m_Metadata: + m_Items: [] + - m_Id: 12185765163034 + m_Key: PassiveDoubleServing + m_Metadata: + m_Items: [] + - m_Id: 12185765163035 + m_Key: PassiveRandomChange + m_Metadata: + m_Items: [] + - m_Id: 12185765163036 + m_Key: PassiveGoldAutoGain + m_Metadata: + m_Items: [] + - m_Id: 12185765163037 + m_Key: PassiveMakingBonus + m_Metadata: + m_Items: [] + - m_Id: 12185765163038 + m_Key: PassiveServingBonus + m_Metadata: + m_Items: [] + - m_Id: 12185765163039 + m_Key: PassiveCleaningBonus + m_Metadata: + m_Items: [] + - m_Id: 34976455471104 + m_Key: InteractionLiquidBarrelA + m_Metadata: + m_Items: [] + - m_Id: 41071488020480 + m_Key: InteractionLiquidBarrelB + m_Metadata: + m_Items: [] + - m_Id: 41088755970048 + m_Key: InteractionLiquidBarrelC + m_Metadata: + m_Items: [] + - m_Id: 41096481878016 + m_Key: InteractionLiquidBarrelD + m_Metadata: + m_Items: [] + - m_Id: 41098067324928 + m_Key: InteractionLiquidBarrelE + m_Metadata: + m_Items: [] + - m_Id: 41099917012992 + m_Key: InteractionGarnishBarrel1 + m_Metadata: + m_Items: [] + - m_Id: 41100923645952 + m_Key: InteractionGarnishBarrel2 + m_Metadata: + m_Items: [] + - m_Id: 42020407357440 + m_Key: InteractionVomiting + m_Metadata: + m_Items: [] + - m_Id: 42907288743936 + m_Key: InteractionTableSeat + m_Metadata: + m_Items: [] + - m_Id: 43158066180096 + m_Key: InteractionMushroom + m_Metadata: + m_Items: [] + - m_Id: 43510928781312 + m_Key: InteractionMoneyCounter + m_Metadata: + m_Items: [] + - m_Id: 49661431001088 + m_Key: InteractionServingTablePickUp + m_Metadata: + m_Items: [] + - m_Id: 49720453246976 + m_Key: InteractionServingTablePutDown + m_Metadata: + m_Items: [] + - m_Id: 52080177065984 + m_Key: InteractionCustomer + m_Metadata: + m_Items: [] + - m_Id: 53404088152064 + m_Key: InteractionPump + m_Metadata: + m_Items: [] + - m_Id: 53796133941248 + m_Key: InteractionTrashCanDiscard + m_Metadata: + m_Items: [] + - m_Id: 53858801037312 + m_Key: InteractionTrashCanChange + m_Metadata: + m_Items: [] + - m_Id: 55332822069248 + m_Key: + m_Metadata: + m_Items: [] + m_Metadata: + m_Items: [] + m_KeyGenerator: + rid: 5889118636641091609 + references: + version: 2 + RefIds: + - rid: 5889118636641091609 + type: {class: DistributedUIDGenerator, ns: UnityEngine.Localization.Tables, asm: Unity.Localization} + data: + m_CustomEpoch: 1731164889532 diff --git a/Assets/13.Localization/Tables/StringDataTable Shared Data.asset.meta b/Assets/13.Localization/Tables/StringDataTable Shared Data.asset.meta new file mode 100644 index 000000000..3f9e9a66e --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable Shared Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f00ef9cea8f57e4e952e1881becfed7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Tables/StringDataTable.asset b/Assets/13.Localization/Tables/StringDataTable.asset new file mode 100644 index 000000000..174de71f6 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable.asset @@ -0,0 +1,57 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5be51871efa6c3e4eae1703925c8f5ac, type: 3} + m_Name: StringDataTable + m_EditorClassIdentifier: + m_SharedTableData: {fileID: 11400000, guid: 0f00ef9cea8f57e4e952e1881becfed7, type: 2} + m_Tables: + - {fileID: 11400000, guid: 27df9b52b15cda44296fb4f13854d384, type: 2} + - {fileID: 11400000, guid: 0803abc25fa424f45975b00068d199fd, type: 2} + m_Extensions: + - rid: 5889118636641091611 + m_Group: String Table + references: + version: 2 + RefIds: + - rid: 5889118636641091611 + type: {class: CsvExtension, ns: UnityEditor.Localization.Plugins.CSV, asm: Unity.Localization.Editor} + data: + m_Collection: {fileID: 11400000} + m_ColumnsList: + - rid: 5889118636641091612 + - rid: 5889118636641091613 + - rid: 5889118636641091614 + m_ConnectedFile: Assets/13.Localization/StringDataTable.csv + - rid: 5889118636641091612 + type: {class: KeyIdColumns, ns: UnityEditor.Localization.Plugins.CSV.Columns, asm: Unity.Localization.Editor} + data: + m_IncludeId: 0 + m_IncludeSharedComments: 0 + m_KeyFieldName: Key + m_IdFieldName: Id + m_CommentFieldName: Shared Comments + - rid: 5889118636641091613 + type: {class: LocaleColumns, ns: UnityEditor.Localization.Plugins.CSV.Columns, asm: Unity.Localization.Editor} + data: + m_LocaleIdentifier: + m_Code: ko + m_FieldName: Korean(ko) + m_CommentFieldName: Korean(ko) Comments + m_IncludeComments: 0 + - rid: 5889118636641091614 + type: {class: LocaleColumns, ns: UnityEditor.Localization.Plugins.CSV.Columns, asm: Unity.Localization.Editor} + data: + m_LocaleIdentifier: + m_Code: en + m_FieldName: English(en) + m_CommentFieldName: English(en) Comments + m_IncludeComments: 0 diff --git a/Assets/13.Localization/Tables/StringDataTable.asset.meta b/Assets/13.Localization/Tables/StringDataTable.asset.meta new file mode 100644 index 000000000..14dd30314 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eab0e1c16e753ea4abb32219a4917b06 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Tables/StringDataTable_en.asset b/Assets/13.Localization/Tables/StringDataTable_en.asset new file mode 100644 index 000000000..6e8449fd1 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable_en.asset @@ -0,0 +1,247 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3} + m_Name: StringDataTable_en + m_EditorClassIdentifier: + m_LocaleId: + m_Code: en + m_SharedData: {fileID: 11400000, guid: 0f00ef9cea8f57e4e952e1881becfed7, type: 2} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + m_TableData: + - m_Id: 12185710637056 + m_Localized: Add one heart slot. + m_Metadata: + m_Items: [] + - m_Id: 12185765163008 + m_Localized: Recover one heart. + m_Metadata: + m_Items: [] + - m_Id: 12185765163009 + m_Localized: Recover all hearts. + m_Metadata: + m_Items: [] + - m_Id: 12185765163010 + m_Localized: Add 4000ml of LiquidB. + m_Metadata: + m_Items: [] + - m_Id: 12185765163011 + m_Localized: Add 4000ml of LiquidC. + m_Metadata: + m_Items: [] + - m_Id: 12185765163012 + m_Localized: Add 4000ml of LiquidD. + m_Metadata: + m_Items: [] + - m_Id: 12185765163013 + m_Localized: Add 4000ml of LiquidE. + m_Metadata: + m_Items: [] + - m_Id: 12185765163014 + m_Localized: Add 4000ml of Garnish1. + m_Metadata: + m_Items: [] + - m_Id: 12185765163015 + m_Localized: Add 4000ml of Garnish2. + m_Metadata: + m_Items: [] + - m_Id: 12185765163016 + m_Localized: Add all ingredients. + m_Metadata: + m_Items: [] + - m_Id: 12185765163017 + m_Localized: Add a server NPC. + m_Metadata: + m_Items: [] + - m_Id: 12185765163018 + m_Localized: Add a cleaner NPC. + m_Metadata: + m_Items: [] + - m_Id: 12185765163019 + m_Localized: Add a bartender NPC. + m_Metadata: + m_Items: [] + - m_Id: 12185765163020 + m_Localized: Increase movement speed by 10%. + m_Metadata: + m_Items: [] + - m_Id: 12185765163021 + m_Localized: Increase EXP gain by 20%. + m_Metadata: + m_Items: [] + - m_Id: 12185765163022 + m_Localized: Increase gold gain by 20%. + m_Metadata: + m_Items: [] + - m_Id: 12185765163023 + m_Localized: Clean up the restaurant. + m_Metadata: + m_Items: [] + - m_Id: 12185765163024 + m_Localized: Reset all customer waiting gauges. + m_Metadata: + m_Items: [] + - m_Id: 12185765163025 + m_Localized: Reduce dash cooldown time by half. + m_Metadata: + m_Items: [] + - m_Id: 12185765163026 + m_Localized: Increase tip gain by 20%. + m_Metadata: + m_Items: [] + - m_Id: 12185765163027 + m_Localized: Increase gold gain after the game by 10%. + m_Metadata: + m_Items: [] + - m_Id: 12185765163028 + m_Localized: Purify all customers. + m_Metadata: + m_Items: [] + - m_Id: 12185765163029 + m_Localized: Increase customer waiting time by 3 seconds. + m_Metadata: + m_Items: [] + - m_Id: 12185765163030 + m_Localized: Automatically refill ingredient barrels every 2 minutes. + m_Metadata: + m_Items: [] + - m_Id: 12185765163031 + m_Localized: Increase server NPC's tip gain by 20%. + m_Metadata: + m_Items: [] + - m_Id: 12185765163032 + m_Localized: "Decrease cleaner NPC\u2019s cleaning time by 1 second." + m_Metadata: + m_Items: [] + - m_Id: 12185765163033 + m_Localized: "Decrease bartender NPC\u2019s drink crafting speed by 1 second." + m_Metadata: + m_Items: [] + - m_Id: 12185765163034 + m_Localized: Allow the player to serve two customers simultaneously. + m_Metadata: + m_Items: [] + - m_Id: 12185765163035 + m_Localized: Allow changing one completed cocktail in the inventory to a random + one. + m_Metadata: + m_Items: [] + - m_Id: 12185765163036 + m_Localized: Automatically gain a set amount of gold every 60 seconds. + m_Metadata: + m_Items: [] + - m_Id: 12185765163037 + m_Localized: Gain additional gold equal to the tip amount each time the player + successfully makes a drink. + m_Metadata: + m_Items: [] + - m_Id: 12185765163038 + m_Localized: Recover half a heart each time the player successfully serves three + drinks. + m_Metadata: + m_Items: [] + - m_Id: 12185765163039 + m_Localized: "Double the crafting speed of the cleaner NPC\u2019s drinks for + 10 seconds every time the player cleans five times successfully." + m_Metadata: + m_Items: [] + - m_Id: 34976455471104 + m_Localized: Pour {global.liquidA} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 41071488020480 + m_Localized: Pour {global.liquidB} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 41088755970048 + m_Localized: Pour {global.liquidC} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 41096481878016 + m_Localized: Pour {global.liquidD} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 41098067324928 + m_Localized: Pour {global.liquidE} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 41099917012992 + m_Localized: Pour {global.garnish1} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 41100923645952 + m_Localized: Pour {global.garnish2} + m_Metadata: + m_Items: + - rid: 5889118636641091753 + - m_Id: 42020407357440 + m_Localized: Cleaning up vomiting + m_Metadata: + m_Items: [] + - m_Id: 42907288743936 + m_Localized: Cleaning up table + m_Metadata: + m_Items: [] + - m_Id: 43158066180096 + m_Localized: Cleaning up mushroom + m_Metadata: + m_Items: [] + - m_Id: 43510928781312 + m_Localized: Money collected + m_Metadata: + m_Items: [] + - m_Id: 49661431001088 + m_Localized: Pick up cocktail + m_Metadata: + m_Items: [] + - m_Id: 49720453246976 + m_Localized: Put down cocktail + m_Metadata: + m_Items: [] + - m_Id: 52080177065984 + m_Localized: Serve cocktail + m_Metadata: + m_Items: [] + - m_Id: 53404088152064 + m_Localized: Operate pump + m_Metadata: + m_Items: [] + - m_Id: 53858801037312 + m_Localized: Change random cocktail + m_Metadata: + m_Items: [] + - m_Id: 53796133941248 + m_Localized: Discard cocktail + m_Metadata: + m_Items: [] + references: + version: 2 + RefIds: + - rid: 5889118636641091753 + type: {class: SmartFormatTag, ns: UnityEngine.Localization.Metadata, asm: Unity.Localization} + data: + m_Entries: + m_SharedEntries: + - id: 34976455471104 + - id: 41071488020480 + - id: 41088755970048 + - id: 41096481878016 + - id: 41098067324928 + - id: 41099917012992 + - id: 41100923645952 diff --git a/Assets/13.Localization/Tables/StringDataTable_en.asset.meta b/Assets/13.Localization/Tables/StringDataTable_en.asset.meta new file mode 100644 index 000000000..e15db4b48 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable_en.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0803abc25fa424f45975b00068d199fd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/13.Localization/Tables/StringDataTable_ko.asset b/Assets/13.Localization/Tables/StringDataTable_ko.asset new file mode 100644 index 000000000..22270c339 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable_ko.asset @@ -0,0 +1,260 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3} + m_Name: StringDataTable_ko + m_EditorClassIdentifier: + m_LocaleId: + m_Code: ko + m_SharedData: {fileID: 11400000, guid: 0f00ef9cea8f57e4e952e1881becfed7, type: 2} + m_Metadata: + m_Items: + - rid: 5889118636641091754 + m_TableData: + - m_Id: 12185710637056 + m_Localized: "\uD558\uD2B8 \uD55C\uCE78\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163008 + m_Localized: "\uD558\uD2B8 \uD55C\uCE78\uC744 \uD68C\uBCF5\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163009 + m_Localized: "\uD558\uD2B8 \uC804\uCCB4\uB97C \uD68C\uBCF5\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163010 + m_Localized: "B\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163011 + m_Localized: "C\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163012 + m_Localized: "D\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163013 + m_Localized: "E\uC220 \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163014 + m_Localized: "1\uBC88 \uAC00\uB2C8\uC26C \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163015 + m_Localized: "2\uBC88 \uAC00\uB2C8\uC26C \uC7AC\uB8CC\uB97C 4000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163016 + m_Localized: "\uBAA8\uB4E0 \uC220 \uC7AC\uB8CC 1000ml \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163017 + m_Localized: "\uC11C\uBE59 \uC885\uC5C5\uC6D0\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163018 + m_Localized: "\uCCAD\uC18C \uC885\uC5C5\uC6D0\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163019 + m_Localized: "\uBC14\uD150\uD130 \uC885\uC5C5\uC6D0\uC744 \uCD94\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163020 + m_Localized: "\uD50C\uB808\uC774\uC5B4\uC758 \uC774\uB3D9\uC18D\uB3C4\uAC00 10% + \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163021 + m_Localized: "\uACBD\uD5D8\uCE58 \uD68D\uB4DD\uB7C9\uC774 20% \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163022 + m_Localized: "\uACE8\uB4DC \uD68D\uB4DD 20%\uC774 \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163023 + m_Localized: "\uB808\uC2A4\uD1A0\uB791\uC744 \uC804\uBD80 \uCCAD\uC18C\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163024 + m_Localized: "\uBAA8\uB4E0 \uC190\uB2D8\uB4E4\uC758 \uAE30\uB2E4\uB9BC \uAC8C\uC774\uC9C0\uB97C + \uCD08\uAE30\uD654\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163025 + m_Localized: "\uD50C\uB808\uC774\uC5B4\uC758 \uB300\uC2DC \uCFE8\uD0C0\uC784\uC774 + 1\uCD08 \uAC10\uC18C\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163026 + m_Localized: "\uD301 \uD68D\uB4DD\uB7C9\uC774 20% \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163027 + m_Localized: "\uAC8C\uC784\uC624\uBC84 \uD6C4 \uD68D\uB4DD \uACE8\uB4DC\uB7C9\uC774 + 10% \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163028 + m_Localized: "\uC190\uB2D8\uB4E4\uC744 \uC804\uBD80 \uC815\uD654\uC2DC\uD0B5\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163029 + m_Localized: "\uC190\uB2D8\uB4E4\uC758 \uAE30\uB2E4\uB9BC \uC2DC\uAC04\uC774 + 3\uCD08 \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163030 + m_Localized: "\uBAA8\uB4E0 \uC220 \uC7AC\uB8CC\uB97C \uCD08\uB2F9 2ml \uCD94\uAC00\uB85C + \uC790\uB3D9 \uCDA9\uC804\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163031 + m_Localized: "\uC885\uC5C5\uC6D0\uC774 \uC11C\uBE59 \uC911 \uD301 \uD68D\uB4DD\uB7C9\uC774 + 20% \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163032 + m_Localized: "\uC885\uC5C5\uC6D0\uC758 \uCCAD\uC18C \uC2DC\uAC04\uC774 1\uCD08 + \uAC10\uC18C\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163033 + m_Localized: "\uC885\uC5C5\uC6D0\uC758 \uC220 \uC81C\uC870 \uC18D\uB3C4\uAC00 + 1\uCD08 \uAC10\uC18C\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163034 + m_Localized: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC591\uC190\uC5D0 \uC11C\uBE59\uC774 + \uAC00\uB2A5\uD574\uC9D1\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163035 + m_Localized: "\uD2B9\uC815 \uD734\uC9C0\uD1B5\uC5D0\uC11C \uC644\uC131\uB41C + \uCE75\uD14C\uC77C \uC911 \uB79C\uB364\uC73C\uB85C \uBCC0\uACBD \uAC00\uB2A5\uD574\uC9D1\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163036 + m_Localized: "\uC790\uB3D9\uC73C\uB85C 60\uCD08\uB9C8\uB2E4 \uACC4\uC0B0\uB300\uC758 + \uACE8\uB4DC\uB97C \uD68C\uC218\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163037 + m_Localized: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC220 \uC81C\uC870 \uC131\uACF5 + \uC2DC \uD301 \uD68D\uB4DD\uB7C9\uB9CC\uD07C \uCD94\uAC00\uB85C \uACE8\uB4DC\uB97C + \uD68D\uB4DD\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163038 + m_Localized: "\uD50C\uB808\uC774\uC5B4\uAC00 \uC11C\uBE59\uC744 3\uBC88 \uC131\uACF5\uD560 + \uB54C\uB9C8\uB2E4 \uD558\uD2B8\uB97C \uBC18 \uAC1C \uD68C\uBCF5\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 12185765163039 + m_Localized: "\uD50C\uB808\uC774\uC5B4\uAC00 \uCCAD\uC18C\uB97C 5\uBC88 \uC131\uACF5\uD560 + \uB54C\uB9C8\uB2E4 \uC0C8\uB85C \uC81C\uC791\uB418\uB294 \uC885\uC5C5\uC6D0\uC758 + \uC220 \uC81C\uC870 \uC18D\uB3C4\uB97C 10\uCD08\uAC04 2\uBC30\uB85C \uC99D\uAC00\uD569\uB2C8\uB2E4." + m_Metadata: + m_Items: [] + - m_Id: 34976455471104 + m_Localized: "{global.liquidA} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 41071488020480 + m_Localized: "{global.liquidB} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 41088755970048 + m_Localized: "{global.liquidC} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 41096481878016 + m_Localized: "{global.liquidD} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 41098067324928 + m_Localized: "{global.liquidE} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 41099917012992 + m_Localized: "{global.garnish1} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 41100923645952 + m_Localized: "{global.garnish2} \uB530\uB974\uAE30" + m_Metadata: + m_Items: + - rid: 5889118636641091754 + - m_Id: 42020407357440 + m_Localized: "\uAD6C\uD1A0 \uCE58\uC6B0\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 42907288743936 + m_Localized: "\uCC45\uC0C1 \uCE58\uC6B0\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 43158066180096 + m_Localized: "\uBC84\uC12F \uCE58\uC6B0\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 43510928781312 + m_Localized: "\uACE8\uB4DC \uD68C\uC218\uD558\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 49661431001088 + m_Localized: "\uCE75\uD14C\uC77C \uB4E4\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 49720453246976 + m_Localized: "\uCE75\uD14C\uC77C \uB0B4\uB824\uB193\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 52080177065984 + m_Localized: "\uCE75\uD14C\uC77C \uC11C\uBE59\uD558\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 53404088152064 + m_Localized: "\uD38C\uD504 \uC791\uB3D9\uD558\uAE30" + m_Metadata: + m_Items: [] + - m_Id: 53858801037312 + m_Localized: "\uBB34\uC791\uC704 \uCE75\uD14C\uC77C \uBCC0\uACBD" + m_Metadata: + m_Items: [] + - m_Id: 53796133941248 + m_Localized: "\uCE75\uD14C\uC77C \uBC84\uB9AC\uAE30" + m_Metadata: + m_Items: [] + references: + version: 2 + RefIds: + - rid: 5889118636641091754 + type: {class: SmartFormatTag, ns: UnityEngine.Localization.Metadata, asm: Unity.Localization} + data: + m_Entries: + m_SharedEntries: + - id: 34976455471104 + - id: 41071488020480 + - id: 41088755970048 + - id: 41096481878016 + - id: 41098067324928 + - id: 41099917012992 + - id: 41100923645952 diff --git a/Assets/13.Localization/Tables/StringDataTable_ko.asset.meta b/Assets/13.Localization/Tables/StringDataTable_ko.asset.meta new file mode 100644 index 000000000..8f3b6f705 --- /dev/null +++ b/Assets/13.Localization/Tables/StringDataTable_ko.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 27df9b52b15cda44296fb4f13854d384 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData.meta b/Assets/AddressableAssetsData.meta new file mode 100644 index 000000000..9c25355e7 --- /dev/null +++ b/Assets/AddressableAssetsData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae245060d824aa3458426704cfc7fd8e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/AddressableAssetsData/AddressableAssetSettings.asset new file mode 100644 index 000000000..eccb45593 --- /dev/null +++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset @@ -0,0 +1,122 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 468a46d0ae32c3544b7d98094e6448a9, type: 3} + m_Name: AddressableAssetSettings + m_EditorClassIdentifier: + m_DefaultGroup: 8e0a3b4ef79b6b240a41c854861466bc + m_currentHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_OptimizeCatalogSize: 0 + m_BuildRemoteCatalog: 0 + m_CatalogRequestsTimeout: 0 + m_DisableCatalogUpdateOnStart: 0 + m_InternalIdNamingMode: 0 + m_InternalBundleIdMode: 1 + m_AssetLoadMode: 0 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_IgnoreUnsupportedFilesInBuild: 0 + m_UniqueBundleIds: 0 + m_EnableJsonCatalog: 0 + m_NonRecursiveBuilding: 1 + m_CCDEnabled: 0 + m_maxConcurrentWebRequests: 3 + m_UseUWRForLocalBundles: 0 + m_BundleTimeout: 0 + m_BundleRetryCount: 0 + m_BundleRedirectLimit: -1 + m_SharedBundleSettings: 0 + m_SharedBundleSettingsCustomGroupIndex: 0 + m_ContiguousBundles: 1 + m_StripUnityVersionFromBundleBuild: 0 + m_DisableVisibleSubAssetRepresentations: 0 + m_BuiltInBundleNaming: 0 + mBuiltInBundleCustomNaming: + m_MonoScriptBundleNaming: 0 + m_CheckForContentUpdateRestrictionsOption: 0 + m_MonoScriptBundleCustomNaming: + m_RemoteCatalogBuildPath: + m_Id: + m_RemoteCatalogLoadPath: + m_Id: + m_ContentStateBuildPathProfileVariableName: + m_CustomContentStateBuildPath: + m_ContentStateBuildPath: + m_BuildAddressablesWithPlayerBuild: 0 + m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]' + m_GroupAssets: + - {fileID: 11400000, guid: ea10f5b03a2014b4a94a0a10d897bd88, type: 2} + - {fileID: 11400000, guid: e55b17f01dde1704983640efbd276646, type: 2} + - {fileID: 11400000, guid: 837bf01a180409d45b303bf687c55305, type: 2} + - {fileID: 11400000, guid: c6ddc027d3bf41a408deea0e1863ebc4, type: 2} + - {fileID: 11400000, guid: efd3d847c7762ee45835e0b07b6669cb, type: 2} + m_BuildSettings: + m_LogResourceManagerExceptions: 1 + m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles + m_ProfileSettings: + m_Profiles: + - m_InheritedParent: + m_Id: 306c47bf6b73999489e18f8c592475a4 + m_ProfileName: Default + m_Values: + - m_Id: 2ed562802d107df46a3918a946d34456 + m_Value: 'ServerData/[BuildTarget]' + - m_Id: 7a053b69a31ef4f47b402de21446bc4e + m_Value: + - m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]' + - m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]' + - m_Id: e6ccf7e43bdacf746b63f0047aa8b893 + m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]' + m_ProfileEntryNames: + - m_Id: 2ed562802d107df46a3918a946d34456 + m_Name: Remote.BuildPath + m_InlineUsage: 0 + - m_Id: 7a053b69a31ef4f47b402de21446bc4e + m_Name: Remote.LoadPath + m_InlineUsage: 0 + - m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_Name: Local.BuildPath + m_InlineUsage: 0 + - m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_Name: Local.LoadPath + m_InlineUsage: 0 + - m_Id: e6ccf7e43bdacf746b63f0047aa8b893 + m_Name: BuildTarget + m_InlineUsage: 0 + m_ProfileVersion: 1 + m_LabelTable: + m_LabelNames: + - default + - Locale + - Locale-ko + - Locale-en + - Preload + m_SchemaTemplates: [] + m_GroupTemplateObjects: + - {fileID: 11400000, guid: c2adc330eb3f0f847b6472910cdf00a9, type: 2} + m_InitializationObjects: [] + m_CertificateHandlerType: + m_AssemblyName: + m_ClassName: + m_ActivePlayerDataBuilderIndex: 2 + m_DataBuilders: + - {fileID: 11400000, guid: 9a857241caf51864ea979ff7a1b17183, type: 2} + - {fileID: 11400000, guid: 4225e246575e36a49bb918fbfe647cb1, type: 2} + - {fileID: 11400000, guid: 7dd6b34ed361b004ba11cd6ce55c9ca5, type: 2} + m_ActiveProfileId: 306c47bf6b73999489e18f8c592475a4 diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta b/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta new file mode 100644 index 000000000..e6e1d3279 --- /dev/null +++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d834588a5565d647a28b3027ed7f255 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroupTemplates.meta b/Assets/AddressableAssetsData/AssetGroupTemplates.meta new file mode 100644 index 000000000..ef23ddcb2 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroupTemplates.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7def03c098c8bcd43bd06991261ad1ea +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset new file mode 100644 index 000000000..2a27b84a8 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6798178080249994015 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 0} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: + m_ClassName: + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: + m_LoadPath: + m_Id: + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: + m_ClassName: + m_UseDefaultSchemaSettings: 0 + m_SelectedPathPairIndex: 0 + m_BundleNaming: 0 + m_AssetLoadMode: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3} + m_Name: Packed Assets + m_EditorClassIdentifier: + m_SchemaObjects: + - {fileID: -6798178080249994015} + - {fileID: 4813275286716781557} + m_Description: Pack assets into asset bundles. + m_Settings: {fileID: 11400000, guid: 5d834588a5565d647a28b3027ed7f255, type: 2} +--- !u!114 &4813275286716781557 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 0} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta new file mode 100644 index 000000000..add10d445 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2adc330eb3f0f847b6472910cdf00a9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups.meta b/Assets/AddressableAssetsData/AssetGroups.meta new file mode 100644 index 000000000..535ff4c6a --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b15287266a76fc64382e8a6ee9b31c40 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset new file mode 100644 index 000000000..a930b28a8 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Default Local Group + m_EditorClassIdentifier: + m_GroupName: Default Local Group + m_GUID: 8e0a3b4ef79b6b240a41c854861466bc + m_SerializeEntries: [] + m_ReadOnly: 0 + m_Settings: {fileID: 11400000, guid: 5d834588a5565d647a28b3027ed7f255, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: fb8396823dce10546b061ca4622f2b66, type: 2} + - {fileID: 11400000, guid: 22ace92b945ae1a43b8b744b5207c2f0, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta new file mode 100644 index 000000000..7fc63b5bc --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efd3d847c7762ee45835e0b07b6669cb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset new file mode 100644 index 000000000..720fb26d3 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset @@ -0,0 +1,28 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-Assets-Shared + m_EditorClassIdentifier: + m_GroupName: Localization-Assets-Shared + m_GUID: 8a47e39d9e5abb940bafad52f1e7423f + m_SerializeEntries: + - m_GUID: 0f00ef9cea8f57e4e952e1881becfed7 + m_Address: Assets/13.Localization/MyTable Shared Data.asset + m_ReadOnly: 1 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 5d834588a5565d647a28b3027ed7f255, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 2ae79ff8a5c7196408b80f3c3abac936, type: 2} + - {fileID: 11400000, guid: 4fac0f66fe2efd84a937540fc631d1e4, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta new file mode 100644 index 000000000..c28f8a994 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c6ddc027d3bf41a408deea0e1863ebc4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset b/Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset new file mode 100644 index 000000000..f8ab13e5c --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-Locales + m_EditorClassIdentifier: + m_GroupName: Localization-Locales + m_GUID: 4d4caa5b27d3bc44e9b4a58a81000b5a + m_SerializeEntries: + - m_GUID: 0ba2b82aba69b944e80ad1f44deaae84 + m_Address: English (en) + m_ReadOnly: 1 + m_SerializedLabels: + - Locale + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: e69cad9a5a67a1e4cb71c511420ca0c9 + m_Address: Korean (ko) + m_ReadOnly: 1 + m_SerializedLabels: + - Locale + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 5d834588a5565d647a28b3027ed7f255, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 236acc8cb99c9884f98830f51dc30c53, type: 2} + - {fileID: 11400000, guid: b67c7e987b43fe944bccfe91c0bcfb2e, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta new file mode 100644 index 000000000..c0a90e34d --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e55b17f01dde1704983640efbd276646 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset new file mode 100644 index 000000000..b5c71f32e --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset @@ -0,0 +1,29 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-String-Tables-English (en) + m_EditorClassIdentifier: + m_GroupName: Localization-String-Tables-English (en) + m_GUID: 6c1cfc8e806cfa54990f95cdd785dcef + m_SerializeEntries: + - m_GUID: 0803abc25fa424f45975b00068d199fd + m_Address: StringDataTable_en + m_ReadOnly: 1 + m_SerializedLabels: + - Locale-en + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 5d834588a5565d647a28b3027ed7f255, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: dc7459460c508be438b58e3ef2dd266e, type: 2} + - {fileID: 11400000, guid: 8fcbdeebeeee479418e20f84c9282520, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta new file mode 100644 index 000000000..6b9670893 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 837bf01a180409d45b303bf687c55305 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Korean (ko).asset b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Korean (ko).asset new file mode 100644 index 000000000..64392dddf --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Korean (ko).asset @@ -0,0 +1,29 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-String-Tables-Korean (ko) + m_EditorClassIdentifier: + m_GroupName: Localization-String-Tables-Korean (ko) + m_GUID: 0fc26bbb017edea439cdcc69a4b8af5f + m_SerializeEntries: + - m_GUID: 27df9b52b15cda44296fb4f13854d384 + m_Address: StringDataTable_ko + m_ReadOnly: 1 + m_SerializedLabels: + - Locale-ko + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 5d834588a5565d647a28b3027ed7f255, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 7e55a4da3a58ccc40aeb6f6525d5bafb, type: 2} + - {fileID: 11400000, guid: f7bc236a7c40ff648a25e68bb36dd2c4, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Korean (ko).asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Korean (ko).asset.meta new file mode 100644 index 000000000..2cf1f86be --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Korean (ko).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea10f5b03a2014b4a94a0a10d897bd88 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas.meta new file mode 100644 index 000000000..40e2013be --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56f97fbb44183be4d8ff14d14c724aa3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset new file mode 100644 index 000000000..fdf4ab9f0 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Default Local Group_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: efd3d847c7762ee45835e0b07b6669cb, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_LoadPath: + m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_UseDefaultSchemaSettings: 0 + m_SelectedPathPairIndex: 0 + m_BundleNaming: 0 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta new file mode 100644 index 000000000..09abb4f54 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb8396823dce10546b061ca4622f2b66 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset new file mode 100644 index 000000000..92be79276 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Default Local Group_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: efd3d847c7762ee45835e0b07b6669cb, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 000000000..5e9c4397b --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 22ace92b945ae1a43b8b744b5207c2f0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset new file mode 100644 index 000000000..9b4a463c9 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-Assets-Shared_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: c6ddc027d3bf41a408deea0e1863ebc4, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_LoadPath: + m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_UseDefaultSchemaSettings: 0 + m_SelectedPathPairIndex: 0 + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta new file mode 100644 index 000000000..f574fee1a --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ae79ff8a5c7196408b80f3c3abac936 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset new file mode 100644 index 000000000..ef0bf95cb --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-Assets-Shared_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: c6ddc027d3bf41a408deea0e1863ebc4, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 000000000..c04dad3dd --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fac0f66fe2efd84a937540fc631d1e4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset new file mode 100644 index 000000000..8e5c473f3 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-Locales_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: e55b17f01dde1704983640efbd276646, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_LoadPath: + m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_UseDefaultSchemaSettings: 0 + m_SelectedPathPairIndex: 0 + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta new file mode 100644 index 000000000..08eb45295 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 236acc8cb99c9884f98830f51dc30c53 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset new file mode 100644 index 000000000..64f23db05 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-Locales_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: e55b17f01dde1704983640efbd276646, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 000000000..3171eca99 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b67c7e987b43fe944bccfe91c0bcfb2e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset new file mode 100644 index 000000000..cc939e216 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-String-Tables-English (en)_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 837bf01a180409d45b303bf687c55305, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_LoadPath: + m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_UseDefaultSchemaSettings: 0 + m_SelectedPathPairIndex: 0 + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta new file mode 100644 index 000000000..8a77e1424 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc7459460c508be438b58e3ef2dd266e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset new file mode 100644 index 000000000..69466656f --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-String-Tables-English (en)_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 837bf01a180409d45b303bf687c55305, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 000000000..175984d9b --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8fcbdeebeeee479418e20f84c9282520 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema.asset new file mode 100644 index 000000000..132d201eb --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: ea10f5b03a2014b4a94a0a10d897bd88, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 85d4e1c73a3613a41ae47721b17d5f25 + m_LoadPath: + m_Id: da763efbac427a64b835bdc2ccaa2d25 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_UseDefaultSchemaSettings: 0 + m_SelectedPathPairIndex: 0 + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema.asset.meta new file mode 100644 index 000000000..39b505308 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e55a4da3a58ccc40aeb6f6525d5bafb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema.asset new file mode 100644 index 000000000..3495ad53d --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: ea10f5b03a2014b4a94a0a10d897bd88, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 000000000..0df9e2c4c --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-Korean (ko)_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f7bc236a7c40ff648a25e68bb36dd2c4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/DataBuilders.meta b/Assets/AddressableAssetsData/DataBuilders.meta new file mode 100644 index 000000000..dded3c889 --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bfc43962269f6cf42adb075efd48d012 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset new file mode 100644 index 000000000..50d30dc58 --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88d21199f5d473f4db36845f2318f180, type: 3} + m_Name: BuildScriptFastMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta new file mode 100644 index 000000000..a33286bb4 --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a857241caf51864ea979ff7a1b17183 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset new file mode 100644 index 000000000..ec875f943 --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3e2e0ffa088c91d41a086d0b8cb16bdc, type: 3} + m_Name: BuildScriptPackedMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta new file mode 100644 index 000000000..f3271a759 --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7dd6b34ed361b004ba11cd6ce55c9ca5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset new file mode 100644 index 000000000..762884519 --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ad8c280d42ee0ed41a27db23b43dd2bf, type: 3} + m_Name: BuildScriptPackedPlayMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta new file mode 100644 index 000000000..e3e6efe6d --- /dev/null +++ b/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4225e246575e36a49bb918fbfe647cb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/DefaultObject.asset b/Assets/AddressableAssetsData/DefaultObject.asset new file mode 100644 index 000000000..0045f4ba6 --- /dev/null +++ b/Assets/AddressableAssetsData/DefaultObject.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a189bb168d8d90478a09ea08c2f3d72, type: 3} + m_Name: DefaultObject + m_EditorClassIdentifier: + m_AddressableAssetSettingsGuid: 5d834588a5565d647a28b3027ed7f255 diff --git a/Assets/AddressableAssetsData/DefaultObject.asset.meta b/Assets/AddressableAssetsData/DefaultObject.asset.meta new file mode 100644 index 000000000..e075a3a26 --- /dev/null +++ b/Assets/AddressableAssetsData/DefaultObject.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f03eb8afe743ba2408eba2f226d4915f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset b/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset index edc10923d..734e891b8 100644 --- a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset +++ b/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset @@ -48,6 +48,8 @@ MonoBehaviour: - sc.stylizedwater2.runtime - SingularityGroup.HotReload.Runtime - SingularityGroup.HotReload.Runtime.Public + - Sirenix.OdinInspector.Modules.Unity.Addressables + - Sirenix.OdinInspector.Modules.UnityLocalization - spine-csharp - spine-timeline - spine-unity diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset index 34d5c6f52..b5b6b057c 100644 --- a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset @@ -15,5 +15,9 @@ MonoBehaviour: configurations: - ID: Unity.Mathematics ActivationSettings: 0 + - ID: Unity.Localization + ActivationSettings: 0 + - ID: Unity.Addressables + ActivationSettings: 0 ModuleTogglingSettings: 1 ModuleUpdateSettings: 1 diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.meta new file mode 100644 index 000000000..cca95bd93 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7264c703b339c141976b0f32b50383f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs new file mode 100644 index 000000000..dbf783fbf --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs @@ -0,0 +1,1276 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using Sirenix.OdinInspector; +using UnityEngine; + +[assembly: RegisterAssetReferenceAttributeForwardToChild(typeof(InlineEditorAttribute))] +[assembly: RegisterAssetReferenceAttributeForwardToChild(typeof(PreviewFieldAttribute))] + +namespace Sirenix.OdinInspector +{ + using System.Diagnostics; + + /// + /// DisallowAddressableSubAssetField is used on AssetReference properties, and disallows and prevents assigned sub-assets to the asset reference. + /// + /// + /// + /// [DisallowAddressableSubAssetField] + /// public AssetReference Reference; + /// + /// + /// + /// + [Conditional("UNITY_EDITOR")] + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.ReturnValue | AttributeTargets.Parameter)] + public class DisallowAddressableSubAssetFieldAttribute : Attribute + { + } + + /// + /// Registers an attribute to be applied to an AssetRefenece property, to be forwarded and applied to the AssetReference's child instead. + /// This allows attributes designed for use on UnityEngine.Objects to be used on AssetReference properties as well. + /// By default, InlineEditorAttribute and PreviewFieldAttribute are registered for forwarding. + /// + /// + /// + /// [assembly: Sirenix.OdinInspector.Modules.RegisterAssetReferenceAttributeForwardToChild(typeof(InlineEditorAttribute))] + /// [assembly: Sirenix.OdinInspector.Modules.RegisterAssetReferenceAttributeForwardToChild(typeof(PreviewFieldAttribute))] + /// + /// + /// + [Conditional("UNITY_EDITOR")] + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public class RegisterAssetReferenceAttributeForwardToChildAttribute : Attribute // TODO: Should this be a global attribute? + { + /// + /// The type of the attribute to forward. + /// + public readonly Type AttributeType; + + /// + /// Registers the specified attribute to be copied and applied to the AssetReference's UnityEngine.Object child instead. + /// + /// The attribute type to forward. + public RegisterAssetReferenceAttributeForwardToChildAttribute(Type attributeType) + { + this.AttributeType = attributeType; + } + } +} + +#if UNITY_EDITOR +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + using Sirenix.OdinInspector.Editor; + using Sirenix.Serialization; + using Sirenix.Utilities; + using Sirenix.Utilities.Editor; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using UnityEditor; + using UnityEditor.AddressableAssets; + using UnityEditor.AddressableAssets.Settings; + using UnityEditor.AddressableAssets.GUI; + using UnityEngine; + using UnityEngine.AddressableAssets; + using System.Runtime.Serialization; + using System.IO; + + /// + /// Draws an AssetReference property. + /// + /// The concrete type of AssetReference to be drawn. For example, AssetReferenceTexture. + [DrawerPriority(0, 1, 0)] + public class AssetReferenceDrawer : OdinValueDrawer, IDefinesGenericMenuItems + where T : AssetReference + { + private bool hideAssetReferenceField; + private Type targetType; + private string NoneSelectedLabel; + //private string[] labelRestrictions; + private bool disallowSubAssets; + private bool showSubAssetField; + + private bool updateShowSubAssetField; + + private List restrictions; + + protected override bool CanDrawValueProperty(InspectorProperty property) + { + return property.GetAttribute() == null; + } + + protected override void Initialize() + { + // If a child exists, we draw that child instead of the AssetReference field. + if (this.Property.Children.Count > 0) + { + this.hideAssetReferenceField = true; + return; + } + + this.targetType = OdinAddressableUtility.GetAssetReferenceTargetType(typeof(T)); + + if (this.targetType == typeof(UnityEngine.Object)) + { + this.NoneSelectedLabel = "None (Addressable Asset)"; + } + else + { + this.NoneSelectedLabel = $"None (Addressable {this.targetType.GetNiceName()})"; + } + + this.restrictions = new List(); + foreach (var attr in this.Property.Attributes) + { + if (attr is AssetReferenceUIRestriction r) + { + this.restrictions.Add(r); + } + } + + this.disallowSubAssets = Property.GetAttribute() != null; + + this.updateShowSubAssetField = true; + } + + protected override void DrawPropertyLayout(GUIContent label) + { + if (this.hideAssetReferenceField == false) + { + var value = ValueEntry.SmartValue; + + // Update showSubAssetField. + if (this.updateShowSubAssetField && Event.current.type == EventType.Layout) + { + if (value == null || value.AssetGUID == null || value.editorAsset == null) + { + this.showSubAssetField = false; + } + else if (string.IsNullOrEmpty(value.SubObjectName) == false) + { + this.showSubAssetField = true; + } + else if (this.disallowSubAssets) + { + this.showSubAssetField = false; + } + else + { + var path = AssetDatabase.GUIDToAssetPath(value.AssetGUID); + + if (path == null) + { + this.showSubAssetField = false; + } + else + { + this.showSubAssetField = AssetDatabase.LoadAllAssetRepresentationsAtPath(path).Length > 0; + } + } + + this.updateShowSubAssetField = false; + } + + var rect = SirenixEditorGUI.GetFeatureRichControlRect(label, out var controlId, out var _, out var valueRect); + + Rect mainRect = valueRect; + Rect subRect = default, subPickerRect = default; + + if (this.showSubAssetField) + { + subRect = mainRect.Split(1, 2).AddX(1); + mainRect = mainRect.Split(0, 2).SubXMax(1); + subPickerRect = subRect.AlignRight(16); + } + + var mainPickerRect = mainRect.AlignRight(16); + + // Cursor + EditorGUIUtility.AddCursorRect(mainPickerRect, MouseCursor.Link); + if (showSubAssetField) + { + EditorGUIUtility.AddCursorRect(subPickerRect, MouseCursor.Link); + } + + // Selector + if (GUI.Button(mainPickerRect, "", SirenixGUIStyles.None)) + { + OpenMainAssetSelector(valueRect); + } + if (showSubAssetField && GUI.Button(subPickerRect, "", SirenixGUIStyles.None)) + { + OpenSubAssetSelector(valueRect); + } + + // Ping + if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && mainRect.Contains(Event.current.mousePosition) && value != null && value.editorAsset != null) + { + EditorGUIUtility.PingObject(value.editorAsset); + } + + // Drag and drop + EditorGUI.BeginChangeCheck(); + var drop = DragAndDropUtilities.DropZone(rect, null, typeof(object), false, controlId); + if (EditorGUI.EndChangeCheck()) + { + T dropValue; + + if (!object.ReferenceEquals(drop, null) + && ConvertUtility.TryWeakConvert(drop, targetType, out object converted) + && converted is UnityEngine.Object obj + && obj != null) + { + dropValue = CreateAssetReferenceFrom(obj); + } + else + { + dropValue = drop as T; + } + + if (dropValue != null) + { + if (this.disallowSubAssets && string.IsNullOrEmpty(dropValue.SubObjectName) == false) + { + dropValue.SubObjectName = null; + } + + this.updateShowSubAssetField = true; + this.ValueEntry.SmartValue = dropValue; + } + } + + // Drawing + if (Event.current.type == EventType.Repaint) + { + GUIContent valueLabel; + if (value == null || string.IsNullOrEmpty(value.AssetGUID) || value.editorAsset == null) + { + valueLabel = GUIHelper.TempContent(NoneSelectedLabel); + } + else + { + valueLabel = GUIHelper.TempContent(value.editorAsset.name, AssetPreview.GetMiniThumbnail(value.editorAsset)); + } + + GUI.Label(mainRect, valueLabel, EditorStyles.objectField); + SdfIcons.DrawIcon(mainPickerRect.SetWidth(12), SdfIconType.Record2); + + if (this.showSubAssetField) + { + if (string.IsNullOrEmpty(value.SubObjectName) || value.editorAsset == null) + { + valueLabel = GUIHelper.TempContent(""); + } + else + { + valueLabel = GUIHelper.TempContent(value.SubObjectName); + } + + GUI.Label(subRect, valueLabel, EditorStyles.objectField); + SdfIcons.DrawIcon(subPickerRect.SetWidth(12), SdfIconType.Record2); + } + } + } + else + { + this.Property.Children[0].Draw(label); + } + } + + private void OpenMainAssetSelector(Rect rect) + { + var selector = new AddressableSelector("Select", this.targetType, this.restrictions, typeof(T)); + + selector.SelectionChanged += OnMainAssetSelect; + selector.SelectionConfirmed += OnMainAssetSelect; + + selector.ShowInPopup(rect); + } + + private void OpenSubAssetSelector(Rect rect) + { + if (this.ValueEntry.SmartValue == null || this.ValueEntry.SmartValue.AssetGUID == null) + return; + + var path = AssetDatabase.GUIDToAssetPath(this.ValueEntry.SmartValue.AssetGUID); + if (path == null) + return; + + var subAssets = AssetDatabase.LoadAllAssetRepresentationsAtPath(path); + + var items = new GenericSelectorItem[subAssets.Length + 1]; + items[0] = new GenericSelectorItem("", null); + for (int i = 0; i < subAssets.Length; i++) + { + items[i + 1] = new GenericSelectorItem(subAssets[i].name + " : " + subAssets[i].GetType().GetNiceName(), subAssets[i]); + } + + var selector = new GenericSelector("Select Sub Asset", false, items); + + selector.SelectionChanged += OnSubAssetSelect; + selector.SelectionConfirmed += OnSubAssetSelect; + + selector.ShowInPopup(rect); + } + + private void OnMainAssetSelect(IEnumerable selection) + { + var selected = selection.FirstOrDefault(); + this.ValueEntry.SmartValue = CreateAssetReferenceFrom(selected); + this.updateShowSubAssetField = true; + } + + private void OnSubAssetSelect(IEnumerable selection) + { + if (this.ValueEntry == null || this.ValueEntry.SmartValue.AssetGUID == null) + return; + + var selected = selection.FirstOrDefault(); + + this.ValueEntry.SmartValue.SetEditorSubObject(selected); + } + + private T CreateAssetReferenceFrom(AddressableAssetEntry entry) + { + if (entry != null) + { + return CreateAssetReferenceFrom(entry.TargetAsset); + } + else + { + return null; + } + } + + private T CreateAssetReferenceFrom(UnityEngine.Object obj) + { + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)); + + if (guid == null) return null; + + var instance = (T)Activator.CreateInstance(typeof(T), guid); + + if (this.disallowSubAssets == false && AssetDatabase.IsSubAsset(obj)) + { + instance.SetEditorSubObject(obj); + } + + return instance; + } + + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + genericMenu.AddItem(new GUIContent("Set To Null"), false, () => + { + this.ValueEntry.WeakSmartValue = null; + this.updateShowSubAssetField = true; + }); + + if (this.ValueEntry.SmartValue != null && string.IsNullOrEmpty(this.ValueEntry.SmartValue.SubObjectName) == false) + { + genericMenu.AddItem(new GUIContent("Remove Sub Asset"), false, () => + { + if (this.ValueEntry.SmartValue != null) + { + this.ValueEntry.SmartValue.SetEditorSubObject(null); + } + this.updateShowSubAssetField = true; + }); + } + else + { + genericMenu.AddDisabledItem(new GUIContent("Remove Sub Asset")); + } + + genericMenu.AddItem(new GUIContent("Open Groups Window"), false, OdinAddressableUtility.OpenGroupsWindow); + } + } + + /// + /// Draws an AssetLabelReference field. + /// + [DrawerPriority(0, 1, 0)] + public class AssetLabelReferenceDrawer : OdinValueDrawer, IDefinesGenericMenuItems + { + protected override bool CanDrawValueProperty(InspectorProperty property) + { + return property.GetAttribute() == null; + } + + protected override void DrawPropertyLayout(GUIContent label) + { + var rect = SirenixEditorGUI.GetFeatureRichControlRect(label, out var controlId, out var hasKeyboardFocus, out var valueRect); + + string valueLabel; + if (this.ValueEntry.SmartValue == null || string.IsNullOrEmpty(this.ValueEntry.SmartValue.labelString)) + { + valueLabel = ""; + } + else + { + valueLabel = this.ValueEntry.SmartValue.labelString; + } + + if (GUI.Button(valueRect, valueLabel, EditorStyles.popup)) + { + var selector = new AddressableLabelSelector(); + + selector.SelectionChanged += SetLabel; + selector.SelectionConfirmed += SetLabel; + + selector.ShowInPopup(valueRect); + } + } + + private void SetLabel(IEnumerable selection) + { + var selected = selection.FirstOrDefault(); + this.ValueEntry.SmartValue = new AssetLabelReference() + { + labelString = selected, + }; + } + + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + genericMenu.AddItem(new GUIContent("Set To Null"), false, () => property.ValueEntry.WeakSmartValue = null); + genericMenu.AddItem(new GUIContent("Open Label Window"), false, () => OdinAddressableUtility.OpenLabelsWindow()); + } + } + + /// + /// Odin Selector for Addressables. + /// + public class AddressableSelector : OdinSelector + { + //private static EditorPrefBool flatten = new EditorPrefBool("AddressablesSelector.Flatten", false); + + private static EditorPrefEnum listMode = new EditorPrefEnum("AddressablesSelector.ListMode", SelectorListMode.Group); + + private readonly string title; + private readonly Type filterType; + private readonly List restrictions; + private readonly AssetReference assetReferenceForValidating; + + public override string Title => this.title; + + /// + /// Initializes a AddressableSelector. + /// + /// The title of the selector. Set to null for no title. + /// The type of UnityEngine.Object to be selectable. For example, UnityEngine.Texture. For no restriction, set to UnityEngine.Object. + /// The Addressable labels to restrict the selector to. Set to null for no label restrictions. + /// Throws if the filter type is null. + public AddressableSelector(string title, Type filterType, List restrictions, Type assetReferenceType) + { + this.title = title; + this.filterType = filterType ?? throw new ArgumentNullException(nameof(filterType)); + this.restrictions = restrictions; + + if (assetReferenceType != null) + { + if (assetReferenceType.InheritsFrom() == false) + { + throw new ArgumentException("Must inherit AssetReference", nameof(assetReferenceType)); + } + else if (assetReferenceType.IsAbstract) + { + throw new ArgumentException("Cannot be abstract type.", nameof(assetReferenceType)); + } + + this.assetReferenceForValidating = (AssetReference)FormatterServices.GetUninitializedObject(assetReferenceType); + } + } + + protected override void DrawToolbar() + { + bool drawTitle = !string.IsNullOrEmpty(this.Title); + bool drawSearchToolbar = this.SelectionTree.Config.DrawSearchToolbar; + bool drawButton = this.DrawConfirmSelectionButton; + + if (drawTitle || drawSearchToolbar || drawButton) + { + SirenixEditorGUI.BeginHorizontalToolbar(this.SelectionTree.Config.SearchToolbarHeight); + { + DrawToolbarTitle(); + DrawToolbarSearch(); + EditorGUI.DrawRect(GUILayoutUtility.GetLastRect().AlignLeft(1), SirenixGUIStyles.BorderColor); + + SdfIconType icon; + if (listMode.Value == SelectorListMode.Path) + icon = SdfIconType.ListNested; + else if (listMode.Value == SelectorListMode.Group) + icon = SdfIconType.ListStars; + else if (listMode.Value == SelectorListMode.Flat) + icon = SdfIconType.List; + else + icon = SdfIconType.X; + + if (SirenixEditorGUI.ToolbarButton(icon, true)) + { + int m = (int)listMode.Value + 1; + + if (m >= (int)SelectorListMode.Max) + { + m = 0; + } + + listMode.Value = (SelectorListMode)m; + + this.RebuildMenuTree(); + } + + if (SirenixEditorGUI.ToolbarButton(SdfIconType.GearFill, true)) + { + OdinAddressableUtility.OpenGroupsWindow(); + } + + DrawToolbarConfirmButton(); + } + SirenixEditorGUI.EndHorizontalToolbar(); + } + } + + protected override void BuildSelectionTree(OdinMenuTree tree) + { + OdinMenuItem noneItem; + if (filterType == typeof(UnityEngine.Object)) + { + noneItem = new OdinMenuItem(tree, " (Addressable Asset)", null); + } + else + { + noneItem = new OdinMenuItem(tree, $" (Addressable {filterType.GetNiceName()})", null); + } + + noneItem.SdfIcon = SdfIconType.X; + tree.MenuItems.Add(noneItem); + tree.Config.SelectMenuItemsOnMouseDown = true; + + if (AddressableAssetSettingsDefaultObject.SettingsExists) + { + var settings = AddressableAssetSettingsDefaultObject.Settings; + + foreach (var group in settings.groups) + { + if (group == null || group.name == "Built In Data") continue; + + foreach (var entry in group.entries) + { + AddEntriesToTree(tree, group.name, entry); + } + } + } + + foreach (var i in tree.EnumerateTree().Skip(1)) + { + if (i.Value == null) + { + i.SdfIcon = SdfIconType.Folder; + } + } + } + + private void AddEntriesToTree(OdinMenuTree tree, string groupName, AddressableAssetEntry entry) + { + var asset = entry.TargetAsset; + + if (entry.IsFolder == false && asset.GetType().InheritsFrom(filterType) && PassesRestrictions(entry)) + { + string name; + if (listMode.Value == SelectorListMode.Group) + { + name = entry.address; + } + else if (listMode.Value == SelectorListMode.Path) + { + name = System.IO.Path.GetFileNameWithoutExtension(entry.AssetPath); + } + else if (listMode.Value == SelectorListMode.Flat) + { + name = entry.address; + } + else + { + throw new Exception("Unsupported list mode: " + listMode.Value); + } + + var item = new OdinMenuItem(tree, name, entry) + { + Icon = AssetPreview.GetMiniThumbnail(asset) + }; + + if (listMode.Value == SelectorListMode.Group) + { + OdinMenuItem groupItem = tree.GetMenuItem(groupName); + + if (groupItem == null) + { + groupItem = new OdinMenuItem(tree, groupName, null); + tree.MenuItems.Add(groupItem); + } + + if (entry.ParentEntry != null && entry.ParentEntry.IsFolder) + { + OdinMenuItem folderItem = null; + + for (int i = 0; i < groupItem.ChildMenuItems.Count; i++) + { + if (groupItem.ChildMenuItems[i].Name == entry.ParentEntry.address) + { + folderItem = groupItem.ChildMenuItems[i]; + break; + } + } + + if (folderItem == null) + { + folderItem = new OdinMenuItem(tree, entry.ParentEntry.address, null); + groupItem.ChildMenuItems.Add(folderItem); + } + + folderItem.ChildMenuItems.Add(item); + } + else + { + groupItem.ChildMenuItems.Add(item); + } + } + else if (listMode.Value == SelectorListMode.Path) + { + tree.AddMenuItemAtPath(System.IO.Path.GetDirectoryName(entry.AssetPath), item); + } + else if (listMode.Value == SelectorListMode.Flat) + { + tree.MenuItems.Add(item); + + } + } + + if (entry.IsFolder) + { + foreach (var e in entry.SubAssets) + { + AddEntriesToTree(tree, groupName, e); + } + } + } + + private bool PassesRestrictions(AddressableAssetEntry entry) + { + if (restrictions == null) return true; + + return OdinAddressableUtility.ValidateAssetReferenceRestrictions(restrictions, entry.MainAsset); + + //for (int i = 0; i < this.restrictions.Count; i++) + //{ + // if (this.restrictions[i].ValidateAsset(entry.AssetPath) == false) + // { + // return false; + // } + //} + + //return true; + + /* If for whatever reason Unity haven't actually implemented their restriction methods, then we can use this code to atleast implement label restriction. */ + //if (this.labelRestrictions == null) return true; + + //for (int i = 0; i < labelRestrictions.Length; i++) + //{ + // if (entry.labels.Contains(labelRestrictions[i])) return true; + //} + + //return false; + } + + private enum SelectorListMode + { + Group, + Path, + Flat, + + Max, + } + } + + public class AddressableLabelSelector : OdinSelector + { + protected override void DrawToolbar() + { + bool drawTitle = !string.IsNullOrEmpty(this.Title); + bool drawSearchToolbar = this.SelectionTree.Config.DrawSearchToolbar; + bool drawButton = this.DrawConfirmSelectionButton; + + if (drawTitle || drawSearchToolbar || drawButton) + { + SirenixEditorGUI.BeginHorizontalToolbar(this.SelectionTree.Config.SearchToolbarHeight); + { + DrawToolbarTitle(); + DrawToolbarSearch(); + EditorGUI.DrawRect(GUILayoutUtility.GetLastRect().AlignLeft(1), SirenixGUIStyles.BorderColor); + + if (SirenixEditorGUI.ToolbarButton(SdfIconType.GearFill, true)) + { + OdinAddressableUtility.OpenLabelsWindow(); + } + + DrawToolbarConfirmButton(); + } + SirenixEditorGUI.EndHorizontalToolbar(); + } + } + protected override void BuildSelectionTree(OdinMenuTree tree) + { + IList labels = null; + + if (AddressableAssetSettingsDefaultObject.SettingsExists) + { + var settings = AddressableAssetSettingsDefaultObject.Settings; + labels = settings.GetLabels(); + } + + if (labels == null) labels = Array.Empty(); + + tree.MenuItems.Add(new OdinMenuItem(tree, "", null)); + + for (int i = 0; i < labels.Count; i++) + { + tree.MenuItems.Add(new OdinMenuItem(tree, labels[i], labels[i])); + } + } + } + + /// + /// Resolves children for AssetReference properties, and implements the RegisterAssetReferenceAttributeForwardToChild behaviour. + /// + /// The concrete type of AssetReference to be drawn. For example, AssetReferenceTexture. + public class AssetReferencePropertyResolver : OdinPropertyResolver + where T : AssetReference + { + private static readonly Type[] attributesToForward; + + static AssetReferencePropertyResolver() + { + attributesToForward = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(x => x.GetCustomAttributes()) + .Cast() + .Select(x => x.AttributeType) + .ToArray(); + } + + public override int ChildNameToIndex(string name) + { + return 0; + } + + public override int ChildNameToIndex(ref StringSlice name) + { + return 0; + } + + public override InspectorPropertyInfo GetChildInfo(int childIndex) + { + var targetType = OdinAddressableUtility.GetAssetReferenceTargetType(typeof(T)); + var getterSetterType = typeof(AssetReferenceValueGetterSetter<>).MakeGenericType(typeof(T), targetType); + + var getterSetter = Activator.CreateInstance(getterSetterType) as IValueGetterSetter; + + List attributes = new List + { + new ShowInInspectorAttribute(), + }; + + foreach (var type in attributesToForward) + { + var attr = this.Property.Attributes.FirstOrDefault(x => x.GetType() == type); + if (attr != null) + { + attributes.Add(attr); + } + } + + string label = "Asset"; + + return InspectorPropertyInfo.CreateValue(label, 0, SerializationBackend.None, getterSetter, attributes); + } + + protected override int GetChildCount(T value) + { + foreach (var attr in attributesToForward) + { + if (this.Property.Attributes.Any(x => x.GetType() == attr)) + { + return 1; + } + } + + return 0; + } + + private class AssetReferenceValueGetterSetter : IValueGetterSetter + where TTarget : UnityEngine.Object + { + public bool IsReadonly => false; + + public Type OwnerType => typeof(T); + + public Type ValueType => typeof(TTarget); + + public TTarget GetValue(ref T owner) + { + var v = owner.editorAsset; + return v as TTarget; + } + + public object GetValue(object owner) + { + var v = (owner as T)?.editorAsset; + return v as TTarget; + } + + public void SetValue(ref T owner, TTarget value) + { + owner.SetEditorAsset(value); + } + + public void SetValue(object owner, object value) + { + (owner as T).SetEditorAsset(value as TTarget); + } + } + } + + /// + /// Processes attributes for AssetReference properties. + /// + /// The concrete type of AssetReference to be drawn. For example, AssetReferenceTexture. + public class AssetReferenceAttributeProcessor : OdinAttributeProcessor + where T : AssetReference + { + public override void ProcessSelfAttributes(InspectorProperty property, List attributes) + { + attributes.Add(new DoNotDrawAsReferenceAttribute()); + attributes.Add(new HideReferenceObjectPickerAttribute()); + attributes.Add(new SuppressInvalidAttributeErrorAttribute()); // TODO: Remove this with proper attribute forwarding support. + } + } + + /// + /// Processes attributes for AssetLabelReference properties. + /// + public class AssetLabelReferenceAttributeProcessor : OdinAttributeProcessor + { + public override void ProcessSelfAttributes(InspectorProperty property, List attributes) + { + attributes.Add(new DoNotDrawAsReferenceAttribute()); + attributes.Add(new HideReferenceObjectPickerAttribute()); + } + } + + /// + /// Implements conversion behaviour for addressables. + /// + [InitializeOnLoad] + internal class AssetReferenceConverter : ConvertUtility.ICustomConverter + { + private readonly Type type_AssetEntryTreeViewItem; + private WeakValueGetter get_AssetEntryTreeViewItem_entry; + + static AssetReferenceConverter() + { + ConvertUtility.AddCustomConverter(new AssetReferenceConverter()); + } + + public AssetReferenceConverter() + { + this.type_AssetEntryTreeViewItem = TwoWaySerializationBinder.Default.BindToType("UnityEditor.AddressableAssets.GUI.AssetEntryTreeViewItem") ?? throw new Exception("Failed to find UnityEditor.AddressableAssets.GUI.AddressableAssetEntryTreeViewItem type."); + var field_AssetEntryTreeViewItem_entry = type_AssetEntryTreeViewItem.GetField("entry", Flags.AllMembers) ?? throw new Exception("Failed to find entry field in UnityEditor.AddressableAssets.GUI.AddressableAssetEntryTreeViewItem type."); + this.get_AssetEntryTreeViewItem_entry = EmitUtilities.CreateWeakInstanceFieldGetter(type_AssetEntryTreeViewItem, field_AssetEntryTreeViewItem_entry); + } + + // UnityEngine.Object > AssetReference/T + // AddressableAssetEntry > AssetReference + // AssetReference/T > UnityEngine.Object + // AssetReference/T > AssetReference/T + // AddressableAssetEntry > UnityEngine.Object + + public bool CanConvert(Type from, Type to) + { + var comparer = FastTypeComparer.Instance; + + if (to.InheritsFrom(typeof(AssetReference))) + { + if (comparer.Equals(from, typeof(AddressableAssetEntry)) || comparer.Equals(from, type_AssetEntryTreeViewItem)) + { + return true; + } + else if (from.InheritsFrom()) + { + if (to.InheritsFrom(typeof(AssetReferenceT<>))) + { + var baseType = to.GetGenericBaseType(typeof(AssetReferenceT<>)); + + var targetType = baseType.GetGenericArguments()[0]; + + return from.InheritsFrom(targetType); + } + else + { + return true; + } + } + else if (from.InheritsFrom(typeof(AssetReference))) + { + return to.InheritsFrom(from); + } + else + { + return false; + } + } + else if (from.InheritsFrom(typeof(AssetReference)) && to.InheritsFrom()) + { + return false; + } + else + { + return false; + } + } + + public bool TryConvert(object obj, Type to, out object result) + { + if (obj == null) + { + result = null; + return false; + } + + var comparer = FastTypeComparer.Instance; + + // AssetEntryTreeViewItems is a UI element container for AddressableAssetEntry. + // With this we can just treat AssetEntryTreeViewItems as an AddressableAssetEntry. + if (comparer.Equals(obj.GetType(), type_AssetEntryTreeViewItem)) + { + obj = get_AssetEntryTreeViewItem_entry(ref obj); + } + + if (to.InheritsFrom(typeof(AssetReference))) + { + Type assetType; + if (to.InheritsFrom(typeof(AssetReferenceT<>))) + { + var baseType = to.GetGenericBaseType(typeof(AssetReferenceT<>)); + assetType = baseType.GetGenericArguments()[0]; + } + else + { + assetType = typeof(UnityEngine.Object); + } + + if (obj is UnityEngine.Object uObj) + { + if (obj.GetType().InheritsFrom(assetType)) + { + string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(uObj)); + + if (string.IsNullOrEmpty(guid) == false) + { + + result = CreateReference(to, uObj); + return true; + } + else + { + result = null; + return false; + } + } + else + { + result = null; + return false; + } + } + else if (obj is AddressableAssetEntry entry) + { + if (entry.TargetAsset.GetType().InheritsFrom(assetType)) + { + result = CreateReference(to, entry.TargetAsset); + return true; + + } + else + { + result = null; + return false; + } + } + else if (obj is AssetReference reference) + { + if (TryGetReferencedAsset(reference, assetType, out var asset)) + { + result = CreateReference(to, asset); + return true; + } + else + { + result = null; + return false; + } + } + else + { + result = null; + return false; + } + } + else if (to.InheritsFrom(typeof(UnityEngine.Object)) && obj is AssetReference reference) + { + if (TryGetReferencedAsset(reference, to, out var asset)) + { + result = asset; + return true; + } + else + { + result = null; + return false; + } + } + else if (to.InheritsFrom(typeof(UnityEngine.Object)) && obj is AddressableAssetEntry entry) + { + var target = entry.TargetAsset; + if (target == null) + { + result = null; + return false; + } + else if (target.GetType().InheritsFrom(to)) + { + result = target; + return true; + } + else if (ConvertUtility.TryWeakConvert(target, to, out var converted)) + { + result = converted; + return true; + } + else + { + result = null; + return false; + } + } + else + { + result = null; + return false; + } + } + + private bool TryGetReferencedAsset(AssetReference reference, Type to, out UnityEngine.Object asset) + { + if (reference.AssetGUID == null) + { + asset = null; + return false; + } + + var path = AssetDatabase.GUIDToAssetPath(reference.AssetGUID); + + if (reference.SubObjectName != null) + { + asset = null; + var subassets = AssetDatabase.LoadAllAssetRepresentationsAtPath(path); + + for (int i = 0; i < subassets.Length; i++) + { + if (subassets[i].name == reference.SubObjectName) + { + asset = subassets[i]; + break; + } + } + } + else + { + asset = AssetDatabase.LoadAssetAtPath(path); + } + + if (asset != null) + { + if (asset.GetType().InheritsFrom(to)) + { + return true; + } + else if (ConvertUtility.TryWeakConvert(asset, to, out var converted)) + { + asset = (UnityEngine.Object)converted; + return true; + } + else + { + asset = null; + return false; + } + } + else + { + return false; + } + } + + private AssetReference CreateReference(Type type, UnityEngine.Object obj) + { + var reference = (AssetReference)Activator.CreateInstance(type, new string[] { AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)) }); + if (AssetDatabase.IsSubAsset(obj)) + { + reference.SetEditorAsset(obj); + } + + return reference; + } + } + + /// + /// Odin Inspector utility methods for working with addressables. + /// + public static class OdinAddressableUtility + { + private readonly static Action openAddressableWindowAction; + + static OdinAddressableUtility() + { + var type = TwoWaySerializationBinder.Default.BindToType("UnityEditor.AddressableAssets.GUI.AddressableAssetsWindow") ?? throw new Exception(""); + var method = type.GetMethod("Init", Flags.AllMembers) ?? throw new Exception(""); + openAddressableWindowAction = (Action)Delegate.CreateDelegate(typeof(Action), method); + + } + + /// + /// Opens the addressables group settings window. + /// + public static void OpenGroupsWindow() + { + openAddressableWindowAction(); + } + + /// + /// Opens the addressables labels settings window. + /// + public static void OpenLabelsWindow() + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + EditorWindow.GetWindow().Intialize(AddressableAssetSettingsDefaultObject.Settings); + } + + /// + /// Converts the specified object into an addressable. + /// + /// The object to make addressable. + /// The addressable group to add the object to. + public static void MakeAddressable(UnityEngine.Object obj, AddressableAssetGroup group) + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + + var settings = AddressableAssetSettingsDefaultObject.Settings; + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)); + var entry = settings.CreateOrMoveEntry(guid, group, false, false); + entry.address = AssetDatabase.GUIDToAssetPath(guid); + settings.SetDirty(AddressableAssetSettings.ModificationEvent.EntryCreated, entry, false, true); + } + + /// + /// Gets the type targeted by an AssetReference type. For example, returns Texture for AssetReferenceTexture. + /// Returns UnityEngine.Object for AssetReference type. + /// + /// A type of AssetReference, for example, AssetReferenceTexture. + /// + /// If the given type inherits AssetRefernceT<T>, then the method returns the generic T argument. + /// If the given type is AssetReference, then the method returns UnityEngine.Object. + /// + /// Throws if given parameter is null. + /// Throws if the given type does not inherit or is AssetReference. + public static Type GetAssetReferenceTargetType(Type assetReferenceType) + { + if (assetReferenceType == null) throw new ArgumentNullException(nameof(assetReferenceType)); + + if (assetReferenceType.InheritsFrom(typeof(AssetReferenceT<>))) + { + var genericBase = assetReferenceType.GetGenericBaseType(typeof(AssetReferenceT<>)); + return genericBase.GetGenericArguments()[0]; + } + else + { + return typeof(UnityEngine.Object); + } + } + + /// + /// Validate an asset against a list of AssetReferenceUIRestrictions. + /// + /// The restrictions to apply. + /// The asset to validate. + /// Returns true if the asset passes all restrictions. Otherwise false. + /// Throws if Addressable Settings have not been created. + /// Throws if restrictions or asset is null. + public static bool ValidateAssetReferenceRestrictions(List restrictions, UnityEngine.Object asset) + { + return ValidateAssetReferenceRestrictions(restrictions, asset, out _); + } + + /// + /// Validate an asset against a list of AssetReferenceUIRestrictions. + /// + /// The restrictions to apply. + /// The asset to validate. + /// The first failed restriction. null if no restrictions failed. + /// Returns true if the asset passes all restrictions. Otherwise false. + /// Throws if Addressable Settings have not been created. + /// Throws if restrictions or asset is null. + public static bool ValidateAssetReferenceRestrictions(List restrictions, UnityEngine.Object asset, out AssetReferenceUIRestriction failedRestriction) + { + if (AddressableAssetSettingsDefaultObject.SettingsExists == false) throw new Exception("Addressable Settings have not been created."); + + _ = restrictions ?? throw new ArgumentNullException(nameof(restrictions)); + _ = asset ?? throw new ArgumentNullException(nameof(asset)); + + for (int i = 0; i < restrictions.Count; i++) + { + if (restrictions[i] is AssetReferenceUILabelRestriction labels) + { + /* Unity, in all its wisdom, have apparently decided not to implement their AssetReferenceRestriction attributes in some versions(?) + * So, to compensate, we're going to manually validate the label restriction attribute, so atleast that works. */ + + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset)); + + var entry = AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry(guid, true); + + if (entry.labels.Any(x => labels.m_AllowedLabels.Contains(x)) == false) + { + failedRestriction = labels; + return false; + } + } + else if (restrictions[i].ValidateAsset(asset) == false) + { + failedRestriction = restrictions[i]; + return false; + } + } + + failedRestriction = null; + return true; + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs.meta new file mode 100644 index 000000000..66d12eec5 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/AddressablesInspectors.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba1664ec1a0467641a742eaadae146d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef new file mode 100644 index 000000000..7be66dce6 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef @@ -0,0 +1,29 @@ +{ + "name": "Sirenix.OdinInspector.Modules.Unity.Addressables", + "references": [ + "Unity.Addressables", + "Unity.Addressables.Editor", + "Sirenix.Serialization", + "Sirenix.OdinInspector.Attributes", + "Sirenix.OdinInspector.Editor", + "Sirenix.Utilities.Editor", + "Sirenix.Utilities", + "Sirenix.OdinValidator.Editor" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [ + "Sirenix.Serialization.dll", + "Sirenix.OdinInspector.Attributes.dll", + "Sirenix.OdinInspector.Editor.dll", + "Sirenix.Utilities.Editor.dll", + "Sirenix.Utilities.dll", + "Sirenix.OdinValidator.Editor.dll" + ], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta new file mode 100644 index 000000000..f7deb1dca --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3b4d8e09c665bfa47849130d8695171e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators.meta new file mode 100644 index 000000000..05862c291 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b568c1d508ce0b74eb0025b8501d1c1e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs new file mode 100644 index 000000000..82f677b09 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +using UnityEngine; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using UnityEngine.AddressableAssets; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +#if ODIN_VALIDATOR_3_1 +[assembly: RegisterValidationRule(typeof(AssetLabelReferenceValidator), Description = + "This validator ensures that AssetLabelReferences marked with the Required attribute display an error " + + "message if they are not set. It can also be configured to require that all AssetLabelReferences be set " + + "by default; the Optional attribute can then be used to exclude specific AssetLabelReferences from " + + "validation.")] +#else +[assembly: RegisterValidator(typeof(AssetLabelReferenceValidator))] +#endif + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + /// + /// Validator for AssetLabelReference values. + /// + public class AssetLabelReferenceValidator : ValueValidator + { + [Tooltip("If enabled, the validator will display an error message if the AssetLabelReference is not set. " + + "If disabled, the validator will only display an error message if the AssetLabelReference is set, but the " + + "assigned label does not exist.")] + [ToggleLeft] + public bool RequiredByDefault; + + private bool required; + private bool optional; + private string requiredMessage; + + protected override void Initialize() + { + var requiredAttr = this.Property.GetAttribute(); + + this.requiredMessage = requiredAttr?.ErrorMessage ?? $"{this.Property.NiceName} is required."; + + if (this.RequiredByDefault) + { + required = true; + optional = Property.GetAttribute() != null; + } + else + { + required = requiredAttr != null; + optional = false; + } + } + + protected override void Validate(ValidationResult result) + { + // If the Addressables settings have not been created, nothing else is really valid. + if (AddressableAssetSettingsDefaultObject.SettingsExists == false) + { + result.AddError("Addressables Settings have not been created.") + .WithButton("Open Settings Window", () => OdinAddressableUtility.OpenGroupsWindow()); + return; + } + + var value = Value?.labelString; + + if (string.IsNullOrEmpty(value)) + { + if (optional == false && required) // Optional == false & required? Nice. + { + result.AddError(requiredMessage).EnableRichText(); + } + } + else + { + var labels = AddressableAssetSettingsDefaultObject.Settings.GetLabels(); + + if (labels.Contains(value) == false) + { + result.AddError($"Label {value} has not been created as a label.") + .WithButton("Open Label Settings", () => OdinAddressableUtility.OpenLabelsWindow()); + } + } + } + } + +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs.meta new file mode 100644 index 000000000..c9b6cfc0d --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetLabelReferenceValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fcaf7dc3b9a98a545b301a1ea175055b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs new file mode 100644 index 000000000..5a335c3c8 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs @@ -0,0 +1,280 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor.AddressableAssets.Settings; +using UnityEngine.AddressableAssets; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +#if ODIN_VALIDATOR_3_1 +[assembly: RegisterValidationRule(typeof(AssetReferenceValidator), Description = + "This validator provides robust integrity checks for your asset references within Unity. " + + "It validates whether an asset reference has been assigned, and if it's missing, raises an error. " + + "It further checks the existence of the main asset at the assigned path, ensuring it hasn't been " + + "inadvertently deleted or moved. The validator also verifies if the assigned asset is addressable " + + "and, if not, offers a fix to make it addressable. Moreover, it ensures the asset adheres to " + + "specific label restrictions set through the AssetReferenceUILabelRestriction attribute. " + + "Lastly, it performs checks on any sub-object linked to the asset, making sure it hasn't gone missing. " + + "This comprehensive validation system prevents hard-to-spot bugs and errors, " + + "fostering a more robust and efficient development workflow.")] +#else +[assembly: RegisterValidator(typeof(AssetReferenceValidator))] +#endif + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class AssetReferenceValidator : ValueValidator + { + [Tooltip("If true and the AssetReference is not marked with the Optional attribute, " + + "the validator will display an error message if the AssetReference is not set. " + + "If false, the validator will only display an error message if the AssetReference is set, " + + "but the assigned asset does not exist.")] + [ToggleLeft] + public bool RequiredByDefault; + + private bool required; + private bool optional; + private string requiredMessage; + + private List restrictions; + + protected override void Initialize() + { + var requiredAttr = this.Property.GetAttribute(); + + this.requiredMessage = requiredAttr?.ErrorMessage ?? $"{this.Property.NiceName} is required."; + + if (this.RequiredByDefault) + { + this.required = true; + this.optional = this.Property.GetAttribute() != null; + } + else + { + this.required = requiredAttr != null; + this.optional = false; + } + + this.restrictions = new List(); + foreach (var attr in this.Property.Attributes) + { + if (attr is AssetReferenceUIRestriction r) + { + this.restrictions.Add(r); + } + } + } + + protected override void Validate(ValidationResult result) + { + // If the Addressables settings have not been created, nothing else is really valid. + if (AddressableAssetSettingsDefaultObject.SettingsExists == false) + { + result.AddError("Addressables Settings have not been created.") + .WithButton("Open Settings Window", () => OdinAddressableUtility.OpenGroupsWindow()); + return; + } + + var assetReference = this.Value; + var assetReferenceHasBeenAssigned = !string.IsNullOrEmpty(assetReference?.AssetGUID); + + // No item has been assigned. + if (!assetReferenceHasBeenAssigned) + { + if (optional == false && required) // Optional == false & required? Nice. + { + result.AddError(this.requiredMessage).EnableRichText(); + } + + return; + } + + var assetPath = AssetDatabase.GUIDToAssetPath(assetReference.AssetGUID); + var mainAsset = AssetDatabase.LoadMainAssetAtPath(assetPath); + + // The item has been assigned, but is now missing. + if (mainAsset == null) + { + result.AddError($"The previously assigned main asset with path '{assetPath}' is missing. GUID '{assetReference.AssetGUID}'"); + return; + } + + var addressableAssetEntry = AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry(assetReference.AssetGUID, true); + var isAddressable = addressableAssetEntry != null; + + // Somehow an item sneaked through all of unity's validation measures and ended up not being addressable + // while still ending up in the asset reference object field. + if (!isAddressable) + { + result.AddError("Assigned item is not addressable.") + .WithFix("Make Addressable", args => OdinAddressableUtility.MakeAddressable(mainAsset, args.Group)); + } + // Check the assigned item against any and all label restrictions. + else + { + if (OdinAddressableUtility.ValidateAssetReferenceRestrictions(restrictions, mainAsset, out var failedRestriction) == false) + { + if (failedRestriction is AssetReferenceUILabelRestriction labelRestriction) + { + result.AddError($"Asset reference is restricted to items with these specific labels '{string.Join(", ", labelRestriction.m_AllowedLabels)}'. The currently assigned item has none of them.") + .WithFix("Add Labels", args => SetLabels(mainAsset, args.AssetLabels)); + } + else + { + result.AddError("Restriction failed: " + failedRestriction.ToString()); + } + } + } + + // The assigned item had a sub object, but it's missing. + if (!string.IsNullOrEmpty(assetReference.SubObjectName)) + { + var subObjects = AssetDatabase.LoadAllAssetRepresentationsAtPath(assetPath); + + var hasMissingSubObject = true; + + foreach (var subObject in subObjects) + { + if (subObject.name == assetReference.SubObjectName) + { + hasMissingSubObject = false; + break; + } + } + + if (hasMissingSubObject) + { + result.AddError($"The previously assigned sub asset with name '{assetReference.SubObjectName}' is missing.").EnableRichText(); + } + } + + if (assetReference.ValidateAsset(mainAsset) || assetReference.ValidateAsset(assetPath)) + return; + + if (assetReference is AssetReferenceSprite && assetReference.editorAsset is Sprite) + return; + + result.AddError($"{assetReference.GetType().GetNiceFullName()}.ValidateAsset failed to validate assigned asset."); + } + + private static void SetLabels(UnityEngine.Object obj, List assetLabels) + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + + var settings = AddressableAssetSettingsDefaultObject.Settings; + var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(obj)); + var entry = settings.FindAssetEntry(guid, false); + + foreach (var assetLabel in assetLabels.Where(a => a.Toggled)) + { + entry.SetLabel(assetLabel.Label, true, false, false); + } + + settings.SetDirty(AddressableAssetSettings.ModificationEvent.LabelAdded, entry, false, true); + } + + private class MakeAddressableFixArgs + { + [ValueDropdown(nameof(GetGroups))] + [OnInspectorInit(nameof(SelectDefault))] + public AddressableAssetGroup Group; + + private void SelectDefault() + { + this.Group = AddressableAssetSettingsDefaultObject.SettingsExists + ? AddressableAssetSettingsDefaultObject.Settings.DefaultGroup + : null; + } + + private static IEnumerable GetGroups() + { + return !AddressableAssetSettingsDefaultObject.SettingsExists + ? Enumerable.Empty() + : AddressableAssetSettingsDefaultObject.Settings.groups + .Where(group => !group.ReadOnly) + .Select(group => new ValueDropdownItem(group.Name, group)); + } + + [Button(SdfIconType.ListNested), PropertySpace(8f)] + private void OpenAddressablesGroups() => OdinAddressableUtility.OpenGroupsWindow(); + } + + private class AddLabelsFixArgs + { + [HideIf("@true")] + public List AssetLabels + { + get + { + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return this.assetLabels; + + var settings = AddressableAssetSettingsDefaultObject.Settings; + var labels = settings + .GetLabels() + .Select(l => new AssetLabel { Label = l, Toggled = false }) + .ToList(); + + foreach (var assetLabel in this.assetLabels) + { + var label = labels.FirstOrDefault(l => l.Label == assetLabel.Label); + + if (label != null) + { + label.Toggled = assetLabel.Toggled; + } + } + + this.assetLabels = labels; + return this.assetLabels; + } + } + + private List assetLabels = new List(); + + [OnInspectorGUI] + private void Draw() + { + var togglesRect = EditorGUILayout.GetControlRect(false, Mathf.CeilToInt(this.AssetLabels.Count / 2f) * 20f); + + for (var i = 0; i < this.AssetLabels.Count; i++) + { + var assetLabel = this.AssetLabels[i]; + var toggleRect = togglesRect.SplitGrid(togglesRect.width / 2f, 20, i); + assetLabel.Toggled = GUI.Toggle(toggleRect, assetLabel.Toggled, assetLabel.Label); + } + + if (!AddressableAssetSettingsDefaultObject.SettingsExists) return; + + GUILayout.Space(8f); + + var buttonsRect = EditorGUILayout.GetControlRect(false, 20f); + + if (SirenixEditorGUI.SDFIconButton(buttonsRect, "Open Addressables Labels", SdfIconType.TagsFill)) + { + OdinAddressableUtility.OpenLabelsWindow(); + } + } + } + + private class AssetLabel + { + public bool Toggled; + public string Label; + } + } + +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs.meta new file mode 100644 index 000000000..44421787c --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/AssetReferenceValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b44b08a1f58a83149988fde5ac600fe4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs new file mode 100644 index 000000000..2275f1106 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs @@ -0,0 +1,201 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && ODIN_VALIDATOR_3_1 + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor.AddressableAssets.Settings; +using System.Collections; +using System; +using Sirenix.OdinValidator.Editor; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +[assembly: RegisterValidationRule(typeof(CheckDuplicateBundleDependenciesValidator), + Description = "This validator detects potential duplicate asset dependencies in an addressable group, without the need for a build. " + + "For instance, imagine two prefabs in separate groups, both referencing the same material. Each group would then include the material " + + "and all its associated dependencies. " + + "To address this, the material should be marked as Addressable, either with one of the prefabs or in a distinct group.\n\n" + + "Fixes: Executing the fix will make the dependency addressable and move it to the specified group.\n\n" + + "Exceptions: It's important to note that duplicate assets aren't inherently problematic. For example, if certain assets are " + + "never accessed by the same user group, such as region-specific assets, these duplications might be desired or at least inconsequential. " + + "As every project is unique, decisions concerning duplicate asset dependencies should be considered on a case-by-case basis.")] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class CheckDuplicateBundleDependenciesValidator : GlobalValidator + { + private static Dictionary> dependencyGroupMap = new Dictionary>(); + + [Tooltip("The severity of the validation result.")] + public ValidatorSeverity ValidatorSeverity = ValidatorSeverity.Warning; + + [Tooltip("Assets to ignore when validating.")] + [LabelText("Ignored GUIDs"), CustomValueDrawer(nameof(DrawGUIDEntry))] + public List IgnoredGUIDs = new List(); + + public override IEnumerable RunValidation(ValidationResult result) + { + dependencyGroupMap.Clear(); + + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + if (addressableAssetSettings == null) yield break; + + foreach (var addressableAssetGroup in addressableAssetSettings.groups) + { + if (addressableAssetGroup == null) continue; + + foreach (var addressableAssetEntry in addressableAssetGroup.entries) + { + var dependencyAssetPaths = AssetDatabase.GetDependencies(addressableAssetEntry.AssetPath) + .Where(assetPath => !assetPath.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && + !assetPath.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)); + + foreach (var dependencyAssetPath in dependencyAssetPaths) + { + var dependencyGUID = new GUID(AssetDatabase.AssetPathToGUID(dependencyAssetPath)); + + if (this.IgnoredGUIDs.Contains(dependencyGUID.ToString())) continue; + + var dependencyAddressableAssetEntry = addressableAssetSettings.FindAssetEntry(dependencyGUID.ToString()); + + var isAddressable = dependencyAddressableAssetEntry != null; + if (isAddressable) continue; + + if (!dependencyGroupMap.ContainsKey(dependencyGUID)) + { + dependencyGroupMap.Add(dependencyGUID, new List()); + } + + if (!dependencyGroupMap[dependencyGUID].Contains(addressableAssetGroup.Name)) + { + dependencyGroupMap[dependencyGUID].Add(addressableAssetGroup.Name); + } + } + } + } + + foreach (var kvp in dependencyGroupMap) + { + var dependencyGUID = kvp.Key; + var groups = kvp.Value; + + if (groups.Count > 1) + { + var assetPath = AssetDatabase.GUIDToAssetPath(dependencyGUID.ToString()); + var message = $"{assetPath} is duplicated in these groups: {string.Join(", ", groups)}"; + + result.Add(this.ValidatorSeverity, message).WithFix(args => + { + if (args.FixChoice == FixChoice.Ignore) + { + var sourceType = args.IgnoreForEveryone ? ConfigSourceType.Project : ConfigSourceType.Local; + var data = RuleConfig.Instance.GetRuleData(sourceType); + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + RuleConfig.Instance.SetAndSaveRuleData(data, sourceType); + return; + } + + var obj = AssetDatabase.LoadAssetAtPath(assetPath, typeof(UnityEngine.Object)); + AddressableAssetGroup group; + + if (args.Group == "Create New Group") + { + if (args.GroupName.IsNullOrWhitespace()) return; + + group = addressableAssetSettings.FindGroup(args.GroupName); + + if (group == null) + { + group = addressableAssetSettings.CreateGroup(args.GroupName, false, false, false, null); + } + } + else + { + group = addressableAssetSettings.FindGroup(args.Group); + + if (group == null) + { + group = addressableAssetSettings.CreateGroup(args.Group, false, false, false, null); + } + } + + OdinAddressableUtility.MakeAddressable(obj, group); + }, false).WithModifyRuleDataContextClick("Ignore", data => + { + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + }).SetSelectionObject(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(dependencyGUID.ToString()))); + } + } + } + + private string DrawGUIDEntry(string guid) + { + var assetPath = AssetDatabase.GUIDToAssetPath(guid); + EditorGUILayout.TextArea(assetPath, SirenixGUIStyles.MultiLineLabel); + EditorGUILayout.TextField(guid); + return guid; + } + + private enum FixChoice + { + AddToGroup, + Ignore, + } + + private class FixArgs + { + [EnumToggleButtons, HideLabel] + public FixChoice FixChoice; + + [PropertySpace(10)] + [ValueDropdown("Groups")] + //[Title("Group To Add To", TitleAlignment = TitleAlignments.Centered)] + [ShowIf(nameof(FixChoice), FixChoice.AddToGroup, Animate = false)] + public string Group = "Duplicate Asset Isolation"; + + [ValidateInput(nameof(ValidateGroupName), "The group name cannot be empty")] + [ShowIf(nameof(ShowNewGroupName), Animate = false)] + public string GroupName; + + [LabelWidth(120f)] + [PropertySpace(10)] + [ShowIf("FixChoice", FixChoice.Ignore, Animate = false)] + public bool IgnoreForEveryone = true; + + [OnInspectorGUI] + [PropertySpace(10)] + [DetailedInfoBox("Note that duplicate assets may not always be an issue", "Note that duplicate assets may not always be an issue. If assets will never be requested by the same set of users (for example, region-specific assets), then duplicate dependencies may be desired, or at least inconsequential. Each Project is unique, so fixing duplicate asset dependencies should be evaluated on a case by case basis")] + private void Dummy() { } + + private bool ShowNewGroupName => this.FixChoice != FixChoice.Ignore && this.Group == "Create New Group"; + + private bool ValidateGroupName() => !this.GroupName.IsNullOrWhitespace(); + + private IEnumerable Groups() + { + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + return addressableAssetSettings == null + ? Enumerable.Empty() + : addressableAssetSettings.groups + .Where(group => group != null && group.Name != "Built In Data") + .Select(group => group.Name) + .Append("Duplicate Asset Isolation") + .Prepend("Create New Group"); + } + } + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs.meta new file mode 100644 index 000000000..f7d4e44a8 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckDuplicateBundleDependenciesValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bdc8ee2cf75a17644a0bd81a965cc2e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs new file mode 100644 index 000000000..0e0390eae --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs @@ -0,0 +1,171 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && ODIN_VALIDATOR_3_1 + +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.Utilities.Editor; +using System.Collections; +using System; +using System.IO; +using Sirenix.OdinValidator.Editor; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +[assembly: RegisterValidationRule(typeof(CheckResourcesToAddressableDuplicateDependenciesValidator), + Description = "This validator identifies dependencies that are duplicated in both addressable groups and the \"Resources\" folder.\n\n" + + "These duplications mean that data will be included in both the application build and the addressables build.\n\n" + + "You can decide to simply ignore these duplicated dependencies if this behavior is desired, or use the provided fix " + + "to move the asset outside of the \"Resources\" folder.")] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class CheckResourcesToAddressableDuplicateDependenciesValidator : GlobalValidator + { + [Tooltip("The severity of the validation result.")] + public ValidatorSeverity ValidatorSeverity = ValidatorSeverity.Warning; + + [Tooltip("Assets to ignore when validating.")] + [LabelText("Ignored GUIDs"), CustomValueDrawer(nameof(DrawGUIDEntry))] + public List IgnoredGUIDs = new List(); + + public override IEnumerable RunValidation(ValidationResult result) + { + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + if (addressableAssetSettings == null) yield break; + + foreach (var addressableAssetGroup in addressableAssetSettings.groups) + { + if (addressableAssetGroup == null) continue; + + foreach (var addressableAssetEntry in addressableAssetGroup.entries) + { + var dependencyAssetPaths = AssetDatabase.GetDependencies(addressableAssetEntry.AssetPath) + .Where(assetPath => !assetPath.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && + !assetPath.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)); + + foreach (var dependencyAssetPath in dependencyAssetPaths) + { + var dependencyGUID = new GUID(AssetDatabase.AssetPathToGUID(dependencyAssetPath)); + + if (this.IgnoredGUIDs.Contains(dependencyGUID.ToString())) continue; + + var dependencyAddressableAssetEntry = addressableAssetSettings.FindAssetEntry(dependencyGUID.ToString()); + + var isAddressable = dependencyAddressableAssetEntry != null; + if (isAddressable) continue; + if (!IsInsideResourcesFolder(dependencyAssetPath)) continue; + + result.Add(this.ValidatorSeverity, $"{dependencyAssetPath} is duplicated in addressable data and resource folders.") + .WithFix(args => + { + if (args.FixChoice == FixChoice.Ignore) + { + var sourceType = args.IgnoreForEveryone ? ConfigSourceType.Project : ConfigSourceType.Local; + var data = RuleConfig.Instance.GetRuleData(sourceType); + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + RuleConfig.Instance.SetAndSaveRuleData(data, sourceType); + return; + } + + if (!ValidNewFolder(args.NewFolder, out _)) return; + + if (!AssetDatabase.IsValidFolder(args.NewFolder)) + { + Directory.CreateDirectory(new DirectoryInfo(args.NewFolder).FullName); + AssetDatabase.Refresh(); + } + + var newPath = $"{args.NewFolder}/{Path.GetFileName(dependencyAssetPath)}"; + AssetDatabase.MoveAsset(dependencyAssetPath, newPath); + }, false).WithModifyRuleDataContextClick("Ignore", data => + { + data.IgnoredGUIDs.Add(dependencyGUID.ToString()); + }).SetSelectionObject(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(dependencyGUID.ToString()))); + + yield break; + } + } + } + } + + private string DrawGUIDEntry(string guid) + { + var assetPath = AssetDatabase.GUIDToAssetPath(guid); + EditorGUILayout.TextArea(assetPath, SirenixGUIStyles.MultiLineLabel); + EditorGUILayout.TextField(guid); + return guid; + } + + private static bool IsInsideResourcesFolder(string path) + { + var pathElements = path.Split('/'); + + foreach (var pathElement in pathElements) + { + if (pathElement.Equals("Resources", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + + return false; + } + + private static bool ValidNewFolder(string path, out string message) + { + if (IsInsideResourcesFolder(path)) + { + message = "The asset cannot be moved into a 'Resources' folder"; + return false; + } + + if (!path.StartsWith("Assets/")) + { + message = "The asset must be inside the 'Assets' folder"; + return false; + } + + message = "The folder is valid"; + return true; + } + + private enum FixChoice + { + MoveAsset, + Ignore, + } + private class FixArgs + { + [HideLabel] + [EnumToggleButtons] + public FixChoice FixChoice; + + [FolderPath] + [PropertySpace(10)] + [ValidateInput(nameof(ValidateFolderPath))] + [ShowIf("FixChoice", FixChoice.MoveAsset, Animate = false)] + public string NewFolder = "Assets/Resources_moved"; + + [LabelWidth(120f)] + [PropertySpace(10)] + [ShowIf("FixChoice", FixChoice.Ignore, Animate = false)] + public bool IgnoreForEveryone = true; + + private bool ValidateFolderPath(string path, ref string message) + { + return ValidNewFolder(path, out message); + } + } + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta new file mode 100644 index 000000000..a2bc61e20 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f75aebe03a9aa4a4b82d2b54dcc34de5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs new file mode 100644 index 000000000..05037ac49 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs @@ -0,0 +1,34 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.OdinInspector.Modules.Addressables.Editor; +using UnityEngine.AddressableAssets; + +[assembly: RegisterValidator(typeof(DisallowAddressableSubAssetFieldAttributeValidator))] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + /// + /// Validator for the DisallowAddressableSubAssetFieldAttribute. + /// + public class DisallowAddressableSubAssetFieldAttributeValidator : AttributeValidator + { + protected override void Validate(ValidationResult result) + { + if (this.Value != null && string.IsNullOrEmpty(this.Value.SubObjectName) == false) + { + result.AddError("Sub-asset references is not allowed on this field.") + .WithFix("Remove Sub-Asset", () => this.Value.SubObjectName = null, true); + } + } + } + +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta new file mode 100644 index 000000000..7a7fd44df --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5775d33ffc1143149c4f425f693b04b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs new file mode 100644 index 000000000..90811cc1e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && ODIN_VALIDATOR_3_1 + +using System.Collections.Generic; +using UnityEditor.AddressableAssets; +using Sirenix.OdinInspector.Editor.Validation; +using UnityEditor.AddressableAssets.Settings; +using System.Collections; +using Sirenix.OdinInspector.Modules.Addressables.Editor; + +[assembly: RegisterValidator(typeof(MissingAddressableGroupReferenceValidator))] + +namespace Sirenix.OdinInspector.Modules.Addressables.Editor +{ + public class MissingAddressableGroupReferenceValidator : GlobalValidator + { + public override IEnumerable RunValidation(ValidationResult result) + { + var addressableAssetSettings = AddressableAssetSettingsDefaultObject.Settings; + + if (addressableAssetSettings == null) yield break; + + var missingGroupIndices = new List(); + + for (var i = 0; i < addressableAssetSettings.groups.Count; i++) + { + var group = addressableAssetSettings.groups[i]; + + if (group == null) + { + missingGroupIndices.Add(i); + } + } + + if (missingGroupIndices.Count > 0) + { + result.Add(ValidatorSeverity.Error, "Addressable groups contains missing references").WithFix("Delete missing reference", () => + { + for (var i = missingGroupIndices.Count - 1; i >= 0; i--) + { + addressableAssetSettings.groups.RemoveAt(missingGroupIndices[i]); + addressableAssetSettings.SetDirty(AddressableAssetSettings.ModificationEvent.GroupRemoved, null, true, true); + } + }); + } + } + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs.meta new file mode 100644 index 000000000..0f3914fce --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/Validators/MissingAddressableGroupReferenceValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ae55abdaf19ef4498d1a2fbe1bd9f9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt new file mode 100644 index 000000000..4e97b1e83 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt @@ -0,0 +1,21 @@ +ManifestVersion: 1 +ModuleID: Unity.Addressables +ModuleVersion: 1.1.0.4 +ModuleFiles: + AddressablesInspectors.cs + AddressablesInspectors.cs.meta + Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef + Sirenix.OdinInspector.Modules.Unity.Addressables.asmdef.meta + Validators.meta + Validators/AssetLabelReferenceValidator.cs + Validators/AssetLabelReferenceValidator.cs.meta + Validators/AssetReferenceValidator.cs + Validators/AssetReferenceValidator.cs.meta + Validators/CheckDuplicateBundleDependenciesValidator.cs + Validators/CheckDuplicateBundleDependenciesValidator.cs.meta + Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs + Validators/CheckResourcesToAddressableDuplicateDependenciesValidator.cs.meta + Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs + Validators/DisallowAddressableSubAssetFieldAttributeValidator.cs.meta + Validators/MissingAddressableGroupReferenceValidator.cs + Validators/MissingAddressableGroupReferenceValidator.cs.meta diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt.meta new file mode 100644 index 000000000..194dd3ea7 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Addressables/manifest.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b895c767daedd2d46b8ae7c0c0bfc599 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.meta new file mode 100644 index 000000000..79593fb00 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aef9f84551321cf4aac8228f4d56bf0e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor.meta new file mode 100644 index 000000000..bb9bcece7 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 175cafb710462ef489cbf56cb46c97d5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs.meta new file mode 100644 index 000000000..6d4e3a498 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3459a30abd1a4e979488e906febc27e7 +timeCreated: 1707714315 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.asset new file mode 100644 index 000000000..dc6574899 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.asset @@ -0,0 +1,29 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2fc91909e6444cb29aacb664f2098c7e, type: 3} + m_Name: OdinLocalizationConfig + m_EditorClassIdentifier: + recordUndosForAssetTableEntries: 1 + assetRowHeight: 128 + useSyntaxHighlighter: 1 + placeholderColor: + lightColor: {r: 0.743147, g: 0.9433962, b: 0.9242815, a: 1} + darkColor: {r: 0, g: 0.5882353, b: 0.5333334, a: 1} + selectorColor: + lightColor: {r: 1, g: 0.7727525, b: 0.3632075, a: 1} + darkColor: {r: 1, g: 0.6470588, b: 0, a: 1} + formatterColor: + lightColor: {r: 0.9921569, g: 0.9855571, b: 0.8823529, a: 1} + darkColor: {r: 0.9607843, g: 0.9607843, b: 0.8627451, a: 1} + scrollSpeed: 24 + invertMouseDragNavigation: 1 + mouseDragSpeed: 1 diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.asset.meta new file mode 100644 index 000000000..0fd9bb9bc --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c09625914af7d2d4e92c3653d5f15bd7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.cs new file mode 100644 index 000000000..839a8b2e5 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.cs @@ -0,0 +1,173 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Reflection.Editor; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEngine; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Configs +{ + [GlobalConfig("Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs")] + public class OdinLocalizationConfig : GlobalConfig + { + public class ThemeColorDrawer : OdinValueDrawer + { + protected override void Initialize() + { + base.Initialize(); + this.Property.State.Expanded = false; + } + + protected override void DrawPropertyLayout(GUIContent label) + { + SirenixEditorGUI.BeginBox(string.Empty); + { + SirenixEditorGUI.BeginBoxHeader(); + { + GUILayout_Internal.BeginRow(); + { + GUILayout_Internal.BeginColumn(LayoutSize.Pixels(EditorGUIUtility.labelWidth + 6.0f)); + { + this.Property.State.Expanded = EditorGUILayout.Foldout(this.Property.State.Expanded, + $"{label.text} ({(EditorGUIUtility.isProSkin ? "Dark" : "Light")})", + true); + } + GUILayout_Internal.EndColumn(); + + GUILayout_Internal.BeginColumn(LayoutSize.Auto); + { + this.Property.Children[nameof(ThemeColor.Color)].Draw(null); + } + GUILayout_Internal.EndColumn(); + } + GUILayout_Internal.EndRow(); + } + SirenixEditorGUI.EndBoxHeader(); + + bool toggle = this.ValueEntry.ValueState != PropertyValueState.NullReference && this.Property.State.Expanded; + + if (SirenixEditorGUI.BeginFadeGroup(this, toggle)) + { + GUILayout.BeginHorizontal(); + this.Property.Children[nameof(ThemeColor.lightColor)].Draw(); + GUILayout.Space(3.5f); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + this.Property.Children[nameof(ThemeColor.darkColor)].Draw(); + GUILayout.Space(3.5f); + GUILayout.EndHorizontal(); + } + + SirenixEditorGUI.EndFadeGroup(); + } + SirenixEditorGUI.EndBox(); + + if (this.Property.State.Expanded) + { + GUILayout.Space(4.0f); + } + } + } + + [Serializable] + public class ThemeColor + { + [ShowInInspector] + public Color Color + { + get => EditorGUIUtility.isProSkin ? this.darkColor : this.lightColor; + + set + { + if (EditorGUIUtility.isProSkin) + { + this.darkColor = value; + } + else + { + this.lightColor = value; + } + } + } + + public Color lightColor; + public Color darkColor; + + public ThemeColor(Color lightColor, Color darkColor) + { + this.lightColor = lightColor; + this.darkColor = darkColor; + } + + public static implicit operator Color(ThemeColor color) => color.Color; + } + + [ShowInInspector] + [BoxGroup("User Interface")] + [Range(96, 1024)] + public int assetRowHeight = 128; + + [BoxGroup("Syntax Highlighting")] + public bool useSyntaxHighlighter = true; + + [EnableIf(nameof(useSyntaxHighlighter))] + [BoxGroup("Syntax Highlighting")] + public ThemeColor placeholderColor = new ThemeColor(new Color(0.743147f, 0.9433962f, 0.9242815f), new Color(0, 0.5882353f, 0.5333334f)); + + [EnableIf(nameof(useSyntaxHighlighter))] + [BoxGroup("Syntax Highlighting")] + public ThemeColor selectorColor = new ThemeColor(new Color(1.0f, 0.7727525f, 0.3632075f), new Color(1, 0.6470588f, 0)); + + [EnableIf(nameof(useSyntaxHighlighter))] + [BoxGroup("Syntax Highlighting")] + public ThemeColor formatterColor = new ThemeColor(new Color(0.9921569f, 0.9855571f, 0.8823529f), new Color(0.9607843f, 0.9607843f, 0.8627451f)); + + [BoxGroup("Navigation")] + [Range(1, 1000.0f)] + public float scrollSpeed = 24.0f; + + [BoxGroup("Navigation")] + public bool invertMouseDragNavigation = true; + + [BoxGroup("Navigation")] + [Range(0.5f, 5.0f)] + public float mouseDragSpeed = 1.0f; + + [InfoBox("We couldn't find the necessary methods/classes to perform custom undo operations, therefore this option has been disabled and will be considered false even if true.", + VisibleIf = "@!OdinLocalizationReflectionValues.HasAPIForCustomUndo")] + [EnableIf("@OdinLocalizationReflectionValues.HasAPIForCustomUndo")] + [BoxGroup("Undo")] + public bool useCustomUndoHandlingForAssetCollections = true; + + [Button(ButtonSizes.Large)] + public void Reset() + { + if (!EditorUtility.DisplayDialog("Odin Localization Config", "Are you certain you want to reset your Localization config?", "Yes", "No")) + { + return; + } + + this.useCustomUndoHandlingForAssetCollections = OdinLocalizationReflectionValues.HasAPIForCustomUndo; + + this.assetRowHeight = 128; + + this.useSyntaxHighlighter = true; + this.placeholderColor = new ThemeColor(new Color(0.743147f, 0.9433962f, 0.9242815f), new Color(0, 0.5882353f, 0.5333334f)); + this.selectorColor = new ThemeColor(new Color(1.0f, 0.7727525f, 0.3632075f), new Color(1, 0.6470588f, 0)); + this.formatterColor = new ThemeColor(new Color(0.9921569f, 0.9855571f, 0.8823529f), new Color(0.9607843f, 0.9607843f, 0.8627451f)); + + this.scrollSpeed = 24.0f; + this.invertMouseDragNavigation = true; + this.mouseDragSpeed = 1.0f; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.cs.meta new file mode 100644 index 000000000..3ec82c500 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Configs/OdinLocalizationConfig.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2fc91909e6444cb29aacb664f2098c7e +timeCreated: 1707714331 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI.meta new file mode 100644 index 000000000..e206adbf9 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bf930ee5d27d4f90ab84f23d337eaaca +timeCreated: 1704811167 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/LocalizationMetadata.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/LocalizationMetadata.cs new file mode 100644 index 000000000..57454a9d1 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/LocalizationMetadata.cs @@ -0,0 +1,993 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEditor.Localization; +using UnityEngine; +using UnityEngine.Localization.Metadata; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class LocalizationMetadata + { + private object lastTarget; + public object Target; + private LocalizationTableCollection localizationTableCollection; + private SearchField searchField = new SearchField(); + private string searchTerm; + private Vector2 scrollPosition; + private IMetadata toBeAdded; + private IMetadata toBeRemoved; + private Type lastMetadataTypeUnderCursor; + private StringBuilder stringBuilder = new StringBuilder(); + private OdinLocalizationEditorWindow.WindowState windowState; + + private List tags = new List + { + typeof(ExcludeEntryFromExport) + }; + + private GUIStyle _contentPadding; + private GUIStyle ContentPadding => + this._contentPadding = this._contentPadding ?? new GUIStyle + { + padding = new RectOffset(10, 10, 10, 10) + }; + + private GUIStyle _platformOverridePadding; + + private GUIStyle PlatformOverridePadding => + this._platformOverridePadding = this._platformOverridePadding ?? new GUIStyle + { + padding = new RectOffset(10, 20, 10, 10) + }; + + public LocalizationMetadata(LocalizationTableCollection localizationTableCollection, OdinLocalizationEditorWindow.WindowState windowState) + { + this.localizationTableCollection = localizationTableCollection; + this.windowState = windowState; + } + + /// + /// Adds the given metadata to the shared data of the . + /// + public void Add(IMetadata metadata) + { + this.localizationTableCollection.SharedData.Metadata.AddMetadata(metadata); + } + + /// + /// Adds the given metadata to the given . + /// + public void Add(LocalizationTable localizationTable, IMetadata metadata) + { + localizationTable.AddMetadata(metadata); + } + + /// + /// Adds the given metadata to the given . + /// + public void Add(SharedTableData.SharedTableEntry sharedTableEntry, IMetadata metadata) + { + sharedTableEntry.Metadata.AddMetadata(metadata); + } + + /// + /// Adds the given metadata to the given . + /// + public void Add(TableEntry tableEntry, IMetadata metadata) + { + tableEntry.AddMetadata(metadata); + } + + /// + /// Removes the given metadata from the shared data of the . + /// + public void Remove(IMetadata metadata) + { + this.localizationTableCollection.SharedData.Metadata.RemoveMetadata(metadata); + } + + /// + /// Removes the given metadata from the given . + /// + public void Remove(LocalizationTable localizationTable, IMetadata metadata) + { + localizationTable.RemoveMetadata(metadata); + } + + /// + /// Removes the given metadata from the given . + /// + public void Remove(SharedTableData.SharedTableEntry sharedTableEntry, IMetadata metadata) + { + sharedTableEntry.Metadata.RemoveMetadata(metadata); + } + + /// + /// Removes the given metadata from the given . + /// + public void Remove(TableEntry tableEntry, IMetadata metadata) + { + tableEntry.RemoveMetadata(metadata); + } + + /// + /// Draws the metadata for the given + /// + public float Draw(Rect rect) + { + var minWidth = 0f; + if (this.Target == null) return minWidth; + + if (Event.current.type != EventType.Repaint) + { + if (this.toBeAdded != null) + { + switch (this.Target) + { + case LocalizationTable localizationTable: + Undo.RecordObject(this.localizationTableCollection, "Localization Tables Metadata Added"); + this.Add(localizationTable, this.toBeAdded); + break; + case SharedTableData.SharedTableEntry sharedTableEntry: + Undo.RecordObject(this.localizationTableCollection.SharedData, "Localization Tables Metadata Added"); + this.Add(sharedTableEntry, this.toBeAdded); + break; + case TableEntry tableEntry: + Undo.RecordObject(tableEntry.Table, "Localization Tables Metadata Added"); + this.Add(tableEntry, this.toBeAdded); + break; + default: + Undo.RecordObject(this.localizationTableCollection.SharedData, "Localization Tables Metadata Added"); + this.Add(this.toBeAdded); + break; + } + + this.toBeAdded = null; + this.windowState.Dispose(); + } + + if (this.toBeRemoved != null) + { + switch (this.Target) + { + case LocalizationTable localizationTable: + Undo.RecordObject(this.localizationTableCollection, "Localization Tables Metadata Removed"); + this.Remove(localizationTable, this.toBeRemoved); + break; + case SharedTableData.SharedTableEntry sharedTableEntry: + Undo.RecordObject(this.localizationTableCollection.SharedData, "Localization Tables Metadata Removed"); + this.Remove(sharedTableEntry, this.toBeRemoved); + break; + case TableEntry tableEntry: + Undo.RecordObject(tableEntry.Table, "Localization Tables Metadata Removed"); + this.Remove(tableEntry, this.toBeRemoved); + break; + default: + Undo.RecordObject(this.localizationTableCollection.SharedData, "Localization Tables Metadata Removed"); + this.Remove(this.toBeRemoved); + break; + } + + this.toBeRemoved = null; + this.windowState.Dispose(); + } + } + + if (this.windowState.MetadataTree == null || this.lastTarget != this.Target) + { + this.windowState.MetadataTree?.Dispose(); + + switch (this.Target) + { + case LocalizationTable localizationTable: + this.windowState.MetadataTree = PropertyTree.Create(localizationTable); + break; + case SharedTableData.SharedTableEntry sharedTableEntry: + this.windowState.MetadataTree = PropertyTree.Create(sharedTableEntry); + break; + case TableEntry tableEntry: + { + var bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + var entryData = typeof(TableEntry).GetProperty("Data", bindingFlags).GetValue(tableEntry); + this.windowState.MetadataTree = PropertyTree.Create(entryData); + break; + } + case LocalizationTableCollection localizationTableCollection: + this.windowState.MetadataTree = PropertyTree.Create(localizationTableCollection.SharedData); + break; + } + + this.lastTarget = this.Target; + } + + var metadataCollection = this.windowState.MetadataTree.RootProperty.Children["m_Metadata"]; + var metadataEntries = metadataCollection.Children["m_Items"].Children.ToList(); + + metadataEntries = metadataEntries + .Where(entry => !entry.Attributes.HasAttribute()) + .OrderBy(entry => !this.tags.Contains(entry.ValueEntry.TypeOfValue)) + .ThenBy(entry => entry.Name) + .ToList(); + + this.windowState.MetadataTree.BeginDraw(false); + switch (this.Target) + { + case LocalizationTable localizationTable: + minWidth = this.Draw(rect, localizationTable, "Table", metadataEntries, m => this.Add(localizationTable, m), m => this.Remove(localizationTable, m), () => this.OpenMetadataSelector(localizationTable)); + break; + case SharedTableData.SharedTableEntry sharedTableEntry: + minWidth = this.Draw(rect, this.localizationTableCollection.SharedData, "Shared Entry", metadataEntries, m => this.Add(sharedTableEntry, m), m => this.Remove(sharedTableEntry, m), () => this.OpenMetadataSelector(sharedTableEntry)); + break; + case TableEntry tableEntry: + minWidth = this.Draw(rect, tableEntry.Table, "Entry", metadataEntries, m => this.Add(tableEntry, m), m => this.Remove(tableEntry, m), () => this.OpenMetadataSelector(tableEntry)); + break; + default: + minWidth = this.Draw(rect, this.localizationTableCollection.SharedData, "Shared Table", metadataEntries, m => this.Add(m), m => this.Remove(m), () => this.OpenMetadataSelector(this.localizationTableCollection)); + break; + } + this.windowState.MetadataTree.EndDraw(); + + return minWidth; + } + + private float Draw(Rect rect, UnityEngine.Object target, string title, List metadataEntries, Action add, Action remove, Action openMetadataSelector) + { + const int headerHeight = 22; + const int addButtonAreaHeight = 40; + + EditorGUIUtility.labelWidth = 0f; + + // We only want to process events if the user's mouse is currently + // in the metadata panel so we grab some information for later. + var metadataPanelHasFocus = Event.current.IsMouseOver(rect); + var holdingControl = Event.current.control && metadataPanelHasFocus; + var holdingAlt = Event.current.alt && metadataPanelHasFocus; + + if (Event.current.OnKeyUp(KeyCode.LeftAlt)) + { + this.lastMetadataTypeUnderCursor = null; + } + + var searchAreaRect = rect.TakeFromTop(32); + EditorGUI.DrawRect(searchAreaRect.AlignBottom(1), SirenixGUIStyles.BorderColor); + + // Draw search field. + if (searchAreaRect.width > 125) + { + var titleWidth = SirenixGUIStyles.LabelCentered.CalcWidth(title) + 13; + var titleRect = searchAreaRect.AlignRight(titleWidth); + EditorGUI.DrawRect(titleRect.TakeFromLeft(1), SirenixGUIStyles.BorderColor); + this.searchTerm = this.searchField.Draw(searchAreaRect.SubXMax(titleWidth).Padding(6), this.searchTerm, + "Search for metadata..."); + GUI.Label(titleRect, title, SirenixGUIStyles.LabelCentered); + } + else + { + GUI.Label(searchAreaRect, title, SirenixGUIStyles.LabelCentered); + } + + var filteredMetadataEntries = string.IsNullOrWhiteSpace(this.searchTerm) + ? metadataEntries.ToList() + : metadataEntries.Where(metadataEntry => + { + if (FuzzySearch.Contains(this.searchTerm, metadataEntry.Info.TypeOfOwner.Name)) + { + return true; + } + + if (FuzzySearch.Contains(this.searchTerm, metadataEntry.ValueEntry?.WeakSmartValue?.ToString())) + { + return true; + } + + foreach (var child in metadataEntry.Children.Recurse()) + { + if (FuzzySearch.Contains(this.searchTerm, child.Name)) + { + return true; + } + + if (FuzzySearch.Contains(this.searchTerm, child.ValueEntry?.WeakSmartValue?.ToString())) + { + return true; + } + } + + return false; + }).ToList(); + + var metadataViewHeight = rect.height - addButtonAreaHeight; + GUILayout.BeginArea(rect.AlignTop(metadataViewHeight)); + this.scrollPosition = EditorGUILayout.BeginScrollView(this.scrollPosition, GUIStyle.none, GUI.skin.verticalScrollbar); + GUIHelper.BeginLayoutMeasuring(); + { + for (var i = 0; i < filteredMetadataEntries.Count; i++) + { + var metadataEntry = filteredMetadataEntries[i]; + var metadataHeaderRect = GUILayoutUtility.GetRect(0, headerHeight, GUILayoutOptions.ExpandWidth().ExpandHeight(false)); + var unchangedMetadataHeaderRect = metadataHeaderRect; + + var genericMenu = new GenericMenu(); + genericMenu.AddItem(new GUIContent("Delete"), false, () => + { + var metadata = (IMetadata)metadataEntry.ValueEntry.WeakSmartValue; + this.toBeRemoved = metadata; + }); + + var isTag = this.tags.Contains(metadataEntry.ValueEntry.TypeOfValue); + + if (!isTag) + { + genericMenu.AddItem(new GUIContent("Copy"), false, () => + { + var metadata = (IMetadata)metadataEntry.ValueEntry.WeakSmartValue; + Clipboard.Copy(metadata); + }); + + if (Clipboard.CanPaste()) + genericMenu.AddItem(new GUIContent("Paste"), false, () => + { + var metadata = (IMetadata)Clipboard.Paste(); + this.toBeAdded = metadata; + }); + else + genericMenu.AddDisabledItem(new GUIContent("Paste")); + + genericMenu.AddSeparator(""); + genericMenu.AddItem(new GUIContent($"{(metadataEntry.State.Expanded ? "Collapse" : "Expand")} All (Ctrl-Click)"), false, () => + { + var newState = !metadataEntry.State.Expanded; + foreach (var entry in filteredMetadataEntries) entry.State.Expanded = newState; + }); + genericMenu.AddItem(new GUIContent($"{(metadataEntry.State.Expanded ? "Collapse" : "Expand")} All Of Same Type (Alt-Click)"), false, () => + { + var newState = !metadataEntry.State.Expanded; + foreach (var entry in filteredMetadataEntries.Where(m => m.Info.TypeOfOwner == metadataEntry.Info.TypeOfOwner)) entry.State.Expanded = newState; + }); + } + + Color metadataHeaderBackground = new Color(0.243f, 0.243f, 0.243f); + + if (!isTag && holdingControl) + { + metadataHeaderBackground = new Color(0.278f, 0.278f, 0.278f); + + GUIHelper.RequestRepaint(); + } + else if (!isTag && holdingAlt) + { + if (Event.current.IsMouseOver(unchangedMetadataHeaderRect)) + { + this.lastMetadataTypeUnderCursor = metadataEntry.ValueEntry.TypeOfValue; + GUIHelper.RequestRepaint(); + } + + metadataHeaderBackground = this.lastMetadataTypeUnderCursor == metadataEntry.ValueEntry.TypeOfValue + ? new Color(0.278f, 0.278f, 0.278f) + : new Color(0.243f, 0.243f, 0.243f); + } + + if (Event.current.IsMouseOver(unchangedMetadataHeaderRect)) + { + metadataHeaderBackground = new Color(0.278f, 0.278f, 0.278f); + } + + EditorGUI.DrawRect(unchangedMetadataHeaderRect, metadataHeaderBackground); + + if (i != 0) + { + EditorGUI.DrawRect(unchangedMetadataHeaderRect.AlignTop(1), new Color(0.102f, 0.102f, 0.102f)); + } + + var foldoutTriangleRect = metadataHeaderRect.TakeFromLeft(headerHeight); + + if (!isTag) + SdfIcons.DrawIcon( + foldoutTriangleRect.Padding(6), + metadataEntry.State.Expanded ? SdfIconType.CaretDownFill : SdfIconType.CaretRightFill, + new Color(0.443f, 0.443f, 0.443f)); + + var iconRect = metadataHeaderRect.TakeFromLeft(headerHeight); + SdfIcons.DrawIcon( + iconRect.Padding(0, 4, 4, 4), + isTag ? SdfIconType.TagFill : SdfIconType.GeoAltFill, + new Color(0.933f, 0.933f, 0.933f)); + + var contextMenuIconRect = metadataHeaderRect.TakeFromRight(headerHeight); + + SdfIcons.DrawIcon(contextMenuIconRect.Padding(7), SdfIconType.ThreeDotsVertical); + + var niceName = ObjectNames.NicifyVariableName(metadataEntry.ValueEntry.TypeOfValue.GetNiceName()); + + if (metadataEntry.Info.TypeOfOwner == typeof(Comment)) + { + var headerLabelWidth = EditorStyles.label.CalcWidth(niceName) + 1; + var comment = ((string)metadataEntry.ValueEntry.WeakSmartValue).Split('\n')[0]; + var hintRect = metadataHeaderRect.AlignRight(metadataHeaderRect.width - headerLabelWidth - 10); + + if (SirenixGUIStyles.RightAlignedGreyMiniLabel.CalcWidth(comment) > hintRect.width) + { + if (hintRect.width < 30) + { + comment = ""; + } + else + { + GUI.Label(hintRect.TakeFromLeft(11), "...", SirenixGUIStyles.RightAlignedGreyMiniLabel); + } + } + + GUI.Label(hintRect, comment, SirenixGUIStyles.RightAlignedGreyMiniLabel); + } + else if (metadataEntry.Info.TypeOfOwner == typeof(PreloadAssetTableMetadata)) + { + var headerLabelWidth = EditorStyles.label.CalcWidth(niceName) + 1; + var preloadAssetLabel = ObjectNames.NicifyVariableName(metadataEntry.ValueEntry.WeakSmartValue.ToString()); + var hintRect = metadataHeaderRect.AlignRight(metadataHeaderRect.width - headerLabelWidth - 10); + + if (SirenixGUIStyles.RightAlignedGreyMiniLabel.CalcWidth(preloadAssetLabel) > hintRect.width) + { + if (hintRect.width < 30) + { + preloadAssetLabel = ""; + } + else + { + GUI.Label(hintRect.TakeFromLeft(11), "...", SirenixGUIStyles.RightAlignedGreyMiniLabel); + } + } + + GUI.Label(hintRect, preloadAssetLabel, SirenixGUIStyles.RightAlignedGreyMiniLabel); + } + else if (metadataEntry.Info.TypeOfOwner == typeof(PlatformOverride)) + { + var platformOverrides = metadataEntry.Children; + var headerLabelWidth = EditorStyles.label.CalcWidth(niceName) + 1; + var hintRect = metadataHeaderRect.AlignRight(metadataHeaderRect.width - headerLabelWidth - 10); + + this.stringBuilder.Clear(); + for (var j = 0; j < platformOverrides.Count; j++) + { + var platformOverrideInspectorProperty = platformOverrides[j]; + var platform = (RuntimePlatform)platformOverrideInspectorProperty.Children[0].ValueEntry.WeakSmartValue; + this.stringBuilder.Append(platform); + + if (j != platformOverrides.Count - 1) + { + this.stringBuilder.Append(", "); + } + } + + var platforms = this.stringBuilder.ToString(); + + if (SirenixGUIStyles.RightAlignedGreyMiniLabel.CalcWidth(platforms) > hintRect.width) + { + if (hintRect.width < 30) + { + GUI.Label(hintRect, $"[{platformOverrides.Count}]", SirenixGUIStyles.RightAlignedGreyMiniLabel); + platforms = ""; + } + else if (platformOverrides.Count > 1) + { + GUI.Label(hintRect.TakeFromLeft(11), "...", SirenixGUIStyles.RightAlignedGreyMiniLabel); + } + } + + GUI.Label(hintRect, platforms, SirenixGUIStyles.RightAlignedGreyMiniLabel); + } + + GUI.Label(metadataHeaderRect, niceName); + + var evt = Event.current; + if (evt.OnMouseDown(contextMenuIconRect, 0, false)) + genericMenu.ShowAsContext(); + else if (evt.OnMouseDown(unchangedMetadataHeaderRect, 1, false)) genericMenu.ShowAsContext(); + + if (metadataEntry.ValueEntry.TypeOfValue == typeof(ExcludeEntryFromExport)) continue; + + if (evt.OnMouseDown(unchangedMetadataHeaderRect, 0, false)) + { + if (holdingControl) + { + var newState = !metadataEntry.State.Expanded; + foreach (var entry in filteredMetadataEntries) + { + entry.State.Expanded = newState; + } + } + else if (holdingAlt) + { + var newState = !metadataEntry.State.Expanded; + foreach (var entry in filteredMetadataEntries.Where(m => m.ValueEntry.TypeOfValue == this.lastMetadataTypeUnderCursor)) + { + entry.State.Expanded = newState; + } + } + else + { + metadataEntry.State.Expanded = !metadataEntry.State.Expanded; + } + + GUIHelper.RemoveFocusControl(); + } + + if (SirenixEditorGUI.BeginFadeGroup(metadataEntry, metadataEntry.State.Expanded)) + { + EditorGUI.DrawRect(unchangedMetadataHeaderRect.AlignBottom(1), + new Color(0.188f, 0.188f, 0.188f)); + + var contentRect = EditorGUILayout.BeginVertical(); + + if (metadataEntry.ValueEntry.TypeOfValue == typeof(Comment)) + { + EditorGUILayout.BeginVertical(this.ContentPadding); + foreach (var child in metadataEntry.Children) + { + child.Draw(null); + } + EditorGUILayout.EndVertical(); + } + else if (metadataEntry.ValueEntry.TypeOfValue == typeof(PreloadAssetTableMetadata)) + { + EditorGUILayout.BeginVertical(this.ContentPadding); + + var preloadAssetTableMetadata = (PreloadAssetTableMetadata)metadataEntry.ValueEntry.WeakSmartValue; + var btnRect = EditorGUILayout.GetControlRect(false); + var leftRect = btnRect.Split(0, 2); + var mouseOverLeft = Event.current.IsMouseOver(leftRect); + var leftActive = mouseOverLeft && Event.current.type == EventType.MouseDown && Event.current.button == 0; + var leftOn = preloadAssetTableMetadata.Behaviour == PreloadAssetTableMetadata.PreloadBehaviour.NoPreload; + + var rightRect = btnRect.Split(1, 2); + var mouseOverRight = Event.current.IsMouseOver(rightRect); + var rightActive = mouseOverRight && Event.current.type == EventType.MouseDown && Event.current.button == 0; + var rightOn = preloadAssetTableMetadata.Behaviour == PreloadAssetTableMetadata.PreloadBehaviour.PreloadAll; + + if (Event.current.type == EventType.Repaint) + { + SirenixGUIStyles.ButtonLeft.Draw(leftRect, "No Preload", mouseOverLeft, leftActive, leftOn, false); + SirenixGUIStyles.ButtonRight.Draw(rightRect, "Preload All", mouseOverRight, rightActive, rightOn, false); + } + + if (Event.current.OnMouseDown(leftRect, 0, false)) + { + preloadAssetTableMetadata.Behaviour = PreloadAssetTableMetadata.PreloadBehaviour.NoPreload; + } + else if (Event.current.OnMouseDown(rightRect, 0, false)) + { + preloadAssetTableMetadata.Behaviour = PreloadAssetTableMetadata.PreloadBehaviour.PreloadAll; + } + + EditorGUILayout.EndVertical(); + } + else if (metadataEntry.ValueEntry.TypeOfValue == typeof(PlatformOverride)) + { + this.DrawPlatformOverride(metadataEntry); + } + else + { + EditorGUILayout.BeginVertical(this.ContentPadding); + foreach (var child in metadataEntry.Children) + { + child.Draw(); + } + EditorGUILayout.EndVertical(); + } + + EditorGUILayout.EndVertical(); + } + + SirenixEditorGUI.EndFadeGroup(); + } + } + var measureRect = GUIHelper.EndLayoutMeasuring(); + EditorGUILayout.EndScrollView(); + GUILayout.EndArea(); + + var pinAddMetadataButton = measureRect.height > metadataViewHeight; + rect.TakeFromTop(pinAddMetadataButton ? metadataViewHeight : measureRect.height); + + if (metadataEntries.Count > 1) + { + EditorGUI.DrawRect(rect.TakeFromTop(1), SirenixGUIStyles.BorderColor); + } + + var addMetadataRect = rect.AlignTop(addButtonAreaHeight).AlignCenter(Mathf.Min(200, rect.width - 16)).VerticalPadding(8); + + if (GUI.Button(addMetadataRect, "Add Metadata")) + { + openMetadataSelector(); + } + + // Draw the shadow that appears under the search bar while scrolling through the metadata. + GUI.DrawTexture( + searchAreaRect.AlignBottom(10).AddY(10), + OdinLocalizationGUITextures.TopToBottomFade, + ScaleMode.StretchToFill, + true, + 1.0f, + new Color(0, 0, 0, Mathf.InverseLerp(0f, 30f, this.scrollPosition.y) * 0.6f), + 0, + 0); + + if (measureRect.height > metadataViewHeight) + { + var pos = this.scrollPosition.y + metadataViewHeight; + // Draw the shadow that appears at the bottom of the metadata while scrolling through the metadata + GUI.DrawTexture( + rect.AlignTop(10).SubY(10), + OdinLocalizationGUITextures.BottomToTopFade, + ScaleMode.StretchToFill, + true, + 1.0f, + new Color(0, 0, 0, Mathf.InverseLerp(measureRect.height, measureRect.height - 30, pos) * 0.6f), + 0, + 0); + } + + return measureRect.width; + } + + private void DrawPlatformOverride(InspectorProperty metadataEntry) + { + var platformOverride = (PlatformOverride)metadataEntry.ValueEntry.WeakSmartValue; + var platformOverrideDatas = (IList)metadataEntry.Children["m_PlatformOverrides"]?.ValueEntry.WeakSmartValue; + var platformOverrideDataInspectorProperties = metadataEntry.Children["m_PlatformOverrides"]?.Children; + + if (platformOverrideDatas == null) + { + return; + } + + if (platformOverrideDatas.Count == 0) + { + platformOverride.AddPlatformOverride(RuntimePlatform.WindowsPlayer, null, null, EntryOverrideType.None); + } + + for (var i = 0; i < platformOverrideDataInspectorProperties.Count; i++) + { + var platformOverrideDataInspectorProperty = platformOverrideDataInspectorProperties[i]; + var backgroundRect = EditorGUILayout.BeginVertical(this.PlatformOverridePadding); + var backgroundColor = i % 2 == 0 ? SirenixGUIStyles.ListItemColorEven : SirenixGUIStyles.ListItemColorOdd; + EditorGUI.DrawRect(backgroundRect, backgroundColor); + platformOverrideDataInspectorProperty.Children["platform"].Draw(); + platformOverrideDataInspectorProperty.Children["entryOverrideType"].Draw(); + + var entryOverrideType = (EntryOverrideType)platformOverrideDataInspectorProperty.Children + .FirstOrDefault(c => c.Info.TypeOfValue == typeof(EntryOverrideType))?.ValueEntry.WeakSmartValue; + + var entryOverrideRect = GUILayoutUtility.GetRect(0, EditorGUIUtility.singleLineHeight, GUILayoutOptions.ExpandWidth(true).ExpandHeight(false)); + + switch (entryOverrideType) + { + case EntryOverrideType.Table: + { + var tableReference = (TableReference)platformOverrideDataInspectorProperty.Children.FirstOrDefault(c => c.Info.TypeOfValue == typeof(TableReference))?.ValueEntry.WeakSmartValue; + this.DoTableGUI(entryOverrideRect, tableReference, platformOverrideDataInspectorProperty); + break; + } + case EntryOverrideType.Entry: + { + var tableReference = (TableReference)platformOverrideDataInspectorProperty.Children.FirstOrDefault(c => c.Info.TypeOfValue == typeof(TableReference)) + ?.ValueEntry.WeakSmartValue; + var tableEntryReference = (TableEntryReference)platformOverrideDataInspectorProperty.Children.FirstOrDefault(c => c.Info.TypeOfValue == typeof(TableEntryReference))?.ValueEntry.WeakSmartValue; + this.DoTableAndEntryGUI(entryOverrideRect, tableReference, tableEntryReference, platformOverrideDataInspectorProperty, false); + break; + } + + case EntryOverrideType.TableAndEntry: + { + var tableReference = (TableReference)platformOverrideDataInspectorProperty.Children.FirstOrDefault(c => c.Info.TypeOfValue == typeof(TableReference))?.ValueEntry.WeakSmartValue; + var tableEntryReference = (TableEntryReference)platformOverrideDataInspectorProperty.Children.FirstOrDefault(c => c.Info.TypeOfValue == typeof(TableEntryReference))?.ValueEntry.WeakSmartValue; + this.DoTableAndEntryGUI(entryOverrideRect, tableReference, tableEntryReference, platformOverrideDataInspectorProperty, true); + break; + } + } + + EditorGUILayout.EndVertical(); + + var xIconRect = backgroundRect.AlignRight(10).SubX(4).AlignCenterY(10); + var mouseOverX = Event.current.IsMouseOver(xIconRect); + SdfIcons.DrawIcon(xIconRect, SdfIconType.X, mouseOverX ? Color.white : EditorStyles.label.normal.textColor); + + if (Event.current.OnMouseDown(xIconRect, 0, false)) + { + var platform = (RuntimePlatform)platformOverrideDataInspectorProperty.Children[0].ValueEntry.WeakSmartValue; + platformOverride.RemovePlatformOverride(platform); + } + } + + var addButtonRect = GUILayoutUtility.GetRect(0, 40, GUILayoutOptions.ExpandWidth().ExpandHeight(false)); + EditorGUI.DrawRect(addButtonRect.AlignTop(1), new Color(0.188f, 0.188f, 0.188f)); + + if (GUI.Button(addButtonRect.Padding(8), "Add Platform Override")) + { + var selector = new EnumSelector(); + selector.SelectionConfirmed += platforms => + { + var platform = platforms.FirstOrDefault(); + platformOverride.AddPlatformOverride(platform, null, null, EntryOverrideType.None); + }; + selector.ShowInPopup(); + } + } + + private void OpenMetadataSelector(LocalizationTableCollection localizationTableCollection) + { + this.OpenMetadataSelector(localizationTableCollection.SharedData.Metadata.MetadataEntries, MetadataType.SharedTableData); + } + + private void OpenMetadataSelector(LocalizationTable localizationTable) + { + switch (localizationTable) + { + case StringTable _: + this.OpenMetadataSelector(localizationTable.MetadataEntries, MetadataType.StringTable); + break; + case AssetTable _: + this.OpenMetadataSelector(localizationTable.MetadataEntries, MetadataType.AssetTable); + break; + } + } + + private void OpenMetadataSelector(SharedTableData.SharedTableEntry sharedTableEntry) + { + switch (this.localizationTableCollection) + { + case StringTableCollection _: + this.OpenMetadataSelector(sharedTableEntry.Metadata.MetadataEntries, MetadataType.StringTableEntry, MetadataType.SharedStringTableEntry); + break; + case AssetTableCollection _: + this.OpenMetadataSelector(sharedTableEntry.Metadata.MetadataEntries, MetadataType.AssetTableEntry, MetadataType.SharedAssetTableEntry); + break; + } + } + + private void OpenMetadataSelector(TableEntry tableEntry) + { + switch (tableEntry) + { + case StringTableEntry _: + this.OpenMetadataSelector(tableEntry.MetadataEntries, MetadataType.StringTableEntry); + break; + case AssetTableEntry _: + this.OpenMetadataSelector(tableEntry.MetadataEntries, MetadataType.AssetTableEntry); + break; + } + } + + private void OpenMetadataSelector(IList existingMetadata, params MetadataType[] allowedTypes) + { + var existingMetadataTypes = existingMetadata.Select(m => m?.GetType()).ToList(); + var metadataTypes = TypeCache.GetTypesDerivedFrom(); + var validMetadataTypes = new List(); + + foreach (var metadataType in metadataTypes) + { + var metadataAttribute = metadataType.GetCustomAttribute(); + if (metadataAttribute != null && allowedTypes.Any(allowedType => metadataAttribute.AllowedTypes.HasFlag(allowedType))) + { + if (existingMetadataTypes.Contains(metadataType) && !OdinLocalizationMetadataRegistry.MetadataAllowsMultiple.ContainsKey(metadataType)) continue; + + validMetadataTypes.Add(metadataType); + } + } + + var selector = new GenericSelector("", validMetadataTypes, false, type => ObjectNames.NicifyVariableName(type.Name)); + + foreach (var item in selector.SelectionTree.MenuItems) + { + item.SdfIcon = SdfIconType.Braces; + } + + selector.SelectionConfirmed += types => + { + var selectedType = types.FirstOrDefault(); + + if (selectedType == null) + { + return; + } + + var metadata = (IMetadata)Activator.CreateInstance(selectedType); + this.toBeAdded = metadata; + }; + selector.EnableSingleClickToSelect(); + selector.ShowInPopup(); + } + + public class TableReferenceSelector : OdinSelector + { + private Type tableType; + + public TableReferenceSelector(Type tableType) + { + this.tableType = tableType; + } + + protected override void BuildSelectionTree(OdinMenuTree tree) + { + tree.Config.SelectMenuItemsOnMouseDown = true; + tree.Selection.SupportsMultiSelect = false; + + var collectionGUIDs = AssetDatabase.FindAssets($"t:{nameof(LocalizationTableCollection)}"); + + foreach (var guid in collectionGUIDs) + { + var path = AssetDatabase.GUIDToAssetPath(guid); + var collection = AssetDatabase.LoadAssetAtPath(path); + + if (collection is null) continue; + if (collection.Tables.Count < 1) continue; + if (collection.Tables[0].asset.GetType() != this.tableType) continue; + + var collectionItem = new OdinMenuItem(tree, collection.name, collection) + { + SdfIcon = SdfIconType.Table + }; + + tree.MenuItems.Add(collectionItem); + } + } + } + + public class TableEntryReferenceSelector : OdinSelector + { + private Type tableType; + + public struct TableEntry + { + public LocalizationTableCollection Collection; + public SharedTableData.SharedTableEntry SharedEntry; + } + + public TableEntryReferenceSelector(Type tableType) + { + this.tableType = tableType; + } + + protected override void BuildSelectionTree(OdinMenuTree tree) + { + tree.Config.SelectMenuItemsOnMouseDown = true; + tree.Selection.SupportsMultiSelect = false; + + + var collectionGUIDs = AssetDatabase.FindAssets($"t:{nameof(LocalizationTableCollection)}"); + + foreach (var guid in collectionGUIDs) + { + var path = AssetDatabase.GUIDToAssetPath(guid); + var collection = AssetDatabase.LoadAssetAtPath(path); + + if (collection is null) continue; + if (collection.Tables.Count < 1) continue; + if (collection.Tables[0].asset.GetType() != this.tableType) continue; + + var collectionItem = new OdinMenuItem(tree, collection.name, collection) + { + SdfIcon = SdfIconType.Table + }; + + List entries = collection.SharedData.Entries; + + for (var j = 0; j < entries.Count; j++) + { + SharedTableData.SharedTableEntry entry = entries[j]; + + var tableEntry = new TableEntry {Collection = collection, SharedEntry = entry}; + + var entryItem = new OdinMenuItem(tree, entry.Key, tableEntry) + { + SdfIcon = SdfIconType.KeyFill + }; + + collectionItem.ChildMenuItems.Add(entryItem); + } + + collectionItem.IsSelectable = false; + tree.MenuItems.Add(collectionItem); + } + } + } + + private void DoTableGUI(Rect rect, TableReference tableReference, InspectorProperty platformOverrideData) + { + var dropDownPosition = EditorGUI.PrefixLabel(rect, new GUIContent("Table Collection")); + var label = tableReference.TableCollectionName; + + if (EditorGUI.DropdownButton(dropDownPosition, new GUIContent(label), FocusType.Passive)) + { + TableReferenceSelector tableReferenceSelector; + + tableReferenceSelector = this.localizationTableCollection.GetType() == typeof(AssetTableCollection) + ? new TableReferenceSelector(typeof(AssetTable)) + : new TableReferenceSelector(typeof(StringTable)); + + tableReferenceSelector.GetCurrentSelection(); + + tableReferenceSelector.SelectionConfirmed += selections => + { + var selection = selections.FirstOrDefault(); + + var platformOverrideType = typeof(PlatformOverride); + var platformOverrideDataType = platformOverrideType.GetNestedType("PlatformOverrideData", BindingFlags.NonPublic); + + platformOverrideDataType + .GetField("tableReference") + .SetValue(platformOverrideData.ValueEntry.WeakSmartValue, selection.TableCollectionNameReference); + + platformOverrideDataType + .GetField("tableEntryReference") + .SetValue(platformOverrideData.ValueEntry.WeakSmartValue, (TableEntryReference) string.Empty); + }; + + tableReferenceSelector.ShowInPopup(); + } + } + + private void DoTableAndEntryGUI(Rect rect, + TableReference tableReference, + TableEntryReference tableEntryReference, + InspectorProperty platformOverrideData, + bool displayTableName) + { + var dropDownPosition = EditorGUI.PrefixLabel(rect, new GUIContent("Reference")); + + var entryLabel = tableEntryReference.ReferenceType != TableEntryReference.Type.Empty + ? tableEntryReference.ResolveKeyName(this.localizationTableCollection.SharedData) + : null; + + string label; + if (displayTableName) + { + var tableLabel = tableReference.TableCollectionName ?? ""; + label = string.IsNullOrEmpty(tableLabel) || string.IsNullOrEmpty(entryLabel) ? "None" : $"{tableLabel}/{entryLabel}"; + } + else + { + label = string.IsNullOrWhiteSpace(entryLabel) ? "None" : $"{entryLabel}"; + } + + if (EditorGUI.DropdownButton(dropDownPosition, new GUIContent(label), FocusType.Passive)) + { + Type tableType = this.localizationTableCollection.GetType() == typeof(AssetTableCollection) + ? typeof(AssetTable) + : typeof(StringTable); + + TableEntryReferenceSelector tableEntryReferenceSelector = new TableEntryReferenceSelector(tableType); + tableEntryReferenceSelector.SelectionConfirmed += selections => + { + var selection = selections.FirstOrDefault(); + var platformOverrideType = typeof(PlatformOverride); + var platformOverrideDataType = platformOverrideType.GetNestedType("PlatformOverrideData", BindingFlags.NonPublic); + + platformOverrideDataType + .GetField("tableReference") + .SetValue(platformOverrideData.ValueEntry.WeakSmartValue, selection.Collection.TableCollectionNameReference); + + platformOverrideDataType + .GetField("tableEntryReference") + .SetValue(platformOverrideData.ValueEntry.WeakSmartValue, (TableEntryReference) selection.SharedEntry.Key); + }; + + tableEntryReferenceSelector.ShowInPopup(); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/LocalizationMetadata.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/LocalizationMetadata.cs.meta new file mode 100644 index 000000000..9a8682721 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/LocalizationMetadata.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1490cea564e237341b75e0cdba1f374a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinAssetTableCollectionEditor.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinAssetTableCollectionEditor.cs new file mode 100644 index 000000000..e7ea77ad0 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinAssetTableCollectionEditor.cs @@ -0,0 +1,986 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#define USING_WIDTH_NON_PERCENT + +using System; +using System.Collections.ObjectModel; +using System.IO; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Editor.Internal; +using Sirenix.OdinInspector.Modules.Localization.Editor.Configs; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEditor.AddressableAssets.Settings; +using UnityEditor.Localization; +using UnityEngine; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class OdinAssetTableCollectionEditor : OdinTableCollectionEditor + { + public Type UserSpecifiedCollectionType; + + private AssetTableEntry pickedEntry; + private string pickedEntryOriginalGuid; + + private Action setEntryAssetTypeAction; + private Action removeEntryAssetTypeAction; + + public OdinAssetTableCollectionEditor(AssetTableCollection collection, OdinMenuEditorWindow relatedWindow, + OdinLocalizationEditorWindow.WindowState windowState) : + base(collection, relatedWindow, windowState) { } + + public void SetEntryAssetType(AssetTableEntry entry, Type assetType) + { + if (assetType == null || assetType == typeof(UnityEngine.Object)) + { + this.removeEntryAssetTypeAction(entry.KeyId, entry.Table.LocaleIdentifier.Code); + + return; + } + + this.setEntryAssetTypeAction(entry.KeyId, assetType, entry.Table.LocaleIdentifier.Code); + } + + protected override void OnInitialize() + { + this.setEntryAssetTypeAction = OdinLocalizationReflectionValues.Create_AssetTableCollection_SetEntryAssetType_PrivateMethod_Delegate(this.Collection); + + this.removeEntryAssetTypeAction = + OdinLocalizationReflectionValues.Create_AssetTableCollection_RemoveEntryAssetType_PrivateMethod_Delegate(this.Collection); + + for (var i = 0; i < this.SharedEntries.Length; i++) + { + SharedTableData.SharedTableEntry sharedEntry = this.SharedEntries[i]; + + this.MeasureEntry(sharedEntry); + } + + //this.SharedEntries.OnSharedEntryAdded += (i, sharedEntry) => { this.MeasureEntry(sharedEntry); }; + + //this.SharedEntries.OnSharedEntryRemoved += (i, sharedEntry) => { this.SharedEntryHeights.Remove(sharedEntry.Id); }; + + this.OnTableEntryModified = sharedEntry => + { + if (!this.Collection.SharedData.Contains(sharedEntry.Id)) + { + return; + } + + int index = this.SharedEntries.GetIndex(sharedEntry); + + this.MeasureEntry(sharedEntry); + + this.EntryScrollView.ReallocateRect(index, this.SharedEntryHeights[sharedEntry.Id], sharedEntry); + }; + + this.OnAssetTableEntryAdded = (collection, table, entry) => + { + if (this.Collection != collection) + { + return; + } + + this.MeasureEntry(entry.SharedEntry); + }; + + this.OnAssetTableEntryRemoved = (collection, table, entry, guid) => + { + if (this.Collection != collection) + { + return; + } + + if (entry == null) + { + return; + } + + SharedTableData.SharedTableEntry sharedEntry = table.SharedData.GetEntry(entry.KeyId); + + if (sharedEntry == null) + { + return; + } + + this.MeasureEntry(sharedEntry); + }; + } + + protected override void AllocateItems() + { + for (var i = 0; i < this.SharedEntries.Length; i++) + { + SharedTableData.SharedTableEntry sharedEntry = this.SharedEntries[i]; + + if (!this.SharedEntries.IsVisible(sharedEntry)) + { + continue; + } + + if (!this.SharedEntryHeights.ContainsKey(sharedEntry.Id)) + { + this.MeasureEntry(sharedEntry); + } + + this.EntryScrollView.AllocateRect(this.SharedEntryHeights[sharedEntry.Id], sharedEntry); + + //this.ControlIds[sharedEntry] = GUIUtility.GetControlID(FocusType.Keyboard); + } + } + + protected override void DrawItems(ref OdinGUIScrollView.VisibleItems visibleItems) + { + this.HandleObjectPickerUpdates(); + + this.MeasureVisibleEntries(ref visibleItems); + + float scrollSpeed = OdinLocalizationConfig.Instance.scrollSpeed; + + this.EntryScrollView.BeginScrollView(offset: new Vector2(this.PinnedWidth, OdinLocalizationConstants.COLUMN_HEIGHT), + addViewSize: new Vector2(-this.PinnedWidth, 0), + scrollSpeed: scrollSpeed); + { + this.DrawEntries(ref visibleItems, false); + } + this.EntryScrollView.EndScrollView(); + + this.EntryScrollView.BeginClip(offset: new Vector2(0, OdinLocalizationConstants.COLUMN_HEIGHT), ignoreScrollX: true); + { + this.DrawEntries(ref visibleItems, true); + } + this.EntryScrollView.EndClip(); + } + + protected override void MeasureAllEntries() + { + for (var i = 0; i < this.SharedEntries.Length; i++) + { + this.MeasureEntry(this.SharedEntries[i]); + } + + this.HasGUIChanged = true; + } + + protected override void MeasureVisibleEntries(ref OdinGUIScrollView.VisibleItems visibleItems) + { + int dataOffset = visibleItems.Offset; + + for (var i = 0; i < visibleItems.Length; i++) + { + if (!visibleItems.HasAssociatedData(i)) + { + continue; + } + + var sharedEntry = visibleItems.GetAssociatedData(i); + + this.MeasureEntry(sharedEntry); + + this.EntryScrollView.ReallocateRect(dataOffset + i, this.SharedEntryHeights[sharedEntry.Id], sharedEntry); + } + } + + private void MeasureEntry(SharedTableData.SharedTableEntry sharedEntry) + { + var keyColumnWidth = 0.0f; + + for (var i = 0; i < this.GUITables.Count; i++) + { + OdinGUITable table = this.GUITables[i]; + + if (table.Type != OdinGUITable.GUITableType.Key) + { + continue; + } + +#if USING_WIDTH_NON_PERCENT + keyColumnWidth = table.Width; +#else + keyColumnWidth = this.GUITables[i].Width; +#endif + break; + } + + float keyHeight = MeasureText(sharedEntry.Key, keyColumnWidth); + + Type assetSharedType = this.Collection.GetEntryAssetType(sharedEntry.Id); + float assetHeight; + + if (assetSharedType == null || assetSharedType == typeof(UnityEngine.Object)) + { + assetHeight = OdinLocalizationConstants.EMPTY_ASSET_ROW_HEIGHT; + } + else + { + assetHeight = EditorGUIUtility.HasObjectThumbnail(assetSharedType) + ? OdinLocalizationConstants.AssetPreviewRowHeight + : OdinLocalizationConstants.ASSET_ROW_HEIGHT; + } + + this.SharedEntryHeights[sharedEntry.Id] = Mathf.Max(keyHeight, assetHeight); + } + + private void DrawEntries(ref OdinGUIScrollView.VisibleItems visibleItems, bool pinned) + { + bool isDraggingControls = this.IsDraggingAnything(); + + for (var i = 0; i < visibleItems.Length; i++) + { + if (!visibleItems.HasAssociatedData(i)) + { + continue; + } + + Rect position = visibleItems.GetRect(i); + + int hint = visibleItems.Offset + i + this.ControlIdHint; + + var sharedEntry = visibleItems.GetAssociatedData(i); + + bool isEven = (visibleItems.Offset + i) % 2 == 0; + + for (var j = 0; j < this.GUITables.Count; j++) + { + OdinGUITable table = this.GUITables[j]; + + if (!table.IsVisible) + { + continue; + } + + if (table.IsPinned != pinned) + { + continue; + } + + if (!this.GUITables.TablesWithinVisibleBounds.Contains(table)) + { + position.TakeFromLeft(table.Width).Padding(OdinLocalizationConstants.ENTRY_PADDING); + continue; + } + +#if USING_WIDTH_NON_PERCENT + Rect entryRect = position.TakeFromLeft(table.Width).Padding(OdinLocalizationConstants.ENTRY_PADDING); +#else + Rect entryRect = position.TakeFromLeft(table.Width).Padding(OdinLocalizationConstants.ENTRY_PADDING); +#endif + + bool isCellPressed, isSelected; + + switch (table.Type) + { + case OdinGUITable.GUITableType.Key: + isSelected = this.IsSharedEntrySelected(sharedEntry); + + if (isSelected) + { + this.SelectionAnimFloat.Move(1 / 0.18f, Easing.InSine); + + FancyColor start = FancyColor.Gray; + + var end = OdinLocalizationGUI.Selected; + + FancyColor.PushBlend(start.Lerp(end, this.SelectionAnimFloat), FancyColor.BlendMode.Overlay); + } + + isCellPressed = DrawCell(entryRect, isEven); + + this.DrawKey(entryRect, sharedEntry, GUIUtility.GetControlID(hint, FocusType.Keyboard)); + + if (isSelected) + { + FancyColor.PopBlend(); + } + + if (isCellPressed) + { + this.SelectSharedEntry(sharedEntry); + } + + break; + + case OdinGUITable.GUITableType.Default: + AssetTableEntry entry = table.Asset.GetEntry(sharedEntry.Id); + + isSelected = this.IsEntrySelected(entry); + + if (isSelected) + { + this.SelectionAnimFloat.Move(1 / 0.18f, Easing.InSine); + + FancyColor start = FancyColor.Gray; + + FancyColor end = OdinLocalizationGUI.Selected; + + FancyColor.PushBlend(start.Lerp(end, this.SelectionAnimFloat), FancyColor.BlendMode.Overlay); + } + + isCellPressed = DrawCell(entryRect, isEven); + + this.DrawEntry(entryRect, sharedEntry, entry, table, isDraggingControls); + + if (isSelected) + { + FancyColor.PopBlend(); + } + + if (isCellPressed) + { + if (entry is null) + { + entry = table.Asset.AddEntry(sharedEntry.Id, string.Empty); + } + + GUIUtility.keyboardControl = 0; + + this.SelectEntry(entry); + } + + if (isSelected && Event.current.type == EventType.KeyDown && EditorWindow.focusedWindow == this.RelatedWindow) + { + switch (Event.current.keyCode) + { + case KeyCode.Delete: + case KeyCode.Backspace: + if (entry == null) + { + break; + } + + this.AssignObjectToSharedEntry(sharedEntry, table.Asset, null); + + Event.current.Use(); + break; + + case KeyCode.Space: + case KeyCode.Return: + if (entry == null) + { + entry = table.Asset.AddEntry(sharedEntry.Id, string.Empty); + } + + this.ShowObjectPickerForEntry(entry); + + Event.current.Use(); + break; + } + } + + break; + } + } + } + } + + private void DrawEntry(Rect rect, SharedTableData.SharedTableEntry sharedEntry, AssetTableEntry entry, OdinGUITable table, + bool isDraggingControls) + { + UnityEngine.Object asset = null; + + Type entryAssetType = this.Collection.GetEntryAssetType(sharedEntry.Id); + + if (entry != null && !entry.IsEmpty) + { + asset = OdinLocalizationAssetCache.Get(entry.Guid, entryAssetType); + } + + Rect fullRect = rect; + + Rect rightMenuRect = rect.TakeFromRight(OdinLocalizationConstants.ROW_MENU_WIDTH); + rect.TakeFromLeft(OdinLocalizationConstants.ROW_MENU_WIDTH); + + rightMenuRect = rightMenuRect.Padding(0, 6); + + Rect openInspectorRect = rightMenuRect.AlignTop(14); + Rect openExplorerRect = rightMenuRect.AlignBottom(14); + + bool isMouseOverInspector = Event.current.IsMouseOver(openInspectorRect); + bool isMouseOverExplorer = Event.current.IsMouseOver(openExplorerRect); + + // TODO: some caveats to just adding this +#if true + var dragId = 0; + + if (!isDraggingControls) + { + EditorGUI.BeginChangeCheck(); + var dragValue = DragAndDropUtilities.DragAndDropZone(fullRect, asset, entryAssetType, true, false, false) as UnityEngine.Object; + dragId = DragAndDropUtilities.PrevDragAndDropId; + if (EditorGUI.EndChangeCheck() && dragValue != asset) + { + entry = this.AssignObjectToSharedEntry(sharedEntry, table.Asset, dragValue); + asset = dragValue; + entryAssetType = this.Collection.GetEntryAssetType(sharedEntry.Id); + } + } +#endif + + bool hasThumbnail = EditorGUIUtility.HasObjectThumbnail(entryAssetType); + + if (asset != null) + { + if (Event.current.OnMouseDown(rect, 0, false) && Event.current.clickCount >= 2) + { + EditorGUIUtility.PingObject(asset); + } + } + + + if (entry == null || asset == null) + { + GUI.Label(rect, $"None ({entryAssetType.Name})", SirenixGUIStyles.LabelCentered); + } + else if (!hasThumbnail) + { + GUI.Label(rect.AlignMiddle(20), + GUIHelper.TempContent($"{asset.name} ({entryAssetType.Name})", AssetPreview.GetMiniThumbnail(asset)), + SirenixGUIStyles.LabelCentered); + + if (entryAssetType != typeof(UnityEngine.Object)) + { + var c = EditorGUIUtility.isProSkin + ? new Color(1, 1, 1, isMouseOverInspector ? 0.8f : 0.3f) + : new Color(0, 0, 0, isMouseOverInspector ? 0.8f : 0.3f); + + var c1 = EditorGUIUtility.isProSkin + ? new Color(1, 1, 1, isMouseOverExplorer ? 0.8f : 0.3f) + : new Color(0, 0, 0, isMouseOverExplorer ? 0.8f : 0.3f); + + SdfIcons.DrawIcon(openInspectorRect, SdfIconType.PencilFill, c); + SdfIcons.DrawIcon(openExplorerRect, SdfIconType.FolderFill, c1); + + GUI.Label(openInspectorRect, GUIHelper.TempContent(string.Empty, "Inspect Object")); + GUI.Label(openExplorerRect, GUIHelper.TempContent(string.Empty, "Show In Explorer")); + + if (Event.current.OnMouseDown(openInspectorRect, 0)) + { + GUIHelper.OpenInspectorWindow(asset); + } + + if (Event.current.OnMouseDown(openExplorerRect, 0)) + { + string assetAbsPath = Path.GetFullPath(AssetDatabase.GetAssetPath(asset)); + + if (File.Exists(assetAbsPath)) + { + EditorUtility.RevealInFinder(assetAbsPath); + +#if SIRENIX_INTERNAL + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.Tools, + $"(DEVELOPER) Opened asset path: {asset.name} ({assetAbsPath})", + Color.black, + 15.0f); +#endif + } + else + { + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.ExclamationTriangleFill, + $"Failed to find asset: {asset.name}", + SirenixGUIStyles.RedErrorColor, + 5.0f); + } + + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + } + else + { + Rect previewRect = rect.Padding(12); + + Texture preview; + + if (asset is Sprite || asset is Cubemap) + { + preview = AssetPreview.GetAssetPreview(asset); + } + else + { + preview = AssetPreview.GetMiniThumbnail(asset); + } + + if (preview == null) + { + preview = AssetDatabase.GetCachedIcon(AssetDatabase.GetAssetPath(asset)); + } + + float previewHeight = preview.height; + float aspect = (float) preview.width / preview.height; + + if (previewHeight < previewRect.height) + { + previewRect = previewRect.AlignMiddle(previewHeight < 32 ? 32 : previewHeight); + } + else + { + previewHeight = previewRect.height; + } + + float previewWidth = previewHeight * aspect; + + if (previewWidth > previewRect.width) + { + previewWidth = previewRect.width; + previewHeight = previewWidth / aspect; + } + + previewRect = previewRect.AlignCenter(previewWidth, previewHeight); + + previewRect.x = Mathf.Round(previewRect.x); + previewRect.y = Mathf.Round(previewRect.y); + previewRect.width = Mathf.Round(previewRect.width); + previewRect.height = Mathf.Round(previewRect.height); + + if (Event.current.type == EventType.Repaint) + { + if (this.IsEntrySelected(entry)) + { + GUIHelper.PushColor(OdinLocalizationGUI.Selected * new FancyColor(1.05f)); + } + + EditorStyles.objectFieldThumb.Draw(previewRect, GUIContent.none, false, false, false, false); + + if (this.IsEntrySelected(entry)) + { + GUIHelper.PopColor(); + } + } + + GUI.DrawTexture(previewRect, preview, ScaleMode.ScaleToFit); + + GUI.DrawTexture(previewRect, Texture2D.whiteTexture, ScaleMode.StretchToFill, true, 1.0f, new FancyColor(0.17f), 1, 0); + + var c = EditorGUIUtility.isProSkin + ? new Color(1, 1, 1, isMouseOverInspector ? 0.8f : 0.3f) + : new Color(0, 0, 0, isMouseOverInspector ? 0.8f : 0.3f); + + var c1 = EditorGUIUtility.isProSkin + ? new Color(1, 1, 1, isMouseOverExplorer ? 0.8f : 0.3f) + : new Color(0, 0, 0, isMouseOverExplorer ? 0.8f : 0.3f); + + SdfIcons.DrawIcon(openInspectorRect, SdfIconType.PencilFill, c); + SdfIcons.DrawIcon(openExplorerRect, SdfIconType.FolderFill, c1); + + GUI.Label(openInspectorRect, GUIHelper.TempContent(string.Empty, "Inspect Object")); + GUI.Label(openExplorerRect, GUIHelper.TempContent(string.Empty, "Show In Explorer")); + + if (Event.current.OnMouseDown(openInspectorRect, 0)) + { + GUIHelper.OpenInspectorWindow(asset); + } + + if (Event.current.OnMouseDown(openExplorerRect, 0)) + { + string assetAbsPath = Path.GetFullPath(AssetDatabase.GetAssetPath(asset)); + + if (File.Exists(assetAbsPath)) + { + EditorUtility.RevealInFinder(assetAbsPath); + +#if SIRENIX_INTERNAL + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.Tools, + $"(DEVELOPER) Opened asset path: {asset.name} ({assetAbsPath})", + Color.black, + 15.0f); +#endif + } + else + { + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.ExclamationOctagonFill, + $"Failed to find asset: {asset.name} ({assetAbsPath})", + SirenixGUIStyles.RedErrorColor, + 5.0f); + } + + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + + Rect pickerRect = rightMenuRect.AlignMiddle(14); + + if (OdinLocalizationGUI.ObjectPickerButton(pickerRect)) + { + if (entry == null) + { + entry = table.Asset.AddEntry(sharedEntry.Id, string.Empty); + } + + this.ShowObjectPickerForEntry(entry); + } + + GUI.Label(pickerRect, GUIHelper.TempContent(string.Empty, "Select Object")); + +#if true + if (!isDraggingControls && DragAndDropUtilities.IsDragging && DragAndDropUtilities.HoveringAcceptedDropZone == dragId) + { + GUI.DrawTexture(fullRect, Texture2D.whiteTexture, ScaleMode.StretchToFill, false, 1, new Color(0, 0.5f, 0.8f, 0.25f), 0, 2.5f); + } +#endif + } + + public override void RemoveKey(SharedTableData.SharedTableEntry sharedEntry) + { + bool hasAssets = this.DoesSharedEntryHaveAssets(sharedEntry); + + if (!hasAssets) + { + base.RemoveKey(sharedEntry); + return; + } + + this.SharedEntryHeights.Remove(sharedEntry.Id); + + for (var i = 0; i < this.GUITables.Count; i++) + { + OdinGUITable table = this.GUITables[i]; + + if (table.Type == OdinGUITable.GUITableType.Key) + { + continue; + } + + AssetTableEntry entry = table.Asset.GetEntry(sharedEntry.Id); + + if (entry == null || entry.IsEmpty) + { + continue; + } + + this.Collection.RemoveAssetFromTable(table.Asset, sharedEntry.Id); + } + + this.Collection.RemoveEntry(sharedEntry.Id); + + this.GUITables.SetDirty(this.Collection.SharedData); + } + + private bool DoesSharedEntryHaveAssets(SharedTableData.SharedTableEntry sharedEntry) + { + Type sharedType = this.Collection.GetEntryAssetType(sharedEntry.Id); + + for (var i = 0; i < this.GUITables.Count; i++) + { + OdinGUITable table = this.GUITables[i]; + + if (table.Type == OdinGUITable.GUITableType.Key) + { + continue; + } + + if (OdinLocalizationAssetCache.Get(sharedEntry, table.Asset, sharedType) != null) + { + return true; + } + } + + return false; + } + + private void ShowObjectPickerForEntry(AssetTableEntry entry) + { + this.pickedEntry = entry; + + this.pickedEntryOriginalGuid = entry.Guid; + + UnityEngine.Object obj = null; + + Type objType = this.UserSpecifiedCollectionType ?? this.Collection.GetEntryAssetType(entry.KeyId); + + UnityEngine.Object asset = OdinLocalizationAssetCache.Get(entry.Guid, objType); + + if (asset != null) + { + obj = asset; + } + + OdinObjectSelector.Show(this.RelatedWindow, OdinObjectSelectorIds.LOCALIZATION_EDITOR, obj, objType, false); + //SirenixObjectPickerUtilities.ShowObjectPicker(obj, objType, false, string.Empty, this.RelatedWindowId); + } + + private void HandleObjectPickerUpdates() + { + if (this.pickedEntry == null) + { + return; + } + +#if true + object selectedObj = OdinObjectSelector.SelectorObject; + + try + { + if (OdinObjectSelector.IsReadyToClaim(this.RelatedWindow, OdinObjectSelectorIds.LOCALIZATION_EDITOR)) + { + this.AssignObjectToSelectorEntry(OdinObjectSelector.Claim() as UnityEngine.Object); + + Event.current.Use(); + } + else + { + if (!OdinObjectSelector.IsOpen) + { + this.pickedEntry.Guid = this.pickedEntryOriginalGuid; + this.pickedEntry = null; + this.pickedEntryOriginalGuid = string.Empty; + } + + EditorGUI.BeginChangeCheck(); + var changedValue = OdinObjectSelector.GetChangedObject(null, this.RelatedWindow, OdinObjectSelectorIds.LOCALIZATION_EDITOR); + if (EditorGUI.EndChangeCheck()) + { + if (changedValue == null) + { + this.pickedEntry.Guid = string.Empty; + } + else + { + this.pickedEntry.Guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(changedValue)); + } + } + } + } + catch (NullReferenceException exception) + { + Debug.LogError($"{nameof(NullReferenceException)}: The asset '{selectedObj ?? ""}' is NULL.\n{exception}"); + } +#else + if (Event.current.type != EventType.ExecuteCommand || + EditorGUIUtility.GetObjectPickerControlID() != this.RelatedWindowId || + this.RelatedWindowId == 0) + { + return; + } + + UnityEngine.Object selectedObj = null; + + try + { + if (Event.current.commandName == "ObjectSelectorClosed") + { + Vector2 lastScrollPosition = this.EntryScrollView.Position; + + this.pickedEntry.Guid = this.pickedEntryOriginalGuid; + + selectedObj = EditorGUIUtility.GetObjectPickerObject(); + + var table = (AssetTable) this.pickedEntry.Table; + + SharedTableData.SharedTableEntry sharedEntry = this.pickedEntry.SharedEntry; + + if (selectedObj == null) + { + this.Collection.RemoveAssetFromTable((AssetTable) this.pickedEntry.Table, + this.pickedEntry.SharedEntry.Id, + OdinLocalizationConfig.Instance.recordUndosForAssetTableEntries); + + this.pickedEntry = table.GetEntry(sharedEntry.Id) ?? table.AddEntry(sharedEntry.Id, string.Empty); + } + else + { + this.Collection.AddAssetToTable((AssetTable) this.pickedEntry.Table, + this.pickedEntry.SharedEntry.Id, + selectedObj, + OdinLocalizationConfig.Instance.recordUndosForAssetTableEntries); + + this.pickedEntry = table.GetEntry(sharedEntry.Id); + } + + EditorUtility.SetDirty(this.Collection.SharedData); + EditorUtility.SetDirty(table); + + this.EntryScrollView.Position = lastScrollPosition; + + this.pickedEntry = null; + this.pickedEntryOriginalGuid = string.Empty; + Event.current.Use(); + return; + } + + if (Event.current.commandName != "ObjectSelectorUpdated") + { + return; + } + + selectedObj = EditorGUIUtility.GetObjectPickerObject(); + + this.pickedEntry.Guid = selectedObj == null ? string.Empty : AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(selectedObj)); + + Event.current.Use(); + } + catch (NullReferenceException exception) + { + // NOTE: edge cases for when the user selects assets that appear in the object picker, but in reality are null. + Debug.LogError($"{nameof(NullReferenceException)}: The asset '{(selectedObj == null ? "" : selectedObj.name)}' is NULL.\n{exception}"); + } +#endif + } + + // TODO: implement when drag'n'drop areas are done and keyboard commands +#if true + private AssetTableEntry AssignObjectToSharedEntry(SharedTableData.SharedTableEntry sharedEntry, AssetTable table, UnityEngine.Object obj) + { + Vector2 lastScrollPosition = this.EntryScrollView.Position; + + AssetTableEntry entry; + + if (obj == null) + { + this.CustomRemoveAssetFromTable(table, sharedEntry.Id, true); + + entry = table.GetEntry(sharedEntry.Id) ?? table.AddEntry(sharedEntry.Id, string.Empty); + } + else + { + this.Collection.AddAssetToTable(table, sharedEntry.Id, obj, true); + + entry = table.GetEntry(sharedEntry.Id); + } + + this.EntryScrollView.Position = lastScrollPosition; + + return entry; + } +#endif + + private void AssignObjectToSelectorEntry(UnityEngine.Object obj) + { + object selectedObj = OdinObjectSelector.SelectorObject; + + try + { + Vector2 lastScrollPosition = this.EntryScrollView.Position; + + this.pickedEntry.Guid = this.pickedEntryOriginalGuid; + + var table = (AssetTable) this.pickedEntry.Table; + + SharedTableData.SharedTableEntry sharedEntry = this.pickedEntry.SharedEntry; + + if (obj == null) + { + this.CustomRemoveAssetFromTable((AssetTable) this.pickedEntry.Table, this.pickedEntry.SharedEntry.Id, true); + + this.pickedEntry = table.GetEntry(sharedEntry.Id) ?? table.AddEntry(sharedEntry.Id, string.Empty); + } + else + { + this.Collection.AddAssetToTable((AssetTable) this.pickedEntry.Table, this.pickedEntry.SharedEntry.Id, obj, true); + + this.pickedEntry = table.GetEntry(sharedEntry.Id); + } + + EditorUtility.SetDirty(this.Collection.SharedData); + EditorUtility.SetDirty(table); + + this.EntryScrollView.Position = lastScrollPosition; + + this.pickedEntry = null; + this.pickedEntryOriginalGuid = string.Empty; + } + catch (NullReferenceException exception) + { + Debug.LogError($"{nameof(NullReferenceException)}: The asset '{selectedObj ?? ""}' is NULL.\n{exception}"); + } + } + + public void CustomRemoveAssetFromTable(AssetTable table, TableEntryReference entryReference, bool createUndo = false) + { + if (!OdinLocalizationReflectionValues.HasAPIForCustomUndo || !OdinLocalizationConfig.Instance.useCustomUndoHandlingForAssetCollections) + { + this.Collection.RemoveAssetFromTable(table, entryReference, createUndo); + + return; + } + + var groupIndex = 0; + + if (createUndo) + { + groupIndex = Undo.GetCurrentGroup(); + Undo.IncrementCurrentGroup(); + Undo.SetCurrentGroupName("Remove asset from table"); + } + + if (createUndo) + { + Undo.RecordObjects(new UnityEngine.Object[] {table, table.SharedData}, "Remove asset from table"); + } + + AssetTableEntry tableEntry = table.GetEntryFromReference(entryReference); + + if (tableEntry == null) + { + return; + } + + string removedAssetGuid = tableEntry.Guid; + + tableEntry.Guid = string.Empty; + + AddressableAssetSettings addressableAssetSettings = OdinLocalizationEditorSettings.GetAddressableAssetSettings(false); + + if (addressableAssetSettings == null) + { + return; + } + + EditorUtility.SetDirty(table); + EditorUtility.SetDirty(table.SharedData); + + this.SetEntryAssetType(tableEntry, null); + + if (tableEntry.MetadataEntries.Count == 0) + { + table.RemoveEntry(tableEntry.KeyId); + } + + ReadOnlyCollection assetTableCollections = LocalizationEditorSettings.GetAssetTableCollections(); + + foreach (AssetTableCollection collection in assetTableCollections) + { + if (collection.GetTable(table.LocaleIdentifier) is AssetTable tableWithMatchingLocaleId && + tableWithMatchingLocaleId.ContainsValue(removedAssetGuid)) + { + return; + } + } + + AddressableAssetEntry assetEntry = addressableAssetSettings.FindAssetEntry(removedAssetGuid); + + if (assetEntry != null) + { + if (createUndo) + { + Undo.RecordObject(assetEntry.parentGroup, "Remove asset from table"); + } + + var assetLabel = (string) OdinLocalizationReflectionValues.FormatAssetLabelMethod.Invoke(null, new object[] {table.LocaleIdentifier}); + + assetEntry.SetLabel(assetLabel, false); + + OdinLocalizationReflectionValues.UpdateAssetGroupMethod.Invoke(this.Collection, new object[] {addressableAssetSettings, assetEntry, createUndo}); + } + + OdinLocalizationEvents.RaiseAssetTableEntryRemoved(this.Collection, table, tableEntry, removedAssetGuid); + + if (createUndo) + { + Undo.CollapseUndoOperations(groupIndex); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinAssetTableCollectionEditor.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinAssetTableCollectionEditor.cs.meta new file mode 100644 index 000000000..7568b7161 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinAssetTableCollectionEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bc0d9dcd4d4f4e3094085c752e185ef8 +timeCreated: 1704811181 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITable.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITable.cs new file mode 100644 index 000000000..0552ebf8f --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITable.cs @@ -0,0 +1,196 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#define USING_WIDTH_NON_PERCENT +//#undef USING_WIDTH_NON_PERCENT + +using System; +using Sirenix.OdinInspector.Editor.Internal; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEngine; +using UnityEngine.Localization; +using UnityEngine.Localization.Tables; +using UnityEngine.Serialization; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class OdinGUITable : IComparable> where TTable : LocalizationTable + { + public const string KEY_DISPLAY_NAME = "Key"; + + public enum GUITableType + { + Default, + Key + } + + public float Width + { + get => this._width; + set + { + if (value < OdinLocalizationConstants.MIN_COLUMN_WIDTH) + { + this._width = OdinLocalizationConstants.MIN_COLUMN_WIDTH; + return; + } + + this._width = Mathf.Round(value); + } + } + + public bool IsDraggingSlider = false; + public bool IsVisible; + public string DisplayName; + public GUITableType Type; + + [FormerlySerializedAs("Table")] + public TTable Asset; + public bool IsPinned; + + private float _width; + +#if USING_WIDTH_NON_PERCENT + //public float VisualWidth; +#else + internal float WidthPercentage; +#endif + +#if USING_WIDTH_NON_PERCENT + public static OdinGUITable CreateKeyTable() +#else + public static OdinGUITable CreateKeyTable(float widthPercent) +#endif + { + return new OdinGUITable + { + IsVisible = true, + DisplayName = KEY_DISPLAY_NAME, + Type = GUITableType.Key, + Asset = null, + IsPinned = false, + Width = OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH, +#if USING_WIDTH_NON_PERCENT + // VisualWidth = OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH +#else + WidthPercentage = widthPercent +#endif + }; + } + +#if USING_WIDTH_NON_PERCENT + public static OdinGUITable CreateTable(TTable table, Locale locale) +#else + public static OdinGUITable CreateTable(TTable table, float widthPercent) +#endif + { + return new OdinGUITable + { + IsVisible = true, + DisplayName = locale.LocaleName, + Type = GUITableType.Default, + Asset = table, + IsPinned = false, + Width = OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH, +#if USING_WIDTH_NON_PERCENT + // VisualWidth = OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH +#else + WidthPercentage = widthPercent +#endif + }; + } + + public int CompareTo(OdinGUITable other) + { + if (other == null) + { + return -1; + } + + if (this.IsVisible && !other.IsVisible) + { + return -1; + } + + if (!this.IsVisible && other.IsVisible) + { + return 1; + } + + if (this.IsPinned && !other.IsPinned) + { + return -1; + } + + if (!this.IsPinned && other.IsPinned) + { + return 1; + } + + if (this.DisplayName == KEY_DISPLAY_NAME && other.DisplayName == KEY_DISPLAY_NAME) + { + return 0; + } + + if (other.DisplayName == KEY_DISPLAY_NAME) + { + return 1; + } + + if (this.DisplayName == KEY_DISPLAY_NAME) + { + return -1; + } + + return this.Asset.LocaleIdentifier.CompareTo(other.Asset.LocaleIdentifier); + } + + public Vector2 HandleSlider(Rect position) + { + if (GUIUtility.hotControl == 0) + { + this.IsDraggingSlider = false; + } + + if (!GUI.enabled) + { + return Vector2.zero; + } + + EditorGUIUtility.AddCursorRect(position, MouseCursor.ResizeHorizontal); + + if (GUI.enabled && Event.current.OnMouseDown(position, 0)) + { + this.IsDraggingSlider = true; + SharedUniqueControlId.SetActive(); + EditorGUIUtility.SetWantsMouseJumping(1); + Event.current.Use(); + } + else if (SharedUniqueControlId.IsActive && this.IsDraggingSlider) + { + if (Event.current.type == EventType.MouseDrag) + { + Event.current.Use(); + GUI.changed = true; + return Event.current.delta; + } + + if (Event.current.type != EventType.MouseUp) + { + return Vector2.zero; + } + + this.IsDraggingSlider = false; + SharedUniqueControlId.SetInactive(); + EditorGUIUtility.SetWantsMouseJumping(0); + Event.current.Use(); + } + + return Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITable.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITable.cs.meta new file mode 100644 index 000000000..6ad3d1926 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITable.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c6172b1a79444464bfac84d14344febf +timeCreated: 1706411334 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITableCollection.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITableCollection.cs new file mode 100644 index 000000000..abc61f52f --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITableCollection.cs @@ -0,0 +1,483 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#define USING_WIDTH_NON_PERCENT +//#undef USING_WIDTH_NON_PERCENT + +using System; +using System.Collections.Generic; +using Sirenix.OdinInspector.Editor.Internal; +using UnityEditor; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class OdinGUITableCollection : List> where TTable : LocalizationTable + { + public readonly struct VisibleTables + { + public readonly int Offset; + public readonly int Length; + public readonly int PinnedLength; + public readonly float StartOffset; + + private readonly OdinGUITableCollection collection; + + public VisibleTables(OdinGUITableCollection collection, int offset, int length, int pinnedLength, float startOffset) + { + this.collection = collection; + this.Offset = offset; + this.Length = length + pinnedLength; + this.PinnedLength = pinnedLength; + this.StartOffset = startOffset; + } + + public OdinGUITable this[int index] => + index >= this.PinnedLength ? this.collection[this.Offset + index - this.PinnedLength] : this.collection[index]; + } + + //public VisibleTables CurrentVisibleTables; + + public HashSet> TablesWithinVisibleBounds = new HashSet>(); + + public OdinGUITableCollection(int capacity) : base(capacity) { } + +#if USING_WIDTH_NON_PERCENT + public void AddKeyTable() + { + for (var i = 0; i < this.Count; i++) + { + if (this[i].Type == OdinGUITable.GUITableType.Key) + { + return; + } + } + + this.Add(OdinGUITable.CreateKeyTable()); + } +#else + public void AddKeyTable(float widthPercent) + { + for (var i = 0; i < this.Count; i++) + { + if (this[i].Type == OdinGUITable.GUITableType.Key) + { + return; + } + } + + this.Add(OdinGUITable.CreateKeyTable(widthPercent)); + } +#endif + +#if USING_WIDTH_NON_PERCENT + public void UpdateVisibleTables(OdinGUIScrollView view, float pinnedWidth) + { +#if true + this.TablesWithinVisibleBounds.Clear(); + + var offset = 0; + var currentVisibleWidth = 0.0f; + var xMin = 0.0f; + var xMax = 0.0f; + + for (var i = 0; i < this.Count; i++) + { + OdinGUITable table = this[i]; + + if (!table.IsVisible) + { + continue; + } + + if (table.IsPinned) + { + this.TablesWithinVisibleBounds.Add(table); + continue; + } + + xMax += table.Width; + + bool isVisible = view.Position.x >= xMin && view.Position.x <= xMax; + + if (!isVisible) + { + xMin = xMax; + continue; + } + + offset = i; + + currentVisibleWidth = xMax - view.Position.x; + this.TablesWithinVisibleBounds.Add(table); + break; + } + + float width = view.Bounds.width - pinnedWidth; + + for (int i = offset + 1; i < this.Count; i++) + { + OdinGUITable table = this[i]; + + if (!table.IsVisible) + { + break; + } + + if (currentVisibleWidth >= width) + { + this.TablesWithinVisibleBounds.Add(table); + break; + } + + this.TablesWithinVisibleBounds.Add(table); + currentVisibleWidth += this[i].Width; + } +#else + if (this.GetVisibleCount() < 1) + { + this.CurrentVisibleTables = new VisibleTables(this, 0, 0, 0, 0.0f); + return; + } + + const int LENGTH_NOT_SET = -1; + + var offset = 0; + int length = LENGTH_NOT_SET; + + var currentVisibleWidth = 0.0f; + + float xMin = 0.0f, xMax = 0.0f; + + float positionX = view.Position.x; + float width = view.Bounds.width - pinnedWidth; + + for (var i = 0; i < this.Count; i++) + { + OdinGUITable table = this[i]; + + if (table.IsPinned) + { + continue; + } + + if (!table.IsVisible) + { + break; + } + + xMax += table.VisualWidth; + + bool isVisible = positionX >= xMin && positionX <= xMax; + + if (!isVisible) + { + xMin = xMax; + continue; + } + + offset = i; + + currentVisibleWidth = xMax - positionX; + break; + } + + float startOffset = xMin; + + for (int i = offset + 1; i < this.Count; i++) + { + if (!this[i].IsVisible) + { + length = i - offset; + break; + } + + if (currentVisibleWidth >= width) + { + length = i - offset + 1; + break; + } + + currentVisibleWidth += this[i].VisualWidth; + } + + int pinnedCount = this.GetPinnedCount(); + + if (length == LENGTH_NOT_SET) + { + length = this.Count - offset; + } + + this.CurrentVisibleTables = new VisibleTables(this, offset, length, pinnedCount, startOffset); +#endif + } + + public float GetVisibleWidth() + { + var result = 0.0f; + + for (var i = 0; i < this.Count; i++) + { + if (this[i].IsVisible) + { + result += this[i].Width; + } + } + + return result; + } + + public void ResizeBy(float factor) + { + for (var i = 0; i < this.Count; i++) + { + if (this[i].IsVisible) + { + this[i].Width *= factor; + } + } + } +#else + /// Calculates the field on beforehand. + /// The to perform calculations on. + public void CalcWidths(OdinGUIScrollView scrollView) + { + float viewWidth = scrollView.ViewRect.width; + + float visibleFactor = this.GetVisibleFactor(); + + for (var i = 0; i < this.Count; i++) + { + this[i].Width = viewWidth * (this[i].WidthPercentage * visibleFactor); + } + } +#endif + + public int GetLastVisibleIndex() + { + for (int i = this.Count - 1; i >= 0; i--) + { + if (this[i].IsVisible) + { + return i; + } + } + + return 0; + } + + public int GetLastVisiblePinnedIndex() + { + for (int i = this.Count - 1; i >= 0; i--) + { + if (this[i].IsVisible && this[i].IsPinned) + { + return i; + } + } + + return 0; + } + + public int GetVisibleCount() + { + var result = 0; + + for (var i = 0; i < this.Count; i++) + { + if (this[i].IsVisible) + { + result++; + } + } + + return result; + } + + public int GetHiddenCount() + { + var result = 0; + + for (var i = 0; i < this.Count; i++) + { + if (!this[i].IsVisible) + { + result++; + } + } + + return result; + } + + public int GetPinnedCount() + { + var result = 0; + + for (var i = 0; i < this.Count; i++) + { + if (this[i].IsVisible && this[i].IsPinned) + { + result++; + } + } + + return result; + } + + public OdinGUITable GetNextVisible(int index) + { + for (int i = index + 1; i < this.Count; i++) + { + if (this[i].IsVisible) + { + return this[i]; + } + } + + return null; + } + + public void UndoRecordCollection(SharedTableData sharedTableData, string name) + { + for (var i = 0; i < this.Count; i++) + { + switch (this[i].Type) + { + case OdinGUITable.GUITableType.Default: + Undo.RecordObject(this[i].Asset, name); + break; + + case OdinGUITable.GUITableType.Key: + if (sharedTableData != null) + { + Undo.RecordObject(sharedTableData, name); + } + + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + } + + public void SetDirty(SharedTableData sharedTableData) + { + for (var i = 0; i < this.Count; i++) + { + switch (this[i].Type) + { + case OdinGUITable.GUITableType.Default: + EditorUtility.SetDirty(this[i].Asset); + break; + + case OdinGUITable.GUITableType.Key: + if (sharedTableData != null) + { + EditorUtility.SetDirty(sharedTableData); + } + + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + } + +#if !USING_WIDTH_NON_PERCENT + private float GetVisibleFactor() + { + var visibleCount = 0; + var sum = 0.0f; + + for (var i = 0; i < this.Count; i++) + { + if (!this[i].IsVisible) + { + continue; + } + + sum += this[i].WidthPercentage; + visibleCount++; + } + + float result = (float) this.Count / visibleCount; + + sum *= result; + + result *= 1.0f / sum; + + return result; + } +#endif + public void ResizeToFit(float targetWidth) + { + var count = 0; + + for (var i = 0; i < this.Count; i++) + { + if (this[i].IsPinned || !this[i].IsVisible) + { + continue; + } + + count++; + } + + if (count < 1) + { + return; + } + + int averageSize = OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH * count; + + float scaleFactor = targetWidth / averageSize; + + for (var i = 0; i < this.Count; i++) + { + if (!this[i].IsVisible || this[i].IsPinned) + { + continue; + } + + this[i].Width = OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH * scaleFactor; + } + } + + public void ResizePinnedToFit(float targetWidth) + { + var currentTotalWidth = 0.0f; + + for (var i = 0; i < this.Count; i++) + { + if (!this[i].IsPinned || !this[i].IsVisible) + { + continue; + } + + currentTotalWidth += this[i].Width; + } + + if (currentTotalWidth < 1.0f) + { + return; + } + + float scaleFactor = targetWidth / currentTotalWidth; + + for (var i = 0; i < this.Count; i++) + { + if (!this[i].IsVisible || !this[i].IsPinned) + { + continue; + } + + this[i].Width *= scaleFactor; + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITableCollection.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITableCollection.cs.meta new file mode 100644 index 000000000..d34ca8724 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinGUITableCollection.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3a739bb40d31496a9591094d81fd2d19 +timeCreated: 1706411492 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinSharedEntryCollection.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinSharedEntryCollection.cs new file mode 100644 index 000000000..705c1a1f2 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinSharedEntryCollection.cs @@ -0,0 +1,441 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEditor.Localization; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class OdinSharedEntryCollection + { + private class StringComparer : IComparer + { + public bool IsAscending = true; + + public int Compare(string self, string other) + { + if (string.IsNullOrEmpty(self) && string.IsNullOrEmpty(other)) + { + return 0; + } + + if (string.IsNullOrEmpty(self)) + { + return this.IsAscending ? 1 : -1; + } + + if (string.IsNullOrEmpty(other)) + { + return this.IsAscending ? -1 : 1; + } + + return string.Compare(self, other, StringComparison.InvariantCulture); + } + } + + public enum SortOrderState + { + Unsorted, + Ascending, + Descending + } + + public bool IsSearching; + + public bool IsSorted => this.CurrentSortOrderState != SortOrderState.Unsorted; + + public int Length => this.Entries.Count; + + private string _searchTerm = string.Empty; + + private StringComparer stringComparer = new StringComparer(); + + public string SearchTerm + { + get => this._searchTerm; + private set + { + this._searchTerm = value; + + this.IsSearching = !string.IsNullOrEmpty(value); + } + } + + public List Entries => this.IsSorted ? this.SortedEntries : this.Collection.SharedData.Entries; + + public List SortedEntries; + public readonly HashSet FilteredEntries; + + public readonly LocalizationTableCollection Collection; + + public SortOrderState CurrentSortOrderState = SortOrderState.Unsorted; + + public OdinSharedEntryCollection(LocalizationTableCollection collection) + { + this.Collection = collection; + + this.FilteredEntries = new HashSet(); + } + + public SharedTableData.SharedTableEntry this[int index] => this.Entries[index]; + + public bool IsVisible(SharedTableData.SharedTableEntry sharedEntry) + { + return !this.IsSearching || (this.IsSearching && this.FilteredEntries.Contains(sharedEntry)); + } + + public bool UpdateSearchTerm(string value, + OdinGUITableCollection tables, + LocalizationTableCollection collection, + bool forceUpdate = false) where TTable : LocalizationTable + { + if (this.SearchTerm == value && !forceUpdate) + { + return false; + } + + this.SearchTerm = value; + + if (string.IsNullOrEmpty(this.SearchTerm)) + { + return true; + } + + this.FilteredEntries.Clear(); + + for (var i = 0; i < tables.Count; i++) + { + OdinGUITable table = tables[i]; + + switch (table.Type) + { + case OdinGUITable.GUITableType.Default: + switch (table.Asset) + { + case AssetTable assetTable: + var assetCollection = collection as AssetTableCollection; + + for (var j = 0; j < this.Length; j++) + { + SharedTableData.SharedTableEntry sharedEntry = this[j]; + + Type assetType = assetCollection.GetEntryAssetType(sharedEntry.Id); + + UnityEngine.Object asset = OdinLocalizationAssetCache.Get(sharedEntry, assetTable, assetType); + + if (asset == null) + { + continue; + } + + if (FuzzySearch.Contains(this.SearchTerm, asset.name)) + { + this.FilteredEntries.Add(sharedEntry); + } + } + + break; + + case StringTable stringTable: + for (var j = 0; j < this.Length; j++) + { + SharedTableData.SharedTableEntry sharedEntry = this[j]; + + StringTableEntry entry = stringTable.GetEntry(sharedEntry.Id); + + if (entry is null || string.IsNullOrEmpty(entry.Value)) + { + continue; + } + + if (FuzzySearch.Contains(this.SearchTerm, entry.Value)) + { + this.FilteredEntries.Add(sharedEntry); + } + } + + break; + } + + break; + + case OdinGUITable.GUITableType.Key: + for (var j = 0; j < this.Entries.Count; j++) + { + if (FuzzySearch.Contains(this.SearchTerm, this.Entries[j].Key)) + { + this.FilteredEntries.Add(this.Entries[j]); + } + } + + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + + return true; + } + + public void SortByKeys(bool preserveCurrentOrder) + { + switch (this.CurrentSortOrderState) + { + case SortOrderState.Ascending: + this.stringComparer.IsAscending = true; + + if (preserveCurrentOrder) + { + List result = this.Collection.SharedData.Entries.OrderBy(entry => entry.Key, this.stringComparer) + .ThenBy(this.GetOrderIndex) + .ToList(); + + this.SortedEntries = result; + } + else + { + this.SortedEntries = this.Collection.SharedData.Entries.OrderBy(entry => entry.Key, this.stringComparer).ToList(); + } + + return; + + case SortOrderState.Descending: + this.stringComparer.IsAscending = false; + + if (preserveCurrentOrder) + { + List result = this.Collection.SharedData.Entries.OrderByDescending(entry => entry.Key, this.stringComparer) + .ThenBy(this.GetOrderIndex) + .ToList(); + + this.SortedEntries = result; + } + else + { + this.SortedEntries = this.Collection.SharedData.Entries.OrderByDescending(entry => entry.Key, this.stringComparer).ToList(); + } + + return; + } + } + + public void SortByAssetTable(AssetTableCollection collection, AssetTable table, bool preserveCurrentOrder) + { + switch (this.CurrentSortOrderState) + { + case SortOrderState.Ascending: + this.stringComparer.IsAscending = true; + + if (preserveCurrentOrder) + { + List result = this.Collection.SharedData.Entries + .OrderBy(entry => GetAssetNameFromEntry(entry, table, collection), this.stringComparer) + .ThenBy(this.GetOrderIndex) + .ToList(); + + this.SortedEntries = result; + } + else + { + this.SortedEntries = this.Collection.SharedData.Entries.OrderBy(entry => GetAssetNameFromEntry(entry, table, collection), this.stringComparer) + .ToList(); + } + + return; + + case SortOrderState.Descending: + this.stringComparer.IsAscending = false; + + if (preserveCurrentOrder) + { + List result = this.Collection.SharedData.Entries + .OrderByDescending(entry => GetAssetNameFromEntry(entry, table, collection), + this.stringComparer) + .ThenBy(this.GetOrderIndex) + .ToList(); + + this.SortedEntries = result; + } + else + { + this.SortedEntries = this.Entries.OrderByDescending(entry => GetAssetNameFromEntry(entry, table, collection), this.stringComparer).ToList(); + } + + return; + } + } + + public void SortByStringTable(StringTable table, bool preserveCurrentOrder) + { + switch (this.CurrentSortOrderState) + { + case SortOrderState.Ascending: + this.stringComparer.IsAscending = true; + + if (preserveCurrentOrder) + { + List result = this.Collection.SharedData.Entries + .OrderBy(entry => GetStringFromEntry(entry, table), this.stringComparer) + .ThenBy(this.GetOrderIndex) + .ToList(); + + this.SortedEntries = result; + } + else + { + this.SortedEntries = this.Collection.SharedData.Entries.OrderBy(entry => GetStringFromEntry(entry, table), this.stringComparer).ToList(); + } + + return; + + case SortOrderState.Descending: + this.stringComparer.IsAscending = false; + + if (preserveCurrentOrder) + { + List result = this.Collection.SharedData.Entries + .OrderByDescending(entry => GetStringFromEntry(entry, table), this.stringComparer) + .ThenBy(this.GetOrderIndex) + .ToList(); + + this.SortedEntries = result; + } + else + { + this.SortedEntries = this.Entries.OrderByDescending(entry => GetStringFromEntry(entry, table), this.stringComparer).ToList(); + } + + return; + } + } + + private static string GetStringFromEntry(SharedTableData.SharedTableEntry sharedEntry, StringTable table) + { + StringTableEntry entry = table.GetEntry(sharedEntry.Id); + + return entry?.Value; + } + + private static string GetAssetNameFromEntry(SharedTableData.SharedTableEntry sharedEntry, AssetTable table, AssetTableCollection collection) + { + AssetTableEntry entry = table.GetEntry(sharedEntry.Id); + + if (entry == null || entry.IsEmpty) + { + return null; + } + + Type type = collection.GetEntryAssetType(sharedEntry.Id); + + UnityEngine.Object asset = OdinLocalizationAssetCache.Get(entry.Guid, type); + + return asset == null ? null : asset.name; + } + + public void MoveEntry(int from, int to) + { + if (from < 0 || from >= this.Entries.Count) + { + return; + } + + if (to < 0 || to > this.Entries.Count) + { + return; + } + + if (from == to) + { + return; + } + + SharedTableData.SharedTableEntry fromEntry = this.Collection.SharedData.Entries[from]; + + if (to > from) + { + to -= 1; + } + + //to = afterTo ? to + 1 : to; + + this.Collection.SharedData.Entries.RemoveAt(from); + + this.Collection.SharedData.Entries.Insert(to, fromEntry); + + OdinLocalizationEvents.RaiseTableEntryModified(this.Collection.SharedData.Entries[from]); + OdinLocalizationEvents.RaiseTableEntryModified(this.Collection.SharedData.Entries[to]); + + EditorUtility.SetDirty(this.Collection.SharedData); + } + + public void GotoNextSortOrderState() + { + switch (this.CurrentSortOrderState) + { + case SortOrderState.Unsorted: + this.CurrentSortOrderState = SortOrderState.Ascending; + break; + + case SortOrderState.Ascending: + this.CurrentSortOrderState = SortOrderState.Descending; + break; + + case SortOrderState.Descending: + this.CurrentSortOrderState = SortOrderState.Unsorted; + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + + public int GetIndex(SharedTableData.SharedTableEntry sharedEntry) + { + for (var i = 0; i < this.Length; i++) + { + if (this[i].Id == sharedEntry.Id) + { + return i; + } + } + + return -1; + } + + public int GetOrderIndex(SharedTableData.SharedTableEntry sharedEntry) + { + if (this.IsSorted && this.SortedEntries.Count == this.Length) + { + for (var i = 0; i < this.SortedEntries.Count; i++) + { + if (this.SortedEntries[i].Id == sharedEntry.Id) + { + return i; + } + } + + return -1; + } + + for (var i = 0; i < this.Length; i++) + { + if (this[i].Id == sharedEntry.Id) + { + return i; + } + } + + return -1; + } + } +} diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinSharedEntryCollection.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinSharedEntryCollection.cs.meta new file mode 100644 index 000000000..2bd2fe99e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinSharedEntryCollection.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a543e4ee8d6d4b629befbccf5aa7b5e6 +timeCreated: 1706407967 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinStringTableCollectionEditor.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinStringTableCollectionEditor.cs new file mode 100644 index 000000000..a7b74b0b8 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinStringTableCollectionEditor.cs @@ -0,0 +1,440 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#define USING_WIDTH_NON_PERCENT + +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Editor.Internal; +using Sirenix.OdinInspector.Modules.Localization.Editor.Configs; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEditor.Localization; +using UnityEngine; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class OdinStringTableCollectionEditor : OdinTableCollectionEditor + { + private string currentSyntaxSource; + private string currentSyntaxHighlightedText; + private string currentSyntaxErrorMessage; + private bool currentSyntaxHasErrors; + + public OdinStringTableCollectionEditor(StringTableCollection collection, OdinMenuEditorWindow relatedWindow, + OdinLocalizationEditorWindow.WindowState windowState) : + base(collection, relatedWindow, windowState) { } + + protected override void OnInitialize() + { + for (var i = 0; i < this.SharedEntries.Length; i++) + { + SharedTableData.SharedTableEntry sharedEntry = this.SharedEntries[i]; + + this.MeasureEntry(sharedEntry); + } + + //this.SharedEntries.OnSharedEntryAdded += (i, sharedEntry) => { this.MeasureEntry(sharedEntry); }; + + //this.SharedEntries.OnSharedEntryRemoved += (i, sharedEntry) => { this.SharedEntryHeights.Remove(sharedEntry.Id); }; + + this.OnTableEntryModified = sharedEntry => + { + if (!this.Collection.SharedData.Contains(sharedEntry.Id)) + { + return; + } + + int index = this.SharedEntries.GetIndex(sharedEntry); + + this.MeasureEntry(sharedEntry); + + this.EntryScrollView.ReallocateRect(index, this.SharedEntryHeights[sharedEntry.Id], sharedEntry); + }; + } + + protected override void AllocateItems() + { + for (var i = 0; i < this.SharedEntries.Length; i++) + { + SharedTableData.SharedTableEntry sharedEntry = this.SharedEntries[i]; + + if (!this.SharedEntries.IsVisible(sharedEntry)) + { + continue; + } + + if (!this.SharedEntryHeights.ContainsKey(sharedEntry.Id)) + { + this.MeasureEntry(sharedEntry); + } + + this.EntryScrollView.AllocateRect(this.SharedEntryHeights[sharedEntry.Id], sharedEntry); + +#if false + this.ControlIds[sharedEntry] = GUIUtility.GetControlID(FocusType.Keyboard); + + for (var j = 0; j < this.GUITables.Count; j++) + { + OdinGUITable table = this.GUITables[j]; + + if (table.Type == OdinGUITable.GUITableType.Key) + { + continue; + } + + StringTableEntry entry = table.Table.GetEntry(sharedEntry.Id); + + if (entry is null) + { + table.Table.AddEntry(sharedEntry.Id, string.Empty); + + entry = table.Table.GetEntry(sharedEntry.Id); + } + + this.ControlIds[entry] = GUIUtility.GetControlID(FocusType.Keyboard); + } +#endif + } + } + + protected override void DrawItems(ref OdinGUIScrollView.VisibleItems visibleItems) + { + this.MeasureVisibleEntries(ref visibleItems); + + float scrollSpeed = OdinLocalizationConfig.Instance.scrollSpeed; + + this.EntryScrollView.BeginScrollView(offset: new Vector2(this.PinnedWidth, OdinLocalizationConstants.COLUMN_HEIGHT), + addViewSize: new Vector2(-this.PinnedWidth, 0), + scrollSpeed: scrollSpeed); + { + this.DrawEntries(ref visibleItems, false); + } + this.EntryScrollView.EndScrollView(); + + this.EntryScrollView.BeginClip(offset: new Vector2(0.0f, OdinLocalizationConstants.COLUMN_HEIGHT), ignoreScrollX: true); + { + this.DrawEntries(ref visibleItems, true); + } + this.EntryScrollView.EndClip(); + } + + private void DrawEntries(ref OdinGUIScrollView.VisibleItems visibleItems, bool pinned) + { + for (var i = 0; i < visibleItems.Length; i++) + { + if (!visibleItems.HasAssociatedData(i)) + { + continue; + } + + int hint = visibleItems.Offset + i + this.ControlIdHint; + + Rect position = visibleItems.GetRect(i); + + var sharedEntry = visibleItems.GetAssociatedData(i); + + bool isEven = (visibleItems.Offset + i) % 2 == 0; + + for (var j = 0; j < this.GUITables.Count; j++) + { + OdinGUITable table = this.GUITables[j]; + + if (!table.IsVisible) + { + continue; + } + + if (table.IsPinned != pinned) + { + continue; + } + + if (!this.GUITables.TablesWithinVisibleBounds.Contains(table)) + { + GUIUtility.GetControlID(hint, FocusType.Keyboard); + position.TakeFromLeft(table.Width).Padding(OdinLocalizationConstants.ENTRY_PADDING); + continue; + } + + +#if USING_WIDTH_NON_PERCENT + Rect entryRect = position.TakeFromLeft(table.Width).Padding(OdinLocalizationConstants.ENTRY_PADDING); +#else + Rect entryRect = position.TakeFromLeft(table.Width).Padding(OdinLocalizationConstants.ENTRY_PADDING); +#endif + + bool isCellPressed, isSelected; + + switch (table.Type) + { + case OdinGUITable.GUITableType.Key: + isSelected = this.IsSharedEntrySelected(sharedEntry); + + if (isSelected) + { + this.SelectionAnimFloat.Move(1 / 0.18f, Easing.InSine); + + FancyColor start = FancyColor.Gray; + + var end = OdinLocalizationGUI.Selected; + + FancyColor.PushBlend(start.Lerp(end, this.SelectionAnimFloat), FancyColor.BlendMode.Overlay); + } + + isCellPressed = DrawCell(entryRect, isEven); + + this.DrawKey(entryRect, sharedEntry, GUIUtility.GetControlID(hint, FocusType.Keyboard)); + + if (isSelected) + { + FancyColor.PopBlend(); + } + + if (isCellPressed) + { + this.SelectSharedEntry(sharedEntry); + } + + break; + + case OdinGUITable.GUITableType.Default: + StringTableEntry entry = table.Asset.GetEntry(sharedEntry.Id); + + isSelected = this.IsEntrySelected(entry); + + if (isSelected) + { + this.SelectionAnimFloat.Move(1 / 0.18f, Easing.InSine); + + FancyColor start = FancyColor.Gray; + + FancyColor end = OdinLocalizationGUI.Selected; + + if (entry.IsSmart && OdinLocalizationConfig.Instance.useSyntaxHighlighter) + { + if (this.currentSyntaxSource != entry.Value) + { + this.currentSyntaxHighlightedText = OdinLocalizationSyntaxHighlighter.HighlightAsRichText(entry.Value); + this.currentSyntaxErrorMessage = OdinLocalizationSyntaxHighlighter.GetErrorMessage(entry.Value, out bool foundError); + this.currentSyntaxHasErrors = foundError; + this.currentSyntaxSource = entry.Value; + } + + if (this.currentSyntaxHasErrors) + { + FancyColor.PushBlend(start.Lerp(new FancyColor(0.68f, 0.2f, 0.2f), this.SelectionAnimFloat), FancyColor.BlendMode.Overlay); + } + else + { + FancyColor.PushBlend(start.Lerp(end, this.SelectionAnimFloat), FancyColor.BlendMode.Overlay); + } + } + else + { + FancyColor.PushBlend(start.Lerp(end, this.SelectionAnimFloat), FancyColor.BlendMode.Overlay); + } + } + + isCellPressed = DrawCell(entryRect, isEven); + + this.DrawEntry(entryRect, entry, GUIUtility.GetControlID(hint, FocusType.Keyboard), table, sharedEntry); + + if (isSelected) + { + if (OdinLocalizationConfig.Instance.useSyntaxHighlighter && entry.IsSmart && this.currentSyntaxHasErrors) + { + Rect errorRect = entryRect.AlignLeft(OdinLocalizationConstants.ROW_MENU_WIDTH).AlignMiddle(16); + + SdfIcons.DrawIcon(errorRect, SdfIconType.ExclamationOctagonFill, + Event.current.IsMouseOver(errorRect) ? new Color(1, 1, 1, 1f) : new Color(1, 1, 1, 0.6f)); + + if (Event.current.OnMouseDown(errorRect, 0)) + { + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.ExclamationOctagonFill, + this.currentSyntaxErrorMessage, + new Color(0.68f, 0.2f, 0.2f), + 20.0f); + } + } + + FancyColor.PopBlend(); + } + + if (isCellPressed) + { + if (entry is null) + { + entry = table.Asset.AddEntry(sharedEntry.Id, string.Empty); + } + + this.SelectEntry(entry); + } + + break; + } + } + } + } + + private void DrawEntry(Rect position, StringTableEntry entry, int id, OdinGUITable table, SharedTableData.SharedTableEntry sharedEntry) + { + bool changed; + string value; + + Rect smartToggleRect = position.TakeFromRight(OdinLocalizationConstants.ROW_MENU_WIDTH); + position.TakeFromLeft(OdinLocalizationConstants.ROW_MENU_WIDTH); + + if (entry?.Value is null) + { + value = OdinLocalizationGUI.TextField(position, string.Empty, out changed, id); + } + else if (OdinLocalizationConfig.Instance.useSyntaxHighlighter && entry.IsSmart && entry == this.CurrentSelectedEntry) + { + value = OdinLocalizationGUI.TextFieldSyntaxHighlighted(position, entry.Value, this.currentSyntaxHighlightedText, out changed, id); + + if (changed) + { + this.currentSyntaxHighlightedText = OdinLocalizationSyntaxHighlighter.HighlightAsRichText(value); + this.currentSyntaxErrorMessage = OdinLocalizationSyntaxHighlighter.GetErrorMessage(value, out bool foundError); + this.currentSyntaxHasErrors = foundError; + this.currentSyntaxSource = value; + } + } + else + { + value = OdinLocalizationGUI.TextField(position, entry.Value, out changed, id); + } + + if (changed) + { + if (entry == null) + { + entry = table.Asset.AddEntry(sharedEntry.Id, value); + } + + Undo.RecordObject(entry.Table, "Modified String Table Entry Text"); + entry.Value = value; + OdinLocalizationEvents.RaiseTableEntryModified(entry.SharedEntry); + EditorUtility.SetDirty(entry.Table); + } + + smartToggleRect = smartToggleRect.AlignMiddle(16); + + if (entry == null) + { + SdfIcons.DrawIcon(smartToggleRect, SdfIconType.Lightbulb, new Color(1, 1, 1, Event.current.IsMouseOver(smartToggleRect) ? 0.8f : 0.3f)); + + if (Event.current.OnMouseDown(smartToggleRect, 0)) + { + Undo.RecordObject(table.Asset, "Added String Table Entry By Smart Toggle"); + entry = table.Asset.AddEntry(sharedEntry.Id, string.Empty); + + entry.IsSmart = !entry.IsSmart; + EditorUtility.SetDirty(table.Asset); + } + } + else + { + SdfIcons.DrawIcon(smartToggleRect, + entry.IsSmart ? SdfIconType.LightbulbFill : SdfIconType.Lightbulb, + new Color(1, 1, 1, Event.current.IsMouseOver(smartToggleRect) ? 0.8f : 0.3f)); + + if (Event.current.OnMouseDown(smartToggleRect, 0)) + { + Undo.RecordObject(entry.Table, "Toggled Smart Flag On String Entry"); + entry.IsSmart = !entry.IsSmart; + EditorUtility.SetDirty(entry.Table); + } + } + + GUI.Label(smartToggleRect, GUIHelper.TempContent(string.Empty, "Toggle Smart String")); + } + + protected override void MeasureAllEntries() + { + for (var i = 0; i < this.SharedEntries.Length; i++) + { + this.MeasureEntry(this.SharedEntries[i]); + } + + this.HasGUIChanged = true; + } + + protected override void MeasureVisibleEntries(ref OdinGUIScrollView.VisibleItems visibleItems) + { + int dataOffset = visibleItems.Offset; + + for (var i = 0; i < visibleItems.Length; i++) + { + if (!visibleItems.HasAssociatedData(i)) + { + continue; + } + + var sharedEntry = visibleItems.GetAssociatedData(i); + + this.MeasureEntry(sharedEntry); + + this.EntryScrollView.ReallocateRect(dataOffset + i, this.SharedEntryHeights[sharedEntry.Id], sharedEntry); + } + } + + private void MeasureEntry(SharedTableData.SharedTableEntry sharedEntry) + { + float height = OdinLocalizationConstants.ROW_HEIGHT; + + for (var i = 0; i < this.GUITables.Count; i++) + { + OdinGUITable currentTable = this.GUITables[i]; + + switch (currentTable.Type) + { + case OdinGUITable.GUITableType.Default: + StringTableEntry strEntry = currentTable.Asset.GetEntry(sharedEntry.Id); + + if (strEntry is null) + { + continue; + } + +#if USING_WIDTH_NON_PERCENT + float strEntryHeight = MeasureText(strEntry.Value, currentTable.Width); +#else + float strEntryHeight = MeasureText(strEntry.Value, currentTable.Width); +#endif + + if (strEntryHeight > height) + { + height = strEntryHeight; + } + + break; + + case OdinGUITable.GUITableType.Key: +#if USING_WIDTH_NON_PERCENT + float keyHeight = MeasureText(sharedEntry.Key, currentTable.Width); +#else + float keyHeight = MeasureText(sharedEntry.Key, currentTable.Width); +#endif + + if (keyHeight > height) + { + height = keyHeight; + } + + break; + } + } + + this.SharedEntryHeights[sharedEntry.Id] = height; + } + + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinStringTableCollectionEditor.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinStringTableCollectionEditor.cs.meta new file mode 100644 index 000000000..695cbff7e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinStringTableCollectionEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b8803d1557464e9a9d34713c9c9755af +timeCreated: 1704811189 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTableCollectionEditor.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTableCollectionEditor.cs new file mode 100644 index 000000000..81cdfcc10 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTableCollectionEditor.cs @@ -0,0 +1,2719 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#define USING_WIDTH_NON_PERCENT +//#undef USING_WIDTH_NON_PERCENT + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Editor.Internal; +using Sirenix.OdinInspector.Modules.Localization.Editor.Configs; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Serialization; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEditor.Localization; +using UnityEngine; +using UnityEngine.Localization; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public enum OdinTableSelectionType + { + None, + SharedEntry, + SharedTable, + Table, + TableEntry + } + + public abstract class OdinTableCollectionEditor where TCollection : LocalizationTableCollection + where TTable : LocalizationTable + where TEntry : TableEntry + { + public const int SELECTOR_ID = Int32.MinValue + 14085; + + internal struct DragInfo + { + public static DragInfo None => new DragInfo {Index = -1}; + + public bool IsNone => this.Index == -1; + + public int Index; + } + + [HideInInspector] + public TCollection Collection; + + [HideInInspector] + public OdinGUITableCollection GUITables; + + [HideInInspector] + public OdinSharedEntryCollection SharedEntries; + + [HideInInspector] + public Dictionary SharedEntryHeights; + + [HideInInspector] + public OdinGUIScrollView EntryScrollView; + + [HideInInspector] + public Dictionary> LocaleTableMap; + + [HideInInspector] + public SearchField SearchField = new SearchField(); + + [HideInInspector] + public OdinTableSelectionType SelectionType = OdinTableSelectionType.None; + + [HideInInspector] + public OdinGUITable CurrentSelectedTable; + + [HideInInspector] + public SharedTableData.SharedTableEntry CurrentSelectedSharedEntry; + + [HideInInspector] + public TEntry CurrentSelectedEntry; + + [HideInInspector] + public OdinMenuItem MenuItem; + + protected OdinMenuEditorWindow RelatedWindow; + protected int RelatedWindowId; + protected OdinLocalizationEditorWindow.WindowState WindowState; + + protected float PinnedWidth; + + protected OdinGUITable KeyTable; + + protected SirenixAnimationUtility.InterpolatedFloat SelectionAnimFloat = 0.0f; + + protected int ControlIdHint = "Odin_LocalizationEditor_Control".GetHashCode(); + protected int DragDropIdHint = "Odin_LocalizationEditor_DropId".GetHashCode(); + + private bool isForceDeleteKey; + private SharedTableData.SharedTableEntry keyToRemove; + //private bool isDraggingNonHandle; + + protected Action OnTableEntryModified; + + protected Action OnAssetTableEntryAdded; + + protected Action OnAssetTableEntryRemoved; + + //protected Dictionary guiIDs; + //protected Dictionary ControlIds; + + protected bool HasHandledCurrentModifiedEntry; + protected TEntry CurrentModifiedEntry; + + private Action OnTableAddedToCollection; + + private Action OnTableRemovedFromCollection; + + private Undo.UndoRedoCallback OnUndoRedoPerformed; + + private float rightMenuWidth; + + private OdinGUITable sortedTable; + + protected readonly List LooseTables = new List(); + + public OdinTableCollectionEditor(TCollection collection, OdinMenuEditorWindow relatedWindow, OdinLocalizationEditorWindow.WindowState windowState) + { + this.Collection = collection; + this.WindowState = windowState; + + this.GUITables = new OdinGUITableCollection(this.Collection.Tables.Count); + +#if USING_WIDTH_NON_PERCENT + this.GUITables.AddKeyTable(); +#else + float averageWidthPercent = 1.0f / (this.Collection.Tables.Count + 1); + + this.GUITables.AddKeyTable(averageWidthPercent); +#endif + this.KeyTable = this.GUITables.Last(); + + this.LocaleTableMap = new Dictionary>(this.Collection.Tables.Count); + + for (var i = 0; i < this.Collection.Tables.Count; i++) + { + var tableAsset = (TTable) this.Collection.Tables[i].asset; + + Locale tableLocale = LocalizationEditorSettings.GetLocale(tableAsset.LocaleIdentifier); + + if (tableLocale == null) + { + Debug.LogWarning($"No locale found for {tableAsset.name} in {this.Collection.name}, searched for: {tableAsset.LocaleIdentifier}"); + continue; + } + +#if USING_WIDTH_NON_PERCENT + OdinGUITable table = OdinGUITable.CreateTable(tableAsset, tableLocale); +#else + OdinGUITable table = OdinGUITable.CreateTable(tableAsset, averageWidthPercent); +#endif + + this.GUITables.Add(table); + + this.LocaleTableMap[LocalizationEditorSettings.GetLocale(tableAsset.LocaleIdentifier)] = table; + } + + this.SharedEntries = new OdinSharedEntryCollection(this.Collection); + + //this.ControlIds = new Dictionary(this.SharedEntries.Length + 64); + + this.EntryScrollView = new OdinGUIScrollView(this.SharedEntries.Length + 64, adjustViewForVerticalScrollBar: false); + + this.RelatedWindow = relatedWindow; + this.RelatedWindowId = this.RelatedWindow.GetInstanceID(); + this.keyToRemove = null; + this.isForceDeleteKey = false; + + this.LooseTables.Clear(); + LocalizationEditorSettings.FindLooseStringTablesUsingSharedTableData(this.Collection.SharedData, this.LooseTables); + this.rightMenuWidth = EditorPrefs.GetFloat("OdinTableCollectionEditor_RightMenuWidth", 300.0f); + + this.OnUndoRedoPerformed += () => + { + this.Collection.RefreshAddressables(); + this.MenuItem.Name = this.Collection.SharedData.TableCollectionName; + }; + } + + protected abstract void OnInitialize(); + + private bool hasInitialized; + + public void Initialize() + { + if (this.hasInitialized) + { + return; + } + + this.SharedEntryHeights = new Dictionary(this.SharedEntries.Length + 128); + + this.OnTableAddedToCollection += (collection, table) => + { + if (this.Collection != collection) + { + return; + } + + Locale locale = LocalizationEditorSettings.GetLocale(table.LocaleIdentifier); + + if (locale == null) + { + Debug.LogWarning($"No locale found for {table.name} in {collection.name}, searched for: {table.LocaleIdentifier}"); + return; + } + + if (this.LocaleTableMap.ContainsKey(locale)) + { + return; + } + +#if USING_WIDTH_NON_PERCENT + OdinGUITable guiTable = OdinGUITable.CreateTable((TTable) table, locale); +#else + float lastAveragePercent = 1.0f / this.GUITables.Count; + + float newAveragePercent = 1.0f / (this.GUITables.Count + 1); + + for (var i = 0; i < this.GUITables.Count; i++) + { + this.GUITables[i].WidthPercentage *= newAveragePercent / lastAveragePercent; + } + + OdinGUITable guiTable = OdinGUITable.CreateTable((TTable) table, newAveragePercent); +#endif + + this.GUITables.Add(guiTable); + + this.LocaleTableMap[locale] = guiTable; + + this.LooseTables.Clear(); + LocalizationEditorSettings.FindLooseStringTablesUsingSharedTableData(this.Collection.SharedData, this.LooseTables); + }; + + this.OnTableRemovedFromCollection += (collection, table) => + { + if (this.Collection != collection) + { + return; + } + +#if !USING_WIDTH_NON_PERCENT + float lastAveragePercent = 1.0f / this.GUITables.Count; +#endif + + Locale locale = LocalizationEditorSettings.GetLocale(table.LocaleIdentifier); + + this.GUITables.Remove(this.LocaleTableMap[locale]); + + this.LocaleTableMap.Remove(locale); + +#if !USING_WIDTH_NON_PERCENT + float newAveragePercent = 1.0f / this.GUITables.Count; + + for (var i = 0; i < this.GUITables.Count; i++) + { + this.GUITables[i].WidthPercentage *= newAveragePercent / lastAveragePercent; + } +#endif + + this.LooseTables.Clear(); + LocalizationEditorSettings.FindLooseStringTablesUsingSharedTableData(this.Collection.SharedData, this.LooseTables); + }; + +#if false + this.UndoHandler = () => + { + switch (Undo.GetCurrentGroupName()) + { + case "Add table to collection": + for (var i = 0; i < this.Collection.Tables.Count; i++) + { + LocalizationTable tableAsset = this.Collection.Tables[i].asset; + Locale locale = LocalizationEditorSettings.GetLocale(tableAsset.LocaleIdentifier); + + if (locale == null) + { + Debug.LogWarning($"No locale found for {tableAsset.name} in {this.Collection.name}, searched for: {tableAsset.LocaleIdentifier}"); + continue; + } + + if (this.LocaleTableMap.ContainsKey(locale)) + { + continue; + } + + OdinGUITable table = OdinGUITable.CreateTable((TTable) tableAsset, locale); + + this.GUITables.Add(table); + + this.LocaleTableMap.Add(locale, table); + + this.Collection.RemoveTable(tableAsset); + this.Collection.AddTable(tableAsset); + } + + var localesToRemove = new Stack(); + + foreach (KeyValuePair> kvp in this.LocaleTableMap) + { + if (!this.Collection.ContainsTable(kvp.Key.Identifier)) + { + localesToRemove.Push(kvp.Key); + } + } + + while (localesToRemove.Count > 0) + { + Locale locale = localesToRemove.Pop(); + OdinGUITable table = this.LocaleTableMap[locale]; + + this.GUITables.Remove(table); + this.LocaleTableMap.Remove(locale); + } + + break; + } + }; +#endif + + this.OnInitialize(); + + this.hasInitialized = true; + } + + private bool needsToCheckForErrors = false; + + public void OnSelectInWindow() + { + this.needsToCheckForErrors = true; + + this.Initialize(); + + this.AttachEvents(); + } + + private bool hasAttachedEvents; + + public void AttachEvents() + { + if (this.hasAttachedEvents) + { + return; + } + + // this.SharedEntries.AttachEvents(); + + if (this.OnTableEntryModified != null) + { + LocalizationEditorSettings.EditorEvents.TableEntryModified += this.OnTableEntryModified; + } + + if (this.OnAssetTableEntryAdded != null) + { + LocalizationEditorSettings.EditorEvents.AssetTableEntryAdded += this.OnAssetTableEntryAdded; + } + + if (this.OnAssetTableEntryRemoved != null) + { + LocalizationEditorSettings.EditorEvents.AssetTableEntryRemoved += this.OnAssetTableEntryRemoved; + } + + if (this.OnTableAddedToCollection != null) + { + LocalizationEditorSettings.EditorEvents.TableAddedToCollection += this.OnTableAddedToCollection; + } + + if (this.OnTableRemovedFromCollection != null) + { + LocalizationEditorSettings.EditorEvents.TableRemovedFromCollection += this.OnTableRemovedFromCollection; + } + + if (this.OnUndoRedoPerformed != null) + { + Undo.undoRedoPerformed += this.OnUndoRedoPerformed; + } + + this.hasAttachedEvents = true; + } + + public void DetachEvents() + { + if (!this.hasAttachedEvents) + { + return; + } + + // this.SharedEntries.DetachEvents(); + + if (this.OnTableEntryModified != null) + { + LocalizationEditorSettings.EditorEvents.TableEntryModified -= this.OnTableEntryModified; + } + + if (this.OnAssetTableEntryAdded != null) + { + LocalizationEditorSettings.EditorEvents.AssetTableEntryAdded -= this.OnAssetTableEntryAdded; + } + + if (this.OnAssetTableEntryRemoved != null) + { + LocalizationEditorSettings.EditorEvents.AssetTableEntryRemoved -= this.OnAssetTableEntryRemoved; + } + + if (this.OnTableAddedToCollection != null) + { + LocalizationEditorSettings.EditorEvents.TableAddedToCollection -= this.OnTableAddedToCollection; + } + + if (this.OnTableRemovedFromCollection != null) + { + LocalizationEditorSettings.EditorEvents.TableRemovedFromCollection -= this.OnTableRemovedFromCollection; + } + + if (this.OnUndoRedoPerformed != null) + { + Undo.undoRedoPerformed -= this.OnUndoRedoPerformed; + } + + this.hasAttachedEvents = false; + } + + public virtual void RemoveKey(SharedTableData.SharedTableEntry sharedEntry) + { + this.SharedEntryHeights.Remove(sharedEntry.Id); + + this.GUITables.UndoRecordCollection(this.Collection.SharedData, "Removed Shared Table Entry from Collection"); + + this.Collection.RemoveEntry(sharedEntry.Id); + + this.GUITables.SetDirty(this.Collection.SharedData); + } + + public void SelectEntry(TEntry entry) + { +#if false + if (this.Collection.SharedData.Metadata.HasMetadata()) + { + var templateMetadata = this.Collection.SharedData.Metadata.GetMetadata(); + + if (templateMetadata.MetadataExpected.Count > 0) + { + for (var i = 0; i < templateMetadata.MetadataExpected.Count; i++) + { + if (this.HasMetadataAmountOfType(entry.MetadataEntries, templateMetadata.MetadataExpected[i], templateMetadata)) + { + continue; + } + + entry.AddMetadata((IMetadata) templateMetadata.MetadataExpected[i].InstantiateDefault(false)); + } + } + } +#endif + + OdinTableSelectionType lastSelectionType = this.SelectionType; + + this.SelectionType = OdinTableSelectionType.TableEntry; + + TEntry lastSelection = this.CurrentSelectedEntry; + + this.CurrentSelectedEntry = entry; + + if (lastSelection == entry && this.SelectionType == lastSelectionType) + { + return; + } + + this.SelectionAnimFloat = 0.0f; + this.SelectionAnimFloat.Destination = 1.0f; + + if (this.WindowState.CurrentTopTab != OdinLocalizationEditorWindow.RightMenuTopTabs.Metadata) + { + return; + } + + this.WindowState.ShowSharedMetadata = false; + + this.UpdateMetadataViewForEntry(entry); + } + + public void SelectSharedEntry(SharedTableData.SharedTableEntry sharedEntry) + { + this.SelectionType = OdinTableSelectionType.SharedEntry; + + if (this.CurrentSelectedSharedEntry != sharedEntry) + { + this.SelectionAnimFloat = 0.0f; + this.SelectionAnimFloat.Destination = 1.0f; + } + + this.CurrentSelectedSharedEntry = sharedEntry; + + if (this.WindowState.CurrentTopTab != OdinLocalizationEditorWindow.RightMenuTopTabs.Metadata) + { + return; + } + + this.WindowState.ShowSharedMetadata = true; + + this.WindowState.MetadataTree?.Dispose(); + + this.WindowState.MetadataTree = PropertyTree.Create(sharedEntry); + } + + public void SelectTable(OdinGUITable table) + { + this.SelectionType = table.Type == OdinGUITable.GUITableType.Key + ? OdinTableSelectionType.SharedTable + : OdinTableSelectionType.Table; + this.CurrentSelectedTable = table; + } + + public void UpdateMetadataViewForEntry(TEntry entry) + { + this.WindowState.MetadataTree?.Dispose(); + + object metadataData = null; + + if (this.WindowState.ShowSharedMetadata) + { + metadataData = entry.SharedEntry; + } + else + { + if (typeof(TEntry) == typeof(AssetTableEntry)) + { + metadataData = OdinLocalizationReflectionValues.AssetTableEntry_Data_Property.GetValue(entry); + } + + if (typeof(TEntry) == typeof(StringTableEntry)) + { + metadataData = OdinLocalizationReflectionValues.StringTableEntry_Data_Property.GetValue(entry); + } + } + + if (metadataData != null) + { + this.WindowState.MetadataTree = PropertyTree.Create(metadataData); + } + } + + public bool IsSharedEntrySelected(SharedTableData.SharedTableEntry sharedEntry) + { + return this.SelectionType == OdinTableSelectionType.SharedEntry && this.CurrentSelectedSharedEntry == sharedEntry; + } + + public bool IsEntrySelected(TEntry entry) + { + if (entry == null) + { + return false; + } + + return this.SelectionType == OdinTableSelectionType.TableEntry && this.CurrentSelectedEntry == entry; + } + + public bool IsTableSelected(OdinGUITable table) + { + + return (this.SelectionType == OdinTableSelectionType.Table || + this.SelectionType == OdinTableSelectionType.SharedTable) && this.CurrentSelectedTable == table; + } + + public void ClearSelection() + { + GUIUtility.hotControl = 0; + GUIUtility.keyboardControl = 0; + this.SelectionType = OdinTableSelectionType.None; + this.WindowState.MetadataTree?.Dispose(); + this.WindowState.MetadataTree = null; + } + + public void ClearFocus() + { + GUIUtility.hotControl = 0; + GUIUtility.keyboardControl = 0; + } + + protected bool HasGUIChanged = true; + private int lastGUIEntryCount; + + + private bool firstTimeSeeingTable = true; + + private AddressableEntryNotFoundException tableAddressableException; + private string exceptionHeaderMsg = string.Empty; + private string exceptionMsg = string.Empty; + + + [OnInspectorGUI] + public void DrawAndHandleExceptions() + { + if (this.tableAddressableException != null) + { + const float SPACING = 10; + + Rect rect = GUILayoutUtility.GetRect(0, 0, GUILayoutOptions.ExpandWidth().ExpandHeight()); + + rect = rect.AlignCenter(520, 200); + + Color shadowColor = EditorGUIUtility.isProSkin ? new Color(1, 0, 0, 0.2588235f) : new Color(1, 0, 0, 0.3137255f); + + OdinLocalizationGUI.DrawRoundBlur20(rect, shadowColor); + + Color backgroundColor = EditorGUIUtility.isProSkin ? new Color(0.6037736f, 0.1566394f, 0.1566394f) : new Color(0.8301887f, 0.238875f, 0.238875f); + + SirenixEditorGUI.DrawRoundRect(rect, backgroundColor, 7.5f); + + rect = rect.Padding(14); + + Rect buttonsArea = rect.TakeFromBottom(32); + + GUI.BeginClip(rect.Expand(14)); + { + Rect watermarkPosition = rect.SetPosition(Vector2.zero).AlignRight(80).Expand(34).AddX(30).SubY(20); + + SdfIcons.DrawIcon(watermarkPosition, SdfIconType.ExclamationDiamondFill, new Color(1, 1, 1, 0.075f)); + } + GUI.EndClip(); + + rect.height -= SPACING; + + float msgHeight = OdinLocalizationGUI.CardTitleWhite.CalcHeight(this.exceptionHeaderMsg, rect.width); + GUI.Label(rect.TakeFromTop(msgHeight), this.exceptionHeaderMsg, OdinLocalizationGUI.CardTitleWhite); + + rect.yMin += SPACING; + + GUI.Label(rect, this.exceptionMsg, SirenixGUIStyles.MultiLineWhiteLabel); + + if (OdinLocalizationGUI.OverlaidButton(buttonsArea.TakeFromRight(120), "Fix All", SdfIconType.Tools)) + { + this.Collection.RefreshAddressables(); + this.tableAddressableException = null; + + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.Tools, + $"Refreshed Addressables for '{this.Collection.name}'.", + new Color(0.26f, 0.51f, 0.44f), + 12.0f); + } + + buttonsArea.width -= SPACING; + + if (OdinLocalizationGUI.OverlaidButton(buttonsArea.TakeFromRight(160), "Fix And Preload All", SdfIconType.Tools)) + { + this.Collection.RefreshAddressables(); + this.Collection.SetPreloadTableFlag(true); + this.tableAddressableException = null; + + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.Tools, + $"Refreshed Addressables and Preloaded All Tables for '{this.Collection.name}'.", + new Color(0.26f, 0.51f, 0.44f), + 12.0f); + } + + return; + } + + try + { + this.Draw(); + + if (this.needsToCheckForErrors) + { + // NOTE: this attempts to catch any AddressableEntryNotFoundException errors, by fetching the Addressables for every table. + this.Collection.IsPreloadTableFlagSet(); + + this.needsToCheckForErrors = false; + } + } + catch (AddressableEntryNotFoundException e) + { + this.tableAddressableException = e; + + this.exceptionHeaderMsg = e.Message; + this.exceptionMsg = $"There could be multiple other tables facing the same issue in '{this.Collection.name}', " + + "this can potentially be resolved by refreshing the Addressables."; + + GUIHelper.ExitGUI(false); + } + } + + public void Draw() + { + if (Event.current.type == EventType.MouseUp) + { + SharedUniqueControlId.SetInactive(); + } + + if (this.EntryScrollView.IsDraggingMouse) + { + EditorGUIUtility.AddCursorRect(this.EntryScrollView.InteractRect, MouseCursor.Pan); + } + + if (this.HasHandledCurrentModifiedEntry) + { + this.CurrentModifiedEntry = null; + } + + // if (Event.current.type == EventType.MouseUp) + // { + // this.isDraggingNonHandle = false; + // } + // + bool shouldClearSelection = Event.current.OnKeyDown(KeyCode.Escape, false); + + //this.SharedEntries.UpdateIfChangesArePresent(); + + Rect position = GUILayoutUtility.GetRect(0, 0, GUILayoutOptions.ExpandWidth().ExpandHeight()); + + position = this.RelatedWindow.position.SetPosition(Vector2.zero); + position.TakeFromRight(this.RelatedWindow.MenuWidth); + + var leftMenuSliderRect = position.TakeFromLeft(10).SubX(1); + var rightMenuRect = position.TakeFromRight(this.WindowState.RightMenuWidth); + var rightMenuSliderRect = position.TakeFromRight(11); + + this.RelatedWindow.MenuWidth += this.VerticalSlideRect(leftMenuSliderRect.AddXMax(1), false); + this.RelatedWindow.MenuWidth = Mathf.Max(this.RelatedWindow.MenuWidth, 1); + + if (Event.current.clickCount > 1 && Event.current.IsMouseOver(leftMenuSliderRect)) + { + this.RelatedWindow.MenuWidth = 1; + + if (Event.current.control || Event.current.alt || Event.current.shift) + { + this.WindowState.RightMenuWidth = 0; + } + } + + if (Event.current.clickCount > 1 && Event.current.IsMouseOver(rightMenuSliderRect)) + { + if (Event.current.control || Event.current.alt || Event.current.shift) + { + if (this.WindowState.RightMenuWidth > 0) + { + this.WindowState.RightMenuWidth = 0; + this.WindowState.LeftMenuWidth = 0; + } + else + { + this.WindowState.RightMenuWidth = this.WindowState.LastOpenRightMenuWidth; + this.RelatedWindow.MenuWidth = this.WindowState.LastOpenRightMenuWidth; + } + } + else + { + if (this.WindowState.RightMenuWidth > 0) + { + this.WindowState.RightMenuWidth = 0; + } + else + { + this.WindowState.RightMenuWidth = this.WindowState.LastOpenRightMenuWidth; + } + } + } + + Rect toolbarRect = position.TakeFromTop(OdinLocalizationConstants.TOOLBAR_HEIGHT); + + Rect dragHandleRect = position.TakeFromLeft(OdinLocalizationConstants.DRAG_HANDLE_WIDTH); + + this.DrawToolbar(toolbarRect); + + this.GUITables.Sort(); + +#if USING_WIDTH_NON_PERCENT + for (var i = 0; i < this.GUITables.Count; i++) + { + this.GUITables[i].Width = this.GUITables[i].Width; + } +#endif + + float viewWidth = position.width; + +#if USING_WIDTH_NON_PERCENT + float columnsWidth = this.GUITables.GetVisibleWidth(); + + if (columnsWidth >= viewWidth) + { + viewWidth = columnsWidth; + } +#else + int columnsMinTotalWidth = this.GUITables.GetVisibleCount() * OdinLocalizationConstants.DEFAULT_COLUMN_WIDTH; + + if (columnsMinTotalWidth > viewWidth) + { + viewWidth = columnsMinTotalWidth; + } +#endif + + if (position != this.EntryScrollView.InteractRect) + { + this.HasGUIChanged = true; + } + + bool isEntryCountChanged = this.Collection.SharedData.Entries.Count != this.lastGUIEntryCount; + + if (this.HasGUIChanged || isEntryCountChanged) + { +#if false + if (isEntryCountChanged) + { + if (this.SharedEntries.IsSorted) + { + this.Resort(); + } + + if (this.SharedEntries.IsSearching) + { + this.SharedEntries.UpdateSearchTerm(this.SharedEntries.SearchTerm, this.GUITables, this.Collection); + } + } +#endif + + this.HasGUIChanged = false; + + if (isEntryCountChanged) + { + if (this.SharedEntries.IsSorted) + { + switch (this.sortedTable.Type) + { + case OdinGUITable.GUITableType.Default: + switch (this.sortedTable.Asset) + { + case AssetTable assetTable: + this.SharedEntries.SortByAssetTable(this.Collection as AssetTableCollection, assetTable, false); + break; + + case StringTable stringTable: + this.SharedEntries.SortByStringTable(stringTable, false); + break; + } + + break; + + case OdinGUITable.GUITableType.Key: + this.SharedEntries.SortByKeys(false); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + + if (this.SharedEntries.IsSearching) + { + this.SharedEntries.UpdateSearchTerm(this.SharedEntries.SearchTerm, this.GUITables, this.Collection, true); + } + } + + this.lastGUIEntryCount = this.Collection.SharedData.Entries.Count; + + float previousY = this.EntryScrollView.PositionY; + + this.EntryScrollView.SetBounds(position, viewWidth); + + this.EntryScrollView.BeginAllocations(); + { + this.AllocateItems(); + } + this.EntryScrollView.EndAllocations(); + + if (this.adjustViewForSeparatorChange && + this.lastViewHeight != 0.0f && + Math.Abs(this.lastViewHeight - this.EntryScrollView.ViewRect.height) > 0.01f) + { + float newHeight = this.EntryScrollView.ViewRect.height; + + float change = previousY / this.lastViewHeight; + + this.EntryScrollView.PositionY = change * newHeight; + + this.adjustViewForSeparatorChange = false; + } + } + else + { + this.EntryScrollView.SetBoundsForCurrentAllocations(position, viewWidth); + } + +#if !USING_WIDTH_NON_PERCENT + this.GUITables.CalcWidths(this.EntryScrollView); +#endif + + this.PinnedWidth = 0.0f; + + for (var i = 0; i < this.GUITables.Count; i++) + { + OdinGUITable table = this.GUITables[i]; + + if (!table.IsVisible || !table.IsPinned) + { + continue; + } + +#if USING_WIDTH_NON_PERCENT + this.PinnedWidth += table.Width; +#else + this.PinnedWidth += this.GUITables[i].Width; +#endif + } + + if (this.PinnedWidth > this.EntryScrollView.Bounds.width) + { + this.PinnedWidth = this.EntryScrollView.Bounds.width; + this.GUITables.ResizePinnedToFit(this.EntryScrollView.Bounds.width); + } + + this.GUITables.UpdateVisibleTables(this.EntryScrollView, this.PinnedWidth); + + if (this.firstTimeSeeingTable && columnsWidth < viewWidth) + { + this.GUITables.ResizeToFit(this.EntryScrollView.Bounds.width - this.PinnedWidth); + this.firstTimeSeeingTable = false; + } + + + OdinGUIScrollView.VisibleItems visibleItems = this.EntryScrollView.GetVisibleItems(); + + this.DrawRows(ref visibleItems); + + this.DrawPseudoRows(); + + this.DrawItems(ref visibleItems); + + this.DrawColumnsAndSeparators(ref visibleItems); + + this.DrawDragHandles(dragHandleRect, ref visibleItems); + + this.DrawRightMenu(rightMenuRect); + + if (this.keyToRemove != null) + { + if (this.isForceDeleteKey || + EditorUtility.DisplayDialog("Odin Table Collection Editor", $"Are you sure you want to remove entry: {this.keyToRemove.Key}?", "Yes", "No")) + { + this.RemoveKey(this.keyToRemove); + } + + this.keyToRemove = null; + this.isForceDeleteKey = false; + } + + if (shouldClearSelection) + { + this.ClearSelection(); + } + + this.EntryScrollView.HandleMiddleMouseDrag(inverted: OdinLocalizationConfig.Instance.invertMouseDragNavigation, + speed: OdinLocalizationConfig.Instance.mouseDragSpeed); + + + this.WindowState.RightMenuWidth -= this.VerticalSlideRect(rightMenuSliderRect, true); + this.WindowState.RightMenuWidth = Mathf.Max(this.WindowState.RightMenuWidth, 0); + + if (this.WindowState.RightMenuWidth > 338) + { + this.WindowState.LastOpenRightMenuWidth = this.WindowState.RightMenuWidth; + } + } + + protected abstract void AllocateItems(); + + protected abstract void DrawItems(ref OdinGUIScrollView.VisibleItems visibleItems); + + protected abstract void MeasureAllEntries(); + + protected abstract void MeasureVisibleEntries(ref OdinGUIScrollView.VisibleItems visibleItems); + + // NOTE: returns true if pressed, TODO add xml comments later + protected static bool DrawCell(Rect rect, bool isEven) + { + Color background = isEven ? OdinLocalizationGUI.RowEvenBackground2 : OdinLocalizationGUI.RowOddBackground2; + + GUI.DrawTexture(rect, Texture2D.whiteTexture, ScaleMode.StretchToFill, false, 1, background, 0, 2.5f); + + if (Event.current.IsMouseOver(rect) && !DragAndDropUtilities.IsDragging) + { + GUI.DrawTexture(rect, Texture2D.whiteTexture, ScaleMode.StretchToFill, false, 1, OdinLocalizationGUI.RowBorderHover, 1, 2.5f); + } + else + { + GUI.DrawTexture(rect, Texture2D.whiteTexture, ScaleMode.StretchToFill, false, 1, OdinLocalizationGUI.RowBorder, 1, 2.5f); + } + + rect.x += OdinLocalizationConstants.ROW_MENU_WIDTH; + rect.width -= OdinLocalizationConstants.ROW_MENU_WIDTH + OdinLocalizationConstants.ROW_MENU_WIDTH; + bool isPressed = Event.current.OnMouseDown(rect, 0, false); + + return isPressed; + } + + protected void DrawKey(Rect rect, SharedTableData.SharedTableEntry sharedEntry, int id) + { + Rect removeRect = rect.TakeFromLeft(OdinLocalizationConstants.ROW_MENU_WIDTH); + Rect copyKeyIdRect = rect.TakeFromRight(OdinLocalizationConstants.ROW_MENU_WIDTH); + + Color removeBgColor = Event.current.IsMouseOver(removeRect) ? new Color(0.8f, 0.1f, 0.1f, 0.8f) : new Color(0, 0, 0, 0.2f); + + GUI.DrawTexture(removeRect, Texture2D.whiteTexture, ScaleMode.StretchToFill, false, 1.0f, removeBgColor, Vector4.zero, + new Vector4(2.5f, 0.0f, 0.0f, 2.5f)); + + if (Event.current.OnMouseDown(removeRect, 0)) + { + this.keyToRemove = sharedEntry; + + if (Event.current.modifiers == EventModifiers.Shift) + { + this.isForceDeleteKey = true; + } + + this.ClearSelection(); + + return; + } + + Color removeFgColor = Event.current.IsMouseOver(removeRect) ? new Color(1, 1, 1, 0.8f) : new Color(1, 1, 1, 0.5f); + + removeRect = removeRect.AlignCenter(14, 14); + + SdfIcons.DrawIcon(removeRect, SdfIconType.X, removeFgColor); + + // copyKeyIdRect.x -= 20; + + copyKeyIdRect = copyKeyIdRect.AlignCenter(16, 16); + + var isMouseOverKeyRect = Event.current.IsMouseOver(copyKeyIdRect); + + Matrix4x4 m = GUI.matrix; + GUIUtility.RotateAroundPivot(45.0f, copyKeyIdRect.center); + SdfIcons.DrawIcon(copyKeyIdRect, SdfIconType.KeyFill, new Color(1, 1, 1, isMouseOverKeyRect ? 0.8f : 0.3f)); + GUI.matrix = m; + + if (isMouseOverKeyRect) + { + GUI.Label(copyKeyIdRect, GUIHelper.TempContent(string.Empty, sharedEntry.Id.ToString())); + } + + if (Event.current.OnMouseDown(copyKeyIdRect, 0)) + { + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.Clipboard, + $"Copied Key ID '{sharedEntry.Id}' to the clipboard.", + new Color(0.23f, 0.36f, 0.68f), + 8.0f); + + Clipboard.Copy(sharedEntry.Id.ToString()); + + this.ClearSelection(); + } + + string result = OdinLocalizationGUI.TextField(rect, sharedEntry.Key, out bool changed, id); + + if (!changed) + { + return; + } + + if (this.Collection.SharedData.Contains(result) && result != sharedEntry.Key) + { + this.RelatedWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.ExclamationOctagonFill, + $"Key '{result}' already exists in the collection.", + new Color(0.68f, 0.2f, 0.2f), + 8.0f); + } + else + { + Undo.RecordObject(this.Collection.SharedData, "Renamed Shared Table Entry Key"); + this.Collection.SharedData.RenameKey(sharedEntry.Id, result); + OdinLocalizationEvents.RaiseTableEntryModified(sharedEntry); + EditorUtility.SetDirty(this.Collection.SharedData); + } + } + + protected static float MeasureText(string text, float width) + { + // TODO: get rid of this magic number + width -= 20 + 20 + 8 + 16; + + float rowHeightWithoutText = OdinLocalizationConstants.ROW_HEIGHT - SirenixGUIStyles.MultiLineCenteredLabel.lineHeight; + + float heightOfText = SirenixGUIStyles.MultiLineCenteredLabel.CalcHeight(text, width) - SirenixGUIStyles.MultiLineCenteredLabel.padding.vertical; + + return rowHeightWithoutText + heightOfText; + } + + private void DrawToolbar(Rect position) + { + Rect originalPosition = position; + + Rect resizeToFitButtonRect = position.TakeFromRight(180f); + Rect addButtonRect = position.TakeFromRight(180f); + + position = position.Padding(4); + + if (GUI.Button(resizeToFitButtonRect, "Resize Columns To Fit", SirenixGUIStyles.ToolbarButton)) + { + this.GUITables.ResizeToFit(this.EntryScrollView.Bounds.width - this.PinnedWidth); + this.HasGUIChanged = true; + } + + if (GUI.Button(addButtonRect, "Add Shared Entry", SirenixGUIStyles.ToolbarButton)) + { + this.GUITables.UndoRecordCollection(this.Collection.SharedData, "Added Shared Entry To Collection"); + SharedTableData.SharedTableEntry sharedEntry = this.Collection.SharedData.AddKey(); + + OdinLocalizationEvents.RaiseTableEntryAdded(this.Collection, sharedEntry); + this.GUITables.SetDirty(this.Collection.SharedData); + } + + string searchTerm = this.SearchField.Draw(position, this.SharedEntries.SearchTerm, "Search for item(s)..."); + + if (this.SharedEntries.UpdateSearchTerm(searchTerm, this.GUITables, this.Collection)) + { + this.HasGUIChanged = true; + } + + if (!EditorGUIUtility.isProSkin) + { + EditorGUI.DrawRect(originalPosition, new Color(0, 0, 0, 0.05f)); + } + } + + private void DrawRows(ref OdinGUIScrollView.VisibleItems visibleItems) + { + Rect clipRect = this.EntryScrollView.GetClipRect(); + + clipRect.x -= OdinLocalizationConstants.DRAG_HANDLE_WIDTH; + clipRect.width += OdinLocalizationConstants.DRAG_HANDLE_WIDTH; + + this.EntryScrollView.BeginClip(clipRect, offset: new Vector2(0, OdinLocalizationConstants.COLUMN_HEIGHT)); + { + for (var i = 0; i < visibleItems.Length; i++) + { + Rect rect = visibleItems.GetRect(i); + + Rect dropZoneRect = rect; + + rect.width += OdinLocalizationConstants.DRAG_HANDLE_WIDTH; + + bool isEven = (visibleItems.Offset + i) % 2 == 0; + + EditorGUI.DrawRect(rect, isEven ? OdinLocalizationGUI.RowEvenBackground : OdinLocalizationGUI.RowOddBackground); + + this.HandleDropZone(dropZoneRect, visibleItems.Offset + i); + } + } + this.EntryScrollView.EndClip(); + } + + private void DrawPseudoRows() + { + if (this.EntryScrollView.IsBeyondVerticalBounds) + { + return; + } + + var remainderRect = new Rect(this.EntryScrollView.Bounds.x - OdinLocalizationConstants.DRAG_HANDLE_WIDTH, + this.EntryScrollView.Bounds.y + this.EntryScrollView.ViewRect.height + OdinLocalizationConstants.COLUMN_HEIGHT, + this.EntryScrollView.Bounds.width + OdinLocalizationConstants.DRAG_HANDLE_WIDTH, + this.EntryScrollView.Bounds.height - this.EntryScrollView.ViewRect.height - OdinLocalizationConstants.COLUMN_HEIGHT); + + Rect maintainedRemainderRect = remainderRect; + + bool isNextEven = this.SharedEntries.Length % 2 == 0; + + while (remainderRect.height > 0) + { + Rect rect = remainderRect.TakeFromTop(OdinLocalizationConstants.ROW_HEIGHT); + Color color = isNextEven ? OdinLocalizationGUI.RowEvenBackground : OdinLocalizationGUI.RowOddBackground; + + EditorGUI.DrawRect(rect, color); + + isNextEven = !isNextEven; + } + + EditorGUI.DrawRect(maintainedRemainderRect, new Color(0, 0, 0, 0.25f)); + } + + private void DrawColumnsAndSeparators(ref OdinGUIScrollView.VisibleItems visibleItems) + { + EditorGUI.DrawRect(this.EntryScrollView.Bounds.AlignTop(OdinLocalizationConstants.COLUMN_HEIGHT), OdinLocalizationGUI.ColumnBackground); + + Rect columnArea = this.EntryScrollView.ViewRect; + + if (!this.EntryScrollView.IsBeyondVerticalBounds) + { + columnArea.height = this.EntryScrollView.Bounds.height; + } + + int lastIndex = this.GUITables.GetLastVisibleIndex(); + + this.EntryScrollView.BeginClip(offset: new Vector2(this.PinnedWidth, 0), ignoreScrollY: true); + { + this.DrawColumns(ref visibleItems, columnArea.AlignRight(columnArea.width), false, lastIndex); + } + this.EntryScrollView.EndClip(); + + int lastPinnedIndex = this.GUITables.GetLastVisiblePinnedIndex(); + + this.EntryScrollView.BeginClip(ignoreScrollX: true, ignoreScrollY: true); + { + this.DrawColumns(ref visibleItems, columnArea, true, lastPinnedIndex); + } + this.EntryScrollView.EndClip(); + + if (this.PinnedWidth > 0.0f && this.PinnedWidth + 20 <= this.EntryScrollView.Bounds.width) + { + Rect shadowRect = this.EntryScrollView.Bounds; + + shadowRect.x += this.PinnedWidth; + shadowRect.width = 24; + + GUI.DrawTexture(shadowRect, OdinLocalizationGUITextures.LeftToRightFade, ScaleMode.StretchToFill, true, 1.0f, new Color(0, 0, 0, 0.35f), 0, 0); + } + } + + private void DrawColumns(ref OdinGUIScrollView.VisibleItems visibleItems, Rect columnArea, bool pinned, int lastIndex) + { + for (var i = 0; i < this.GUITables.Count; i++) + { + OdinGUITable table = this.GUITables[i]; + + if (table.IsPinned != pinned) + { + continue; + } + + if (!this.GUITables.TablesWithinVisibleBounds.Contains(table)) + { + columnArea.TakeFromLeft(table.Width); + continue; + } + +#if USING_WIDTH_NON_PERCENT + Rect columnRect = columnArea.TakeFromLeft(table.Width); +#else + Rect columnRect = columnArea.TakeFromLeft(table.Width); +#endif + + Rect columnHeaderRect = columnRect.AlignTop(OdinLocalizationConstants.COLUMN_HEIGHT); + + bool isSelected = this.IsTableSelected(table); + + if (isSelected) + { + FancyColor.PushBlend(FancyColor.Gray.Lerp(OdinLocalizationGUI.Selected, 0.5f), FancyColor.BlendMode.Overlay); + EditorGUI.DrawRect(columnHeaderRect, OdinLocalizationGUI.ColumnBackground); + } + + Rect interactColumnRect = columnHeaderRect.Padding(4, 0); + + if (Event.current.IsMouseOver(interactColumnRect)) + { + EditorGUI.DrawRect(columnHeaderRect, new Color(1.0f, 1.0f, 1.0f, 0.035f)); + } + + Rect pinRect = columnHeaderRect.TakeFromRight(30).SubXMax(10).AlignMiddle(18); + SdfIconType pinIcon = table.IsPinned ? SdfIconType.PinAngleFill : SdfIconType.PinAngle; + + GUI.Label(pinRect, GUIHelper.TempContent(string.Empty, "Pin Table")); + + if (Event.current.IsMouseOver(pinRect)) + { + SdfIcons.DrawIcon(pinRect, pinIcon, Color.white); + } + else + { + SdfIcons.DrawIcon(pinRect, pinIcon); + } + + if (Event.current.OnMouseDown(pinRect, 0)) + { + table.IsPinned = !table.IsPinned; + + this.ClearFocus(); + } + + float columnTextWidth = SirenixGUIStyles.LabelCentered.CalcWidth(table.DisplayName); + + Rect minSortRect = columnHeaderRect.TakeFromLeft(30).AddXMin(10); + + Rect sortRect = columnHeaderRect.AlignCenter(20, 18); + + sortRect.x -= columnTextWidth * 0.5f + 12.0f; + + if (sortRect.x < minSortRect.x) + { + sortRect = minSortRect.AlignMiddle(18); + } + + sortRect = sortRect.AlignCenter(16, 16); + + if (EditorGUIUtility.isProSkin) + { + GUI.Label(columnHeaderRect, table.DisplayName, SirenixGUIStyles.LabelCentered); + } + else + { + var t = SirenixGUIStyles.LabelCentered.normal.textColor; + SirenixGUIStyles.LabelCentered.normal.textColor = new Color(0, 0, 0, 0.7f); + GUI.Label(columnHeaderRect, table.DisplayName, SirenixGUIStyles.LabelCentered); + SirenixGUIStyles.LabelCentered.normal.textColor = t; + } + + SdfIconType sortIcon; + + if (this.sortedTable == table) + { + switch (this.SharedEntries.CurrentSortOrderState) + { + case OdinSharedEntryCollection.SortOrderState.Unsorted: + sortIcon = SdfIconType.ArrowDownUp; + break; + + case OdinSharedEntryCollection.SortOrderState.Ascending: + sortIcon = SdfIconType.ArrowDown; + break; + + case OdinSharedEntryCollection.SortOrderState.Descending: + sortIcon = SdfIconType.ArrowUp; + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + else + { + sortIcon = SdfIconType.ArrowDownUp; + } + + if (Event.current.IsMouseOver(sortRect)) + { + SdfIcons.DrawIcon(sortRect, sortIcon, Color.white); + } + else + { + SdfIcons.DrawIcon(sortRect, sortIcon); + } + + GUI.Label(sortRect, GUIHelper.TempContent(string.Empty, "Sort Table")); + + if (Event.current.OnMouseDown(sortRect, 0)) + { + bool wasSorted = this.SharedEntries.IsSorted && this.sortedTable != table; + + if (this.sortedTable == table || this.SharedEntries.CurrentSortOrderState == OdinSharedEntryCollection.SortOrderState.Unsorted) + { + this.SharedEntries.GotoNextSortOrderState(); + } + + switch (table.Type) + { + case OdinGUITable.GUITableType.Default: + switch (table.Asset) + { + case AssetTable assetTable: + this.SharedEntries.SortByAssetTable(this.Collection as AssetTableCollection, assetTable, wasSorted); + break; + + case StringTable stringTable: + this.SharedEntries.SortByStringTable(stringTable, wasSorted); + break; + } + + break; + + case OdinGUITable.GUITableType.Key: + this.SharedEntries.SortByKeys(wasSorted); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + this.sortedTable = table; + + this.ClearFocus(); + + this.HasGUIChanged = true; + } + + if (Event.current.OnMouseDown(interactColumnRect, 0)) + { + this.SelectTable(table); + } + + if (isSelected) + { + FancyColor.PopBlend(); + } + +#if !USING_WIDTH_NON_PERCENT + if (i == lastIndex) + { + continue; + } +#endif + + this.DrawSeparator(ref visibleItems, columnRect, table, i, lastIndex); + } + } + + private bool hasSeparatorChanged = false; + private bool adjustViewForSeparatorChange = false; + private float lastViewHeight; + + private void DrawSeparator(ref OdinGUIScrollView.VisibleItems visibleItems, Rect columnRect, OdinGUITable table, int index, int lastIndex) + { + Rect separatorRect = columnRect.AlignRight(1); + + EditorGUI.DrawRect(separatorRect, OdinLocalizationGUI.RowBorder); + + Rect separatorMouseRect = separatorRect.Expand(1, 0); + + switch (Event.current.type) + { + case EventType.MouseDown: + if (Event.current.button == 0 && Event.current.IsMouseOver(separatorMouseRect)) + { + //this.isDraggingNonHandle = true; + this.ClearFocus(); + } + + break; + + case EventType.MouseUp: + //if (this.isDraggingNonHandle) + //{ + // NOTE: we only adjust the ones we can see while we drag separators, to avoid unnecessary computations. + if (this.hasSeparatorChanged) + { + this.MeasureAllEntries(); + this.hasSeparatorChanged = false; + + this.adjustViewForSeparatorChange = true; + } + //} + + //this.isDraggingNonHandle = false; + break; + } + + Vector2 slideAmount = table.HandleSlider(separatorMouseRect); + + if (slideAmount.x == 0.0f) + { + return; + } + + if (!this.hasSeparatorChanged) + { + this.lastViewHeight = this.EntryScrollView.ViewRect.height; + } + + + this.hasSeparatorChanged = true; + +#if USING_WIDTH_NON_PERCENT + this.AppendWidth(slideAmount.x, index, lastIndex); +#else + float newWidth = table.Width + slideAmount.x; + + OdinGUITable nextTable = this.GUITables.GetNextVisible(index); + + float nextNewWidth = nextTable.Width - slideAmount.x; + + if (nextNewWidth < OdinLocalizationConstants.MIN_COLUMN_WIDTH) + { + float diff = OdinLocalizationConstants.MIN_COLUMN_WIDTH - nextNewWidth; + + newWidth -= diff; + + nextNewWidth += diff; + } + + if (newWidth < OdinLocalizationConstants.MIN_COLUMN_WIDTH) + { + float diff = OdinLocalizationConstants.MIN_COLUMN_WIDTH - newWidth; + + newWidth += diff; + + nextNewWidth -= diff; + } + + table.WidthPercentage *= newWidth / table.Width; + + nextTable.WidthPercentage *= nextNewWidth / nextTable.Width; +#endif + this.MeasureVisibleEntries(ref visibleItems); + } + + private void AppendWidth(float change, int index, int lastIndex) + { + OdinGUITable table = this.GUITables[index]; + + table.Width += change; + + if (change < 0.0f && table.Width <= OdinLocalizationConstants.MIN_COLUMN_WIDTH) + { + int previousIndex = index - 1; + + while (previousIndex > -1) + { + OdinGUITable previousTable = this.GUITables[previousIndex]; + + if (previousTable.IsPinned != table.IsPinned) + { + break; + } + + previousTable.Width += change; + + if (previousTable.Width <= OdinLocalizationConstants.MIN_COLUMN_WIDTH) + { + previousIndex--; + continue; + } + + break; + } + + if (previousIndex == -1) + { + previousIndex = 0; + } + + if (index != lastIndex && this.GUITables[previousIndex].Width > OdinLocalizationConstants.MIN_COLUMN_WIDTH) + { + this.GUITables[index + 1].Width -= change; + } + } + else if (index != lastIndex) + { + this.GUITables[index + 1].Width -= change; + } + } + + private void DrawDragHandles(Rect position, ref OdinGUIScrollView.VisibleItems visibleItems) + { + if (this.EntryScrollView.IsBeyondHorizontalBounds) + { + OdinGUIScrollView.ScrollBackground(position.AlignBottom(OdinGUIScrollView.SCROLL_BAR_SIZE), false); + } + + Rect clipRect = this.EntryScrollView.GetClipRect(); + + clipRect.x -= position.width; + clipRect.width = position.width; + + this.EntryScrollView.BeginClip(clipRect, offset: new Vector2(0, OdinLocalizationConstants.COLUMN_HEIGHT), ignoreScrollX: true); + { + if (this.SharedEntries.IsSorted || this.SharedEntries.IsSearching) //(this.isDraggingNonHandle) + { + for (var i = 0; i < visibleItems.Length; i++) + { + Rect dragHandleRect = visibleItems.GetRect(i); + + dragHandleRect.width = OdinLocalizationConstants.DRAG_HANDLE_WIDTH; + + dragHandleRect.x += 2; + dragHandleRect.width -= 4; + + if (EditorGUIUtility.isProSkin) + { + SdfIcons.DrawIcon(dragHandleRect.AlignMiddle(16), SdfIconType.GripVertical, new Color(0.35f, 0.35f, 0.35f, 1.0f)); + } + else + { + SdfIcons.DrawIcon(dragHandleRect.AlignMiddle(16), SdfIconType.GripVertical, new FancyColor(0.66f)); + } + } + } + else + { + bool isDraggingAnything = this.IsDraggingAnything(); + + for (var i = 0; i < visibleItems.Length; i++) + { + Rect dragHandleRect = visibleItems.GetRect(i); + + dragHandleRect.width = OdinLocalizationConstants.DRAG_HANDLE_WIDTH; + + bool isMouseOver = Event.current.IsMouseOver(dragHandleRect); + + if (!isDraggingAnything) + { + var dragData = new DragInfo {Index = visibleItems.Offset + i}; + DragAndDropUtilities.DragZone(dragHandleRect, dragData, false, false); + } + + dragHandleRect.x += 2; + dragHandleRect.width -= 4; + + if (EditorGUIUtility.isProSkin) + { + SdfIcons.DrawIcon(dragHandleRect.AlignMiddle(16), SdfIconType.GripVertical, new Color(1, 1, 1, isMouseOver ? 0.8f : 0.6f)); + } + else + { + SdfIcons.DrawIcon(dragHandleRect.AlignMiddle(16), SdfIconType.GripVertical, new Color(0, 0, 0, isMouseOver ? 0.6f : 0.4f)); + } + } + } + } + this.EntryScrollView.EndClip(); + + EditorGUI.DrawRect(position.TakeFromTop(OdinLocalizationConstants.COLUMN_HEIGHT), OdinLocalizationGUI.ColumnBackground); + } + + // NOTE: for now we pass by index, since you can't drag stuff around when you're searching or sorting + private void HandleDropZone(Rect position, int indexTo) + { + position.x += OdinLocalizationConstants.DRAG_HANDLE_WIDTH; + + float halfHeight = position.height * 0.5f; + + Rect topDropRect = position.AlignTop(halfHeight); + Rect bottomDropRect = position.AlignBottom(halfHeight); + + int topId = this.DragDropIdHint + indexTo; + + DragInfo topValue = DragAndDropUtilities.DropZone(topDropRect, DragInfo.None, this.DragDropIdHint + indexTo); + + int bottomId = this.DragDropIdHint + indexTo + this.SharedEntries.Length; + + DragInfo bottomValue = DragAndDropUtilities.DropZone(bottomDropRect, DragInfo.None, bottomId); + + if (DragAndDropUtilities.IsDragging) + { + if (DragAndDropUtilities.HoveringAcceptedDropZone == topId) + { + if (EditorGUIUtility.isProSkin) + { + GUI.DrawTexture(topDropRect.AlignTop(40.0f).SubXMin(OdinLocalizationConstants.DRAG_HANDLE_WIDTH), + OdinLocalizationGUITextures.TopToBottomFade, + ScaleMode.StretchToFill, + true, + 1.0f, + new Color(0.16f, 0.7f, 1f, 0.25f), + Vector4.zero, + Vector4.zero); + } + else + { + GUI.DrawTexture(topDropRect.AlignTop(40.0f).SubXMin(OdinLocalizationConstants.DRAG_HANDLE_WIDTH), + OdinLocalizationGUITextures.TopToBottomFade, + ScaleMode.StretchToFill, + true, + 1.0f, + new Color(0.8f, 0.8f, 1, 0.7f), + Vector4.zero, + Vector4.zero); + } + //EditorGUI.DrawRect(topDropRect.AlignTop(1), new Color(0, 1, 1, 0.5f)); + } + + if (DragAndDropUtilities.HoveringAcceptedDropZone == bottomId) + { + if (EditorGUIUtility.isProSkin) + { + GUI.DrawTexture(bottomDropRect.AlignBottom(40.0f).SubXMin(OdinLocalizationConstants.DRAG_HANDLE_WIDTH), + OdinLocalizationGUITextures.BottomToTopFade, + ScaleMode.StretchToFill, + true, + 1.0f, + new Color(0.16f, 0.7f, 1f, 0.25f), + Vector4.zero, + Vector4.zero); + } + else + { + GUI.DrawTexture(bottomDropRect.AlignBottom(40.0f).SubXMin(OdinLocalizationConstants.DRAG_HANDLE_WIDTH), + OdinLocalizationGUITextures.BottomToTopFade, + ScaleMode.StretchToFill, + true, + 1.0f, + new Color(0.8f, 0.8f, 1, 0.7f), + Vector4.zero, + Vector4.zero); + } + //EditorGUI.DrawRect(bottomDropRect.AlignBottom(1), new Color(0, 1, 1, 0.5f)); + } + } + + if (!topValue.IsNone) + { + this.SharedEntries.MoveEntry(topValue.Index, indexTo); + + this.HasGUIChanged = true; + + return; + } + + if (!bottomValue.IsNone) + { + this.SharedEntries.MoveEntry(bottomValue.Index, indexTo + 1); + + this.HasGUIChanged = true; + } + } + + protected void MoveScrollPositionToTable(OdinGUITable table) + { + var x = 0.0f; + +#if USING_WIDTH_NON_PERCENT + for (var i = 0; i < this.GUITables.Count; i++) + { + if (this.GUITables[i] == table) + { + x += this.GUITables[i].Width * 0.5f; + break; + } + + if (!this.GUITables[i].IsVisible || this.GUITables[i].IsPinned) + { + continue; + } + + x += this.GUITables[i].Width; + } +#else + for (var i = 0; i < this.GUITables.Count; i++) + { + if (this.GUITables[i] == table) + { + x += this.GUITables[i].Width * 0.5f; + break; + } + + if (!this.GUITables[i].IsVisible || this.GUITables[i].IsPinned) + { + continue; + } + + x += this.GUITables[i].Width; + } +#endif + + x -= this.EntryScrollView.Bounds.width * 0.5f; + + x += this.PinnedWidth * 0.5f; + + this.EntryScrollView.ScrollTo(1.0f / 0.35f, xPosition: x, easing: Easing.OutQuad); + } + + private float rightMenuTopPanelHeight; + private Rect topPanelRect = Rect.zero; + private Rect bottomPanelRect = Rect.zero; + + private void DrawRightMenu(Rect position) + { + EditorGUI.DrawRect(position, OdinLocalizationGUI.WindowBackground); + + var topPanelMaxHeight = position.height - 32; + this.topPanelRect = position.TakeFromTop(this.WindowState.RightMenuTopPanelHeight); + var topSlideRect = this.topPanelRect.TakeFromBottom(14); + this.bottomPanelRect = position; + + this.WindowState.RightMenuTopPanelHeight += this.HorizontalSlideRect(topSlideRect); + // 183 is enough height to show exactly 3 collapsed entries. + this.WindowState.RightMenuTopPanelHeight = Mathf.Clamp(this.WindowState.RightMenuTopPanelHeight, 183, topPanelMaxHeight); + + EditorGUI.DrawRect(this.topPanelRect, OdinLocalizationGUI.Panel); + EditorGUI.DrawRect(this.bottomPanelRect, OdinLocalizationGUI.Panel); + + + EditorGUI.DrawRect(this.topPanelRect.AlignTop(32), OdinLocalizationGUI.TabsBackground); + EditorGUI.DrawRect(this.bottomPanelRect.AlignTop(32), OdinLocalizationGUI.TabsBackground); + + this.WindowState.CurrentTopTab = OdinLocalizationGUI.Tabs(this.topPanelRect.TakeFromTop(32), this.WindowState.CurrentTopTab, 115); + + this.WindowState.CurrentBottomTab = OdinLocalizationGUI.Tabs(this.bottomPanelRect.TakeFromTop(32), this.WindowState.CurrentBottomTab, 115); + + switch (this.WindowState.CurrentTopTab) + { + case OdinLocalizationEditorWindow.RightMenuTopTabs.Metadata: + this.DrawTopTabMetadata(this.topPanelRect); + break; + + case OdinLocalizationEditorWindow.RightMenuTopTabs.Settings: + this.DrawTopTabSettings(this.topPanelRect); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + switch (this.WindowState.CurrentBottomTab) + { + case OdinLocalizationEditorWindow.RightMenuBottomTabs.Locale: + this.DrawBottomTabLocale(this.bottomPanelRect); + break; + +#if false + case OdinLocalizationEditorWindow.RightMenuBottomTabs.Template: + this.DrawBottomTabTemplate(this.bottomPanelRect); + break; +#endif + + case OdinLocalizationEditorWindow.RightMenuBottomTabs.Settings: + this.DrawBottomTabSettings(this.bottomPanelRect); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + if (Event.current.type == EventType.MouseUp && Event.current.button == 0) + { + this.dragging = false; + GUIHelper.RequestRepaint(); + } + } + + private string metadataSearchTerm = string.Empty; + private SearchField metadataSearchField = new SearchField(); + + public InspectorProperty[] GetMetadataProperties() + { + InspectorProperty metadataCollection = + this.WindowState?.MetadataTree?.RootProperty?.Children[ + OdinLocalizationReflectionValues.TABLE_ENTRY_DATA__METADATA__PATH]; + + InspectorProperty items = + metadataCollection?.Children[OdinLocalizationReflectionValues.METADATA_COLLECTION__ITEMS__PATH]; + + return items?.Children.OrderBy(c => c.ValueEntry.TypeOfValue.Name).ToArray(); + } + + private LocalizationMetadata localizationMetadata; + + private void DrawTopTabMetadata(Rect rect) + { + if (Event.current.OnMouseDown(rect, 0, false)) + { + GUIHelper.RemoveFocusControl(); + } + + if (this.SelectionType == OdinTableSelectionType.None) + { + return; + } + + if (this.localizationMetadata == null) + { + this.localizationMetadata = new LocalizationMetadata(this.Collection, this.WindowState); + } + + switch (this.SelectionType) + { + case OdinTableSelectionType.None: + break; + case OdinTableSelectionType.SharedEntry: + this.localizationMetadata.Target = this.CurrentSelectedSharedEntry; + break; + case OdinTableSelectionType.SharedTable: + this.localizationMetadata.Target = this.Collection; + break; + case OdinTableSelectionType.Table: + this.localizationMetadata.Target = this.CurrentSelectedTable.Asset; + break; + case OdinTableSelectionType.TableEntry: + this.localizationMetadata.Target = this.CurrentSelectedEntry; + break; + default: + throw new ArgumentOutOfRangeException(); + } + + this.localizationMetadata.Draw(rect); + } + + private void DrawTopTabSettings(Rect position) + { + position = position.Padding(4); + + GUILayout.BeginArea(position); + { + bool value; + + switch (this.SelectionType) + { + case OdinTableSelectionType.Table: + EditorGUI.BeginChangeCheck(); + + value = GUILayout.Toggle(LocalizationEditorSettings.GetPreloadTableFlag(this.CurrentSelectedTable.Asset), "Preload Table"); + + if (EditorGUI.EndChangeCheck()) + { + LocalizationEditorSettings.SetPreloadTableFlag(this.CurrentSelectedTable.Asset, value, true); + } + + break; + + case OdinTableSelectionType.TableEntry: + if (this.CurrentSelectedEntry is StringTableEntry stringTableEntry) + { + EditorGUI.BeginChangeCheck(); + + value = GUILayout.Toggle(stringTableEntry.IsSmart, "Smart"); + + if (EditorGUI.EndChangeCheck()) + { + stringTableEntry.IsSmart = value; + EditorUtility.SetDirty(stringTableEntry.Table); + } + + break; + } + + goto default; + + default: + GUILayout.Label("No item with settings selected.", SirenixGUIStyles.LabelCentered); + break; + } + } + GUILayout.EndArea(); + } + + private Vector2 bottomTabLocaleScrollPosition = Vector2.zero; + + private List toggles; + private static FancyColor ThumbColorGrayscale = FancyColor.White; + private static FancyColor BackgroundColorGrayscale = FancyColor.Gray; + private static FancyColor BorderColorGrayscale = new FancyColor(0.91f, 0.91f, 0.91f); + private static readonly FancyColor EnabledColor = new FancyColor(EditorGUIUtility.isProSkin ? 0.66f : 0.86f); + private static readonly FancyColor DisabledColor = new FancyColor(EditorGUIUtility.isProSkin ? 0.46f : 0.66f); + private bool dragging; + private Toggle lastChangedToggle; + private bool newValue; + private Vector2 localeTabScrollPosition; + private void DrawBottomTabLocale(Rect position) + { + position = position.Padding(4); + + GUILayout.BeginArea(position); + { + ReadOnlyCollection projectLocales = LocalizationEditorSettings.GetLocales(); + + if (this.toggles == null) + { + this.toggles = new List + { + new Toggle + { + Label = "Key", + Toggled = this.KeyTable.IsVisible, + } + }; + this.toggles.AddRange(projectLocales.Select(locale => + { + this.LocaleTableMap.TryGetValue(locale, out var table); + + return new Toggle + { + Label = locale.LocaleName, + Toggled = table?.IsVisible ?? false, + }; + })); + } + + bool hasAllLocales = projectLocales.Count == this.LocaleTableMap.Count; + + if (!hasAllLocales) + { + if (SirenixEditorGUI.Button("Add Missing Locales", ButtonSizes.Large)) + { + for (var i = 0; i < projectLocales.Count; i++) + { + Locale locale = projectLocales[i]; + + if (this.LocaleTableMap.ContainsKey(locale)) + { + continue; + } + + LocalizationTable table = this.Collection.GetTable(locale.Identifier); + + if (table != null) + { + this.Collection.AddTable(table, true); + } + else + { + this.Collection.AddNewTable(locale.Identifier); + } + } + } + + GUILayout.Space(4); + SirenixEditorGUI.HorizontalLineSeparator(); + GUILayout.Space(4); + } + + const float LINE_HEIGHT = 20.0f; + const float LOCALE_SPACING = 2.0f; + + this.localeTabScrollPosition = GUILayout.BeginScrollView(this.localeTabScrollPosition /*, GUILayoutOptions.MaxHeight(MAX_HEIGHT)*/); + { + var keyRect = GUILayoutUtility.GetRect(0, LINE_HEIGHT, GUILayoutOptions.ExpandWidth()); + this.KeyTable.IsVisible = this.DrawLocaleToggle(ref keyRect, this.toggles[0], this.KeyTable); + + if (this.EntryScrollView.IsBeyondHorizontalBounds && this.KeyTable.IsVisible && + !this.KeyTable.IsPinned) + { + if (Event.current.OnMouseDown(keyRect, 0)) + { + this.MoveScrollPositionToTable(this.KeyTable); + } + } + + var lastLocaleIndex = projectLocales.Count - 1; + + for (var i = 0; i < projectLocales.Count; i++) + { + var locale = projectLocales[i]; + var toggle = this.toggles[i + 1]; + + var totalRect = GUILayoutUtility.GetRect( + width: 0, + height: LINE_HEIGHT, + options: GUILayoutOptions.ExpandWidth().ExpandHeight(false)); + + if (locale != null && !this.LocaleTableMap.ContainsKey(locale)) + { + GUIHelper.PushGUIEnabled(false); + { + this.DrawLocaleToggle(ref totalRect, toggle, null); + } + GUIHelper.PopGUIEnabled(); + + LocalizationTable looseTable = null; + + foreach (LocalizationTable localizationTable in this.LooseTables) + { + if (localizationTable.LocaleIdentifier == locale.Identifier) + { + looseTable = localizationTable; + break; + } + } + + var buttonRect = totalRect.TakeFromRight(80); + + if (looseTable != null) + { + if (GUI.Button(buttonRect, "Add")) + { + this.Collection.AddTable(looseTable, createUndo: false); + Undo.ClearUndo(looseTable); + Undo.ClearUndo(this.Collection); + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + else + { + if (GUI.Button(buttonRect, "Create")) + { + this.Collection.AddNewTable(locale.Identifier); + Undo.ClearUndo(this.Collection); + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + + if (i != lastLocaleIndex) + { + GUILayout.Space(LOCALE_SPACING); + } + + continue; + } + + + OdinGUITable table = locale == null ? this.KeyTable : this.LocaleTableMap[locale]; + + table.IsVisible = this.DrawLocaleToggle(ref totalRect, toggle, table); + + if (table.Type != OdinGUITable.GUITableType.Key) + { + Rect removeLocaleRect = totalRect.TakeFromRight(80); + + if (GUI.Button(removeLocaleRect, "Remove")) + { + if (EditorUtility.DisplayDialog("Odin Localization Editor", + $"Are you sure you want to remove the locale '{locale.Identifier.CultureInfo.EnglishName}' from '{this.Collection.name}'?\n" + + "This can have side effects that can't be undone.", + "Yes", + "No")) + { + this.Collection.RemoveTable(table.Asset, createUndo: false); + Undo.ClearUndo(table.Asset); + Undo.ClearUndo(this.Collection); + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + } + + if (this.EntryScrollView.IsBeyondHorizontalBounds && table.IsVisible && !table.IsPinned) + { + if (Event.current.OnMouseDown(totalRect, 0)) + { + this.MoveScrollPositionToTable(table); + } + } + + if (i != lastLocaleIndex) + { + GUILayout.Space(LOCALE_SPACING); + } + } + } + GUILayout.EndScrollView(); + + GUILayout.Space(4); + SirenixEditorGUI.HorizontalLineSeparator(); + GUILayout.Space(4); + + if (SirenixEditorGUI.Button("Manage Locales", ButtonSizes.Medium)) + { + try + { + TwoWaySerializationBinder.Default.BindToType("UnityEditor.Localization.UI.LocaleGeneratorWindow, Unity.Localization.Editor")? + .GetMethod("ShowWindow", BindingFlags.Static | BindingFlags.Public)?.Invoke(null, null); + } + catch (NullReferenceException nullReferenceException) + { + Debug.LogError($"[Odin]: Failed to find LocaleGeneratorWindow.ShowWindow.\n{nullReferenceException.Message}"); + } + } + } + GUILayout.EndArea(); + } + + private bool DrawLocaleToggle(ref Rect rect, Toggle toggle, OdinGUITable table) + { + const int toggleWidth = 35; + + var toggleRect = rect.TakeFromLeft(toggleWidth).SubXMax(4).VerticalPadding(2).AddY(1); + var color = GUI.enabled ? toggle.CurrentColor : new Color(0.35f, 0.35f, 0.35f); + toggle.Enabled = GUI.enabled; + + // Draw toggle background + GUI.DrawTexture( + position: toggleRect, + image: Texture2D.whiteTexture, + scaleMode: ScaleMode.StretchToFill, + alphaBlend: false, + imageAspect: 1f, + color: BackgroundColorGrayscale.Blend(color, FancyColor.BlendMode.Multiply), + borderWidth: 0, + borderRadius: float.MaxValue); + + // Draw toggle thumb + GUI.DrawTexture( + position: toggle.CurrentThumbRect, + image: Texture2D.whiteTexture, + scaleMode: ScaleMode.StretchToFill, + alphaBlend: false, + imageAspect: 1f, + color: ThumbColorGrayscale.Blend(color, FancyColor.BlendMode.Multiply), + borderWidth: 0, + borderRadius: float.MaxValue); + + AnimateThumb(toggleRect, toggle); + + GUI.Label(rect, toggle.Label, + GUI.enabled && Event.current.IsMouseOver(rect) ? SirenixGUIStyles.WhiteLabel : SirenixGUIStyles.Label); + + if (GUI.enabled && Event.current.OnMouseDown(toggleRect, 0)) + { + this.dragging = true; + this.lastChangedToggle = toggle; + this.newValue = !toggle.Toggled; + toggle.Toggled = this.newValue; + + switch (Event.current.modifiers) + { + case EventModifiers.Control: + for (var i = 0; i < this.toggles.Count; i++) + { + if (!this.toggles[i].Enabled) continue; + this.toggles[i].Toggled = this.newValue; + } + + break; + case EventModifiers.Shift: + for (var i = 0; i < this.toggles.Count; i++) + { + if (!this.toggles[i].Enabled) continue; + this.toggles[i].Toggled = table.IsVisible; + } + + break; + case EventModifiers.Alt: + for (var i = 0; i < this.toggles.Count; i++) + { + if (!this.toggles[i].Enabled) continue; + this.toggles[i].Toggled = this.toggles[i] == toggle; + } + + break; + } + } + + if (GUI.enabled && this.dragging) + { + var mp = Event.current.mousePosition; + if (toggle != this.lastChangedToggle && toggleRect.y < mp.y && toggleRect.yMax > mp.y) + { + this.lastChangedToggle = toggle; + toggle.Toggled = this.newValue; + } + + GUIHelper.RequestRepaint(); + } + + if (Event.current.type == EventType.MouseUp && Event.current.button == 0) + { + this.dragging = false; + GUIHelper.RequestRepaint(); + } + + return toggle.Toggled; + } + + private static void AnimateThumb(Rect toggleRect, Toggle toggle) + { + const float thumbAnimationDurationInSeconds = 0.07f; + const float thumbAnimationSpeed = 1f / (thumbAnimationDurationInSeconds / 2f); // divided by 2 since the animation is split into 2 phases. + const float colorAnimationDurationInSeconds = 0.6f; + const float colorAnimationSpeed = 1f / colorAnimationDurationInSeconds; + + var targetRect = toggle.Toggled + ? toggleRect.AlignRight(toggleRect.height).AlignCenterY(toggleRect.height).Padding(2) + : toggleRect.AlignLeft(toggleRect.height).AlignCenterY(toggleRect.height).Padding(2); + + var targetColor = toggle.Toggled ? EnabledColor : DisabledColor; + + if (toggle.CurrentColor != (Color)targetColor) + { + if (toggle.T1.IsDone) + { + toggle.T1.Reset(0f); + } + + toggle.T1.Move(colorAnimationSpeed, Easing.InOutExpo); + toggle.CurrentColor = Color.Lerp(toggle.StartColor, targetColor, toggle.T1.GetValue()); + } + + if (Event.current.type == EventType.Repaint && toggle.CurrentThumbRect == Rect.zero) + { + toggle.CurrentThumbRect = targetRect; + toggle.CurrentColor = targetColor; + GUIHelper.RequestRepaint(); + } + + if (Event.current.type == EventType.Repaint && toggle.CurrentThumbRect != targetRect) + { + if (toggle.Toggled) + { + if (toggle.CurrentThumbRect.xMax < targetRect.xMax) + { + if (toggle.T2.IsDone) + { + toggle.T2.Reset(0f); + } + + toggle.T2.Move(thumbAnimationSpeed); + var xMax = Mathf.Lerp(toggle.StartXMax, targetRect.xMax, toggle.T2.GetValue()); + toggle.CurrentThumbRect.xMax = xMax; + } + else if (toggle.CurrentThumbRect.xMin < targetRect.xMin) + { + if (toggle.T2.IsDone) + { + toggle.T2.Reset(0f); + } + + toggle.T2.Move(thumbAnimationSpeed); + var xMin = Mathf.Lerp(toggle.StartXMin, targetRect.xMin, toggle.T2.GetValue()); + toggle.CurrentThumbRect.xMin = xMin; + } + } + else + { + if (toggle.CurrentThumbRect.xMin > targetRect.xMin) + { + if (toggle.T2.IsDone) + { + toggle.T2.Reset(0f); + } + + toggle.T2.Move(thumbAnimationSpeed); + var xMin = Mathf.Lerp(toggle.StartXMin, targetRect.xMin, toggle.T2.GetValue()); + toggle.CurrentThumbRect.xMin = xMin; + } + else if (toggle.CurrentThumbRect.xMax > targetRect.xMax) + { + if (toggle.T2.IsDone) + { + toggle.T2.Reset(0f); + } + + toggle.T2.Move(thumbAnimationSpeed); + var xMax = Mathf.Lerp(toggle.StartXMax, targetRect.xMax, toggle.T2.GetValue()); + toggle.CurrentThumbRect.xMax = xMax; + } + } + + GUIHelper.RequestRepaint(); + } + } + + private void LocaleToggle(Rect position, Locale locale) + { + if (locale != null && !this.LocaleTableMap.ContainsKey(locale)) + { + Rect createLocaleRect = position.TakeFromRight(80); + + GUIHelper.PushGUIEnabled(false); + { + GUI.Toggle(position.TakeFromLeft(GUI.skin.toggle.padding.left), false, GUIContent.none); + + GUI.Label(position, locale.LocaleName, SirenixGUIStyles.Label); + } + GUIHelper.PopGUIEnabled(); + + LocalizationTable looseTable = null; + + foreach (LocalizationTable localizationTable in this.LooseTables) + { + if (localizationTable.LocaleIdentifier == locale.Identifier) + { + looseTable = localizationTable; + break; + } + } + + if (looseTable != null) + { + if (GUI.Button(createLocaleRect, "Add")) + { + this.Collection.AddTable(looseTable, createUndo: true); + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + else + { + if (GUI.Button(createLocaleRect, "Create")) + { + this.Collection.AddNewTable(locale.Identifier); + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + + return; + } + + OdinGUITable table = locale == null ? this.KeyTable : this.LocaleTableMap[locale]; + + EditorGUI.BeginChangeCheck(); + { + table.IsVisible = GUI.Toggle(position.TakeFromLeft(GUI.skin.toggle.padding.left), table.IsVisible, GUIContent.none); + } + if (EditorGUI.EndChangeCheck()) + { + switch (Event.current.modifiers) + { + case EventModifiers.Shift: + for (var i = 0; i < this.GUITables.Count; i++) + { + this.GUITables[i].IsVisible = table.IsVisible; + } + + break; + + case EventModifiers.Alt: + for (var i = 0; i < this.GUITables.Count; i++) + { + this.GUITables[i].IsVisible = this.GUITables[i] == table; + } + + break; + } + } + + if (table.Type != OdinGUITable.GUITableType.Key) + { + Rect removeLocaleRect = position.TakeFromRight(80); + + if (GUI.Button(removeLocaleRect, "Remove")) + { + this.Collection.RemoveTable(table.Asset, createUndo: true); + FancyColor.PopBlend(); + GUIHelper.ExitGUI(false); + } + } + + if (this.EntryScrollView.IsBeyondHorizontalBounds && table.IsVisible && !table.IsPinned) + { + bool isMouseOver = Event.current.IsMouseOver(position); + + GUI.Label(position, table.DisplayName, isMouseOver ? SirenixGUIStyles.WhiteLabel : SirenixGUIStyles.Label); + + if (Event.current.OnMouseDown(position, 0)) + { + this.MoveScrollPositionToTable(table); + } + } + else + { + GUI.Label(position, table.DisplayName, SirenixGUIStyles.Label); + } + } + + protected bool IsDraggingAnything() + { + if (this.EntryScrollView.IsDraggingMouse || + this.EntryScrollView.IsDraggingHorizontalScrollBar || + this.EntryScrollView.IsDraggingVerticalScrollBar) + { + return true; + } + + for (var i = 0; i < this.GUITables.Count; i++) + { + if (this.GUITables[i].IsDraggingSlider) + { + return true; + } + } + + return false; + } + +#if false + private void DrawBottomTabTemplate(Rect position) + { + if (!this.Collection.SharedData.Metadata.HasMetadata()) + { + this.Collection.SharedData.Metadata.AddMetadata(new OdinTemplateMetadata()); + EditorUtility.SetDirty(this.Collection.SharedData); + } + + var templateMetadata = this.Collection.SharedData.Metadata.GetMetadata(); + + GUILayout.BeginArea(position); + { + GUILayout.BeginScrollView(Vector2.zero); + + int removedItemIndex = -1; + + for (var i = 0; i < templateMetadata.MetadataExpected.Count; i++) + { + if (OdinLocalizationStyles.Metadata(templateMetadata.MetadataExpected[i], i == 0)) + { + removedItemIndex = i; + } + } + + GUILayout.EndScrollView(); + + if (removedItemIndex != -1) + { + templateMetadata.MetadataExpected.RemoveAt(removedItemIndex); + EditorUtility.SetDirty(this.Collection.SharedData); + } + + Rect addMetadataRect = GUILayoutUtility.GetRect(0, (int) ButtonSizes.Large); + + if (GUI.Button(addMetadataRect, "Add Metadata")) + { + this.ShowAddMetadataTemplateSelector(addMetadataRect, templateMetadata); + } + + GUILayoutUtility.GetRect(0, 5); + } + GUILayout.EndArea(); + } + + private void ShowAddMetadataTemplateSelector(Rect rect, OdinTemplateMetadata templateMetadata) + { + TypeSelector selector = this.MakeMetadataSelector(); + + selector.SelectionConfirmed += types => + { + foreach (Type type in types) + { + if (templateMetadata.MetadataExpected.Contains(type) && !OdinLocalizationMetadataRegistry.MetadataAllowsMultiple[type]) + { + continue; + } + + templateMetadata.MetadataExpected.Add(type); + + EditorUtility.SetDirty(this.Collection.SharedData); + } + }; + + selector.ShowInPopup(rect); + } + + private TypeSelector MakeMetadataSelector() + { + TypeSelector selector; + + switch (this.Collection) + { + case AssetTableCollection _: + selector = new TypeSelector(OdinLocalizationMetadataRegistry.AssetEntryMetadataTypes, excludeInheritors: true); + break; + + case StringTableCollection _: + selector = new TypeSelector(OdinLocalizationMetadataRegistry.StringEntryMetadataTypes, excludeInheritors: true); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + return selector; + } + + protected bool HasMetadataAmountOfType(IList metadata, Type metadataType, OdinTemplateMetadata templateMetadata) + { + int count = CountMetadataType(metadata, metadataType); + + var expectedCount = 0; + + for (var i = 0; i < templateMetadata.MetadataExpected.Count; i++) + { + if (templateMetadata.MetadataExpected[i] == metadataType) + { + expectedCount++; + } + } + + return count >= expectedCount; + } + + protected static int CountMetadataType(IList metadata, Type metadataType) + { + var result = 0; + + for (var i = 0; i < metadata.Count; i++) + { + if (metadata[i].GetType() == metadataType) + { + result++; + } + } + + return result; + } +#endif + + + private void DrawBottomTabSettings(Rect position) + { + position = position.Padding(6); + + GUILayout.BeginArea(position); + { + // Table Collection Name + { + Rect namePosition = EditorGUILayout.GetControlRect(); + + GUI.Label(namePosition.TakeFromLeft(130), "Collection Name"); + + EditorGUI.BeginChangeCheck(); + + string value = SirenixEditorFields.DelayedTextField(namePosition, this.Collection.SharedData.TableCollectionName); + + if (EditorGUI.EndChangeCheck()) + { + if (!string.IsNullOrEmpty(value) && OdinLocalizationEditorSettings.IsTableNameValid(this.Collection.GetType(), value)) + { + this.Collection.SetTableCollectionName(value, true); + this.MenuItem.Name = this.Collection.SharedData.TableCollectionName; + this.MenuItem.Select(); + } + } + } + + // Preload All Tables + { + EditorGUI.BeginChangeCheck(); + + bool value = GUILayout.Toggle(this.Collection.IsPreloadTableFlagSet(), "Preload All Tables"); + + if (EditorGUI.EndChangeCheck()) + { + this.Collection.SetPreloadTableFlag(value, true); + } + } + + GUILayout.Space(4); + SirenixEditorGUI.HorizontalLineSeparator(); + GUILayout.Space(4); + + if (SirenixEditorGUI.Button("Manage Collection", ButtonSizes.Large)) + { + GUIHelper.OpenInspectorWindow(this.Collection); + } + } + GUILayout.EndArea(); + } + + private float VerticalSlideRect(Rect rect, bool connect) + { + var offset = SirenixEditorGUI.SlideRect(rect, MouseCursor.SplitResizeLeftRight).x; + + var slideThumbColor = Event.current.IsMouseOver(rect) + ? EditorGUIUtility.isProSkin ? new Color(0.5f, 0.5f, 0.5f) : new Color(1f, 1f, 1f) + : this.WindowState.RightMenuWidth > 0 + ? EditorGUIUtility.isProSkin ? new Color(0.25f, 0.25f, 0.25f) : new Color(0.8f, 0.8f, 0.8f) + : EditorGUIUtility.isProSkin + ? new Color(0.4f, 0.4f, 0.4f) + : new Color(1f, 1f, 1f); + + EditorGUI.DrawRect(rect, Event.current.IsMouseOver(rect) + ? EditorGUIUtility.isProSkin ? new Color(0.26f, 0.26f, 0.26f) : new Color(0.7f, 0.7f, 0.7f) + : EditorGUIUtility.isProSkin + ? new Color(0.2f, 0.2f, 0.2f) + : new Color(0.6f, 0.6f, 0.6f)); + + var h2 = connect ? this.WindowState.RightMenuTopPanelHeight : rect.height / 2f - 40; + + EditorGUI.DrawRect(rect.AlignLeft(1), new Color(0, 0, 0, 0.4f)); + var left = new Rect(rect.center.x - 1, 0, 1, rect.height); + EditorGUI.DrawRect(left, slideThumbColor); + + if (!connect) + { + var right = new Rect(rect.center.x + 1, rect.y, 1, rect.height); + EditorGUI.DrawRect(right, slideThumbColor); + EditorGUI.DrawRect(rect.AlignRight(1), new Color(0, 0, 0, 0.4f)); + } + else if (this.WindowState.RightMenuWidth > 0) + { + var crossTop = new Rect(rect.AlignCenterX(1).AddX(2).x, this.WindowState.RightMenuTopPanelHeight - (14 / 2 + 1), 4, 1); + var crossBottom = crossTop.AddY(2); + var rightTop = new Rect(rect.center.x + 1, 0, 1, crossTop.y + 1); + var rightBottom = new Rect(rect.center.x + 1, crossBottom.y, 1, rect.height - crossBottom.y); + EditorGUI.DrawRect(crossTop, slideThumbColor); + EditorGUI.DrawRect(crossBottom, slideThumbColor); + EditorGUI.DrawRect(rightTop, slideThumbColor); + EditorGUI.DrawRect(rightBottom, slideThumbColor); + EditorGUI.DrawRect(rect.AlignRight(1).SetHeight(connect ? h2 - 13 : rect.height), new Color(0, 0, 0, 0.4f)); + EditorGUI.DrawRect(rect.AlignRight(1).AddY(connect ? h2 - 1 : 0), new Color(0, 0, 0, 0.4f)); + } + else + { + var right = new Rect(rect.center.x + 1, 0, 1, rect.height); + EditorGUI.DrawRect(right, slideThumbColor); + EditorGUI.DrawRect(rect.AlignRight(1), new Color(0, 0, 0, 0.4f)); + } + + return offset; + } + + private float HorizontalSlideRect(Rect rect) + { + var offset = SirenixEditorGUI.SlideRect(rect, MouseCursor.SplitResizeUpDown).y; + + var slideThumbColor = Event.current.IsMouseOver(rect) + ? EditorGUIUtility.isProSkin ? new Color(0.5f, 0.5f, 0.5f) : new Color(1f, 1f, 1f) + : this.WindowState.RightMenuWidth > 0 + ? EditorGUIUtility.isProSkin ? new Color(0.25f, 0.25f, 0.25f) : new Color(0.8f, 0.8f, 0.8f) + : EditorGUIUtility.isProSkin + ? new Color(0.4f, 0.4f, 0.4f) + : new Color(1f, 1f, 1f); + + EditorGUI.DrawRect(rect, Event.current.IsMouseOver(rect) + ? EditorGUIUtility.isProSkin ? new Color(0.26f, 0.26f, 0.26f) : new Color(0.7f, 0.7f, 0.7f) + : EditorGUIUtility.isProSkin + ? new Color(0.2f, 0.2f, 0.2f) + : new Color(0.6f, 0.6f, 0.6f)); + + var top = new Rect(rect.x, rect.center.y - 1, rect.width, 1); + var bottom = new Rect(rect.x, rect.center.y + 1, rect.width, 1); + + EditorGUI.DrawRect(top, slideThumbColor); + EditorGUI.DrawRect(bottom, slideThumbColor); + EditorGUI.DrawRect(rect.AlignTop(1), new Color(0, 0, 0, 0.4f)); + EditorGUI.DrawRect(rect.AlignBottom(1), new Color(0, 0, 0, 0.4f)); + + return offset; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTableCollectionEditor.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTableCollectionEditor.cs.meta new file mode 100644 index 000000000..dc9f6bdee --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTableCollectionEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b8f34a530ab34e11b148c6c45d14fd12 +timeCreated: 1704797131 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTemplateMetadata.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTemplateMetadata.cs new file mode 100644 index 000000000..f7d091f80 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTemplateMetadata.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Localization.Metadata; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ +#if false + [HideInInspector] // ReadOnly + [Metadata(AllowedTypes = MetadataType.SharedTableData, AllowMultiple = false)] + public class OdinTemplateMetadata : IMetadata + { + public Type TableAssetType; + public List MetadataExpected = new List(); + } +#endif +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTemplateMetadata.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTemplateMetadata.cs.meta new file mode 100644 index 000000000..1c71ccfd9 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/OdinTemplateMetadata.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 50bcb1c3eb1c42b3b6a84c57b1c240dd +timeCreated: 1707729097 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/Toggle.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/Toggle.cs new file mode 100644 index 000000000..ef3a34da3 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/Toggle.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using Sirenix.OdinInspector.Editor.Internal; +using UnityEngine; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class Toggle + { + public string Label; + public float StartXMin; + public float StartXMax; + public Color StartColor; + public Rect CurrentThumbRect; + public Color CurrentColor; + public bool Enabled; + public SirenixAnimationUtility.InterpolatedFloat T1 = new SirenixAnimationUtility.InterpolatedFloat {Destination = 1f}; + public SirenixAnimationUtility.InterpolatedFloat T2 = new SirenixAnimationUtility.InterpolatedFloat {Destination = 1f}; + + private bool _toggled; + + public bool Toggled + { + get => this._toggled; + set + { + this._toggled = value; + this.StartXMin = this.CurrentThumbRect.xMin; + this.StartXMax = this.CurrentThumbRect.xMax; + this.StartColor = this.CurrentColor; + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/Toggle.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/Toggle.cs.meta new file mode 100644 index 000000000..352c7047b --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/GUI/Toggle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4e8615bf94265a4a96bf4c23380de7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal.meta new file mode 100644 index 000000000..52a89ad72 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7cf3a6e0f9c8495d843c313b4437232b +timeCreated: 1704797609 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationAssetCache.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationAssetCache.cs new file mode 100644 index 000000000..f31f9bba7 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationAssetCache.cs @@ -0,0 +1,68 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using Sirenix.Config; +using UnityEditor; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public static class OdinLocalizationAssetCache + { + private readonly struct AssetIdentifier + { + public readonly Type AssetType; + public readonly string Guid; + + public AssetIdentifier(Type assetType, string guid) + { + this.AssetType = assetType; + this.Guid = guid; + } + } + + private static readonly Dictionary Assets = new Dictionary(); + + public static UnityEngine.Object Get(string guid, Type assetType) + { + if (string.IsNullOrEmpty(guid)) + { + return null; + } + + var identifier = new AssetIdentifier(assetType, guid); + + if (Assets.TryGetValue(identifier, out UnityEngine.Object result)) + { + return result; + } + + string path = AssetDatabase.GUIDToAssetPath(guid); + + result = AssetDatabase.LoadAssetAtPath(path, assetType); + + Assets.Add(identifier, result); + + return result; + } + + public static UnityEngine.Object Get(SharedTableData.SharedTableEntry sharedEntry, AssetTable assetTable, Type assetType) + { + AssetTableEntry entry = assetTable.GetEntry(sharedEntry.Id); + + if (entry == null || entry.IsEmpty) + { + return null; + } + + return Get(entry.Guid, assetType); + } + + public static void Clear() => Assets.Clear(); + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationAssetCache.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationAssetCache.cs.meta new file mode 100644 index 000000000..d1fed8a05 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationAssetCache.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f5b97d1f7b884ac99cc8ebcdeb3363a7 +timeCreated: 1704809501 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEditorSettings.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEditorSettings.cs new file mode 100644 index 000000000..f3aef0612 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEditorSettings.cs @@ -0,0 +1,68 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using UnityEditor; +using UnityEditor.AddressableAssets.Settings; +using UnityEditor.Localization; +using UnityEngine; +using UnityEngine.Localization.Settings; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public static class OdinLocalizationEditorSettings + { + public static LocalizationEditorSettings Instance => + (LocalizationEditorSettings) OdinLocalizationReflectionValues.LocalizationEditorSettings_Instance.GetValue(null); + + public static AddressableAssetSettings GetAddressableAssetSettings(bool create) + { + return OdinLocalizationReflectionValues.LocalizationEditorSettings_GetAddressableAssetSettingsFunc(create); + } + + public static bool IsTableNameValid(Type collectionType, string name, out string errorMessage) + { + errorMessage = (string) OdinLocalizationReflectionValues.LocalizationEditorSettings_IsTableNameValid.Invoke(Instance, + new object[] {collectionType, name}); + + return string.IsNullOrEmpty(errorMessage); + } + + public static bool IsTableNameValid(Type collectionType, string name) + { + return IsTableNameValid(collectionType, name, out string _); + } + + public static bool CreateDefaultLocalizationSettingsAsset() + { + if (LocalizationEditorSettings.ActiveLocalizationSettings != null) + { + return false; + } + + string localizationSettingsPath = EditorUtility.SaveFilePanelInProject("Create Localization Settings", + "Localization Settings", + "asset", + "Create the Localization Settings asset"); + + if (string.IsNullOrEmpty(localizationSettingsPath)) + { + return false; + } + + var settings = ScriptableObject.CreateInstance(); + settings.name = "Default Localization Settings"; + + + AssetDatabase.CreateAsset(settings, localizationSettingsPath); + AssetDatabase.SaveAssets(); + + LocalizationEditorSettings.ActiveLocalizationSettings = settings; + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEditorSettings.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEditorSettings.cs.meta new file mode 100644 index 000000000..5f1e3a86c --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEditorSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 645f3592e85448d7a963218911547f3c +timeCreated: 1706732179 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEvents.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEvents.cs new file mode 100644 index 000000000..f0e27ca45 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEvents.cs @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using UnityEditor.Localization; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public static class OdinLocalizationEvents + { + private static readonly Action RaiseTableEntryModifiedAction; + + private static readonly Action RaiseTableEntryAddedAction; + + private static readonly Action RaiseTableEntryRemovedAction; + + private static readonly Action RaiseAssetTableEntryAddedAction; + + private static readonly Action RaiseAssetTableEntryRemovedAction; + + static OdinLocalizationEvents() + { + RaiseTableEntryModifiedAction = OdinLocalizationReflectionValues.Create_RaiseTableEntryModified_Method_Delegate(LocalizationEditorSettings.EditorEvents); + RaiseTableEntryAddedAction = OdinLocalizationReflectionValues.Create_RaiseTableEntryAdded_Method_Delegate(LocalizationEditorSettings.EditorEvents); + RaiseTableEntryRemovedAction = OdinLocalizationReflectionValues.Create_RaiseTableEntryRemoved_Method_Delegate(LocalizationEditorSettings.EditorEvents); + RaiseAssetTableEntryAddedAction = + OdinLocalizationReflectionValues.Create_AssetTableEntryAdded_Method_Delegate(LocalizationEditorSettings.EditorEvents); + RaiseAssetTableEntryRemovedAction = + OdinLocalizationReflectionValues.Create_AssetTableEntryRemoved_Method_Delegate(LocalizationEditorSettings.EditorEvents); + } + + public static void RaiseTableEntryModified(SharedTableData.SharedTableEntry sharedEntry) => RaiseTableEntryModifiedAction(sharedEntry); + + public static void RaiseTableEntryAdded(LocalizationTableCollection collection, SharedTableData.SharedTableEntry sharedEntry) => + RaiseTableEntryAddedAction(collection, sharedEntry); + + public static void RaiseTableEntryRemoved(LocalizationTableCollection collection, SharedTableData.SharedTableEntry sharedEntry) => + RaiseTableEntryRemovedAction(collection, sharedEntry); + + public static void RaiseAssetTableEntryAdded(AssetTableCollection assetCollection, AssetTable table, AssetTableEntry entry) => + RaiseAssetTableEntryAddedAction(assetCollection, table, entry); + + public static void RaiseAssetTableEntryRemoved(AssetTableCollection assetCollection, AssetTable table, AssetTableEntry entry, string guid) => + RaiseAssetTableEntryRemovedAction(assetCollection, table, entry, guid); + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEvents.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEvents.cs.meta new file mode 100644 index 000000000..e7bebbb72 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationEvents.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a7cf7883289c4de29b6e2ae8a072c3bd +timeCreated: 1705050052 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUI.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUI.cs new file mode 100644 index 000000000..46b432666 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUI.cs @@ -0,0 +1,438 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Editor.Internal; +using Sirenix.Reflection.Editor; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEngine; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + // TODO: update name + public static class OdinLocalizationGUI + { + public static GUIStyle RichLabelTextCenteredMultiLine + { + get + { + if (_richLabelTextCenteredMultiLine == null) + { + _richLabelTextCenteredMultiLine = new GUIStyle(SirenixGUIStyles.MultiLineCenteredLabel) + { + richText = true + }; + } + + return _richLabelTextCenteredMultiLine; + } + } + + public static GUIStyle CardTitleWhite + { + get + { + if (_cardTitleWhite == null) + { + _cardTitleWhite = new GUIStyle(SirenixGUIStyles.MultiLineWhiteLabel) + { + fontSize = 12, + fontStyle = FontStyle.Bold + }; + } + + return _cardTitleWhite; + } + } + + public static FancyColor Background => EditorGUIUtility.isProSkin ? Color.black : Color.white; + + // TODO: LIGHT MODE + public static FancyColor MenuBackground => EditorGUIUtility.isProSkin ? DarkMenuBackground : LightMenuBackground; + public static FancyColor WindowBackground => EditorGUIUtility.isProSkin ? DarkWindowBackground : LightWindowBackground; + public static FancyColor Panel => EditorGUIUtility.isProSkin ? DarkPanel : LightPanel; + public static FancyColor PanelGap => EditorGUIUtility.isProSkin ? DarkPanelGap : LightPanelGap; + + public static FancyColor Selected => EditorGUIUtility.isProSkin ? DarkSelected : LightSelected; + + public static FancyColor TabsBackground => EditorGUIUtility.isProSkin ? DarkTabsBackground : LightTabsBackground; + + public static FancyColor ColumnBackground => EditorGUIUtility.isProSkin ? DarkColumnBackground : LightColumnBackground; + + public static FancyColor RowEvenBackground => EditorGUIUtility.isProSkin ? DarkRowEvenBackground : LightRowEvenBackground; + public static FancyColor RowEvenBackground2 => EditorGUIUtility.isProSkin ? DarkRowEvenBackground2 : LightRowEvenBackground2; + public static FancyColor RowOddBackground => EditorGUIUtility.isProSkin ? DarkRowOddBackground : LightRowOddBackground; + public static FancyColor RowOddBackground2 => EditorGUIUtility.isProSkin ? DarkRowOddBackground2 : LightRowOddBackground2; + public static FancyColor RowBorder => EditorGUIUtility.isProSkin ? DarkRowBorder : LightRowBorder; + public static FancyColor RowBorderHover => EditorGUIUtility.isProSkin ? DarkRowBorderHover : LightRowBorderHover; + + public static FancyColor Tab => EditorGUIUtility.isProSkin ? DarkTab : LightTab; + public static FancyColor TabHover => EditorGUIUtility.isProSkin ? DarkTabHover : LightTabHover; + public static FancyColor TabSelected => EditorGUIUtility.isProSkin ? DarkTabSelected : LightTabSelected; + + public static FancyColor Checkerboard => DarkCheckerboard; + public static FancyColor CheckerboardBorder => DarkCheckerboardBorder; + + public static FancyColor DarkMenuBackground; + + public static FancyColor DarkWindowBackground; + public static FancyColor DarkPanel; + public static FancyColor DarkPanelGap; + + public static FancyColor DarkSelected; + + public static FancyColor DarkTabsBackground; + + public static FancyColor DarkColumnBackground; + + public static FancyColor DarkRowEvenBackground; + public static FancyColor DarkRowEvenBackground2; + public static FancyColor DarkRowOddBackground; + public static FancyColor DarkRowOddBackground2; + public static FancyColor DarkRowBorder; + public static FancyColor DarkRowBorderHover; + + public static FancyColor DarkTab; + public static FancyColor DarkTabHover; + public static FancyColor DarkTabSelected; + + public static FancyColor LightMenuBackground; + + public static FancyColor LightWindowBackground; + public static FancyColor LightPanel; + public static FancyColor LightPanelGap; + + public static FancyColor LightSelected; + + public static FancyColor LightTabsBackground; + + public static FancyColor LightColumnBackground; + + public static FancyColor LightRowEvenBackground; + public static FancyColor LightRowEvenBackground2; + public static FancyColor LightRowOddBackground; + public static FancyColor LightRowOddBackground2; + public static FancyColor LightRowBorder; + public static FancyColor LightRowBorderHover; + + public static FancyColor LightTab; + public static FancyColor LightTabHover; + public static FancyColor LightTabSelected; + + + public static FancyColor DarkCheckerboard; + public static FancyColor DarkCheckerboardBorder; + + private static GUIStyle DefaultTextStyle; + + private static GUIStyle _richLabelTextCenteredMultiLine; + private static GUIStyle _cardTitleWhite; + + static OdinLocalizationGUI() + { + DarkWindowBackground = new Color(0.15f, 0.15f, 0.15f, 1.0f); + LightWindowBackground = new Color(0.358f, 0.358f, 0.358f, 1.0f); + + DarkPanel = new Color(0.2156863f, 0.2156863f, 0.2156863f, 1.0f); + DarkPanelGap = new Color(0.0856863f, 0.0856863f, 0.0856863f, 1.0f); + + LightPanel = new Color(0.761f, 0.761f, 0.761f, 1.0f); + LightPanelGap = new Color(0.532f, 0.532f, 0.532f, 1.0f); + + DarkSelected = new Color(0.7076807f, 0.8213042f, 0.8773585f, 1.0f); + LightSelected = new Color(0.358f, 0.446f, 0.509f, 1.0f); + + DarkTabsBackground = new Color(0.1886792f, 0.1886792f, 0.1886792f, 1.0f); + LightTabsBackground = new Color(0.538f, 0.538f, 0.538f, 1.0f); + + DarkColumnBackground = new Color(0.099f, 0.099f, 0.099f, 1.0f); + LightColumnBackground = new FancyColor(0.84f); + + var rowBaseBlend = new FancyColor(0.42f); + +#region DARK_ROW + + var darkRowEvenBackground = new FancyColor(0.2f); + var darkRowOddBackground = new FancyColor(0.16f); + + DarkRowEvenBackground = darkRowEvenBackground; + DarkRowOddBackground = darkRowOddBackground; + + DarkRowEvenBackground2 = darkRowEvenBackground.Blend(rowBaseBlend, FancyColor.BlendMode.Overlay); + DarkRowOddBackground2 = darkRowOddBackground.Blend(rowBaseBlend, FancyColor.BlendMode.Overlay); + + DarkRowBorder = new Color(0, 0, 0, 0.3607843f); + DarkRowBorderHover = new Color(1, 1, 1, 0.2470588f); + +#endregion + +#region LIGHT_ROW + + var lightRowEvenBackground = new FancyColor(0.711f); + var lightRowOddBackground = new FancyColor(0.611f); + + LightRowEvenBackground = lightRowEvenBackground; + LightRowOddBackground = lightRowOddBackground; + + LightRowEvenBackground2 = lightRowEvenBackground.Blend(rowBaseBlend, FancyColor.BlendMode.Overlay); + LightRowOddBackground2 = lightRowOddBackground.Blend(rowBaseBlend, FancyColor.BlendMode.Overlay); + + LightRowBorder = new Color(0, 0, 0, 0.2f); + LightRowBorderHover = new Color(1, 1, 1, 0.4f); + +#endregion + + DarkTab = new Color(0.254717f, 0.254717f, 0.254717f, 1.0f); + DarkTabHover = new Color(0.277f, 0.277f, 0.277f, 1.0f); + DarkTabSelected = new Color(0.312f, 0.312f, 0.312f, 1.0f); + + float scalar = 0.925f; + LightTab = new FancyColor(0.85f * scalar); + LightTabHover = new FancyColor(0.915f * scalar); + LightTabSelected = new FancyColor(0.95f * scalar); + + DarkCheckerboard = new Color(0.298f, 0.298f, 0.298f, 1.0f); + DarkCheckerboardBorder = new Color(0, 0, 0, 0.5529412f); + + DefaultTextStyle = new GUIStyle(SirenixGUIStyles.MultiLineCenteredLabel); + DefaultTextStyle.focused.textColor = DefaultTextStyle.normal.textColor; + + DarkMenuBackground = DarkPanel; + + LightMenuBackground = new FancyColor(0.84f); + } + + public static string TextField(Rect position, string text, out bool changed, int id) + { + if (id == 0) + { + GUI.Label(position, text, SirenixGUIStyles.MultiLineCenteredLabel); + changed = false; + return text; + } + + Color lastCursorColor = GUI.skin.settings.cursorColor; + + bool isMouseDown = Event.current.type == EventType.MouseDown; + + if (isMouseDown) + { + GUI.skin.settings.cursorColor = Color.clear; + } + + text = EditorGUI_Internals.DoTextField(id, position, text, DefaultTextStyle, null, out changed, false, true, false); + + if (isMouseDown) + { + GUI.skin.settings.cursorColor = lastCursorColor; + } + + return text; + } + + public static string TextFieldSyntaxHighlighted(Rect position, string text, string syntaxRichText, out bool changed, int id) + { + if (string.IsNullOrEmpty(syntaxRichText)) + { + return TextField(position, text, out changed, id); + } + + GUIHelper.PushContentColor(Color.clear); + text = EditorGUI_Internals.DoTextField(id, position, text, SirenixGUIStyles.MultiLineCenteredLabel, null, out changed, false, true, false); + GUIHelper.PopContentColor(); + + GUI.Label(position, syntaxRichText, RichLabelTextCenteredMultiLine); + + return text; + } + + public static bool ObjectPickerButton(Rect position) + { + bool isMouseOver = Event.current.IsMouseOver(position); + + var c1 = EditorGUIUtility.isProSkin + ? new Color(1, 1, 1, isMouseOver ? 0.8f : 0.3f) + : new Color(0, 0, 0, isMouseOver ? 0.8f : 0.3f); + + SdfIcons.DrawIcon(position, SdfIconType.StopCircle, c1); + + return Event.current.OnMouseDown(position, 0); + } + + public static TEnum Tabs(Rect rect, TEnum value, float width) where TEnum : Enum + { + EnumTypeUtilities.EnumMember[] infos = EnumTypeUtilities.VisibleEnumMemberInfos; + + for (var i = 0; i < infos.Length; i++) + { + Rect itemRect = rect.TakeFromLeft(width); + + bool isMouseOver = Event.current.IsMouseOver(itemRect); + bool isSelected = value.Equals(infos[i].Value); + bool isPressed = Event.current.OnMouseDown(itemRect, 0); + + Color tabColor; + + if (isSelected) + { + tabColor = TabSelected; + } + else if (isMouseOver) + { + tabColor = TabHover; + } + else + { + tabColor = Tab; + } + + SirenixEditorGUI.DrawSolidRect(itemRect, tabColor); + + Vector2 textSize = EditorStyles.label.CalcSize(GUIHelper.TempContent(infos[i].NiceName)); + float iconSize = textSize.y; + float size = iconSize + 2.0f + textSize.x + 1.0f; + + if (size > itemRect.width) + { + if (iconSize > itemRect.width) + { + continue; + } + + SdfIcons.DrawIcon(itemRect.AlignCenter(iconSize), infos[i].Icon); + } + else + { + Rect contentRect = itemRect.AlignCenter(size); + + Rect iconRect = contentRect.TakeFromLeft(iconSize).AlignMiddle(iconSize); + SdfIcons.DrawIcon(iconRect, infos[i].Icon); + + contentRect.TakeFromLeft(2); + + GUI.Label(contentRect, infos[i].NiceName); + } + + if (isPressed) + { + value = infos[i].Value; + } + } + + return value; + } + + public static bool OverlaidButton(Rect position, string text, SdfIconType icon = SdfIconType.None, GUIStyle labelStyle = null, bool invert = false) + { + const float ICON_SIZE = 18; + const float SPACE = 4; + + bool isMouseOver = Event.current.IsMouseOver(position); + + ref SirenixAnimationUtility.InterpolatedFloat t = ref SirenixAnimationUtility.GetTemporaryFloat(position, isMouseOver ? 1.0f : 0.0f); + + t.ChangeDestination(isMouseOver ? 1.0f : 0.0f); + + t.Move(1.0f / 0.15f, Easing.OutQuad); + + float value = t.GetValue(); + float inverseValue = 1.0f - value; + + if (invert) + { + SirenixEditorGUI.DrawRoundRect(position, new Color(0, 0, 0, 0.2f * inverseValue), 5.0f, new Color(0, 0, 0, 0.05f * inverseValue), 1); + SirenixEditorGUI.DrawRoundRect(position, new Color(0, 0, 0, 0.4f * value), 5.0f, new Color(1.0f, 1.0f, 1.0f, 0.05f * value), 1); + } + else + { + SirenixEditorGUI.DrawRoundRect(position, new Color(1, 1, 1, 0.2f * inverseValue), 5.0f, new Color(0, 0, 0, 0.05f * inverseValue), 1); + SirenixEditorGUI.DrawRoundRect(position, new Color(1, 1, 1, 0.4f * value), 5.0f, new Color(1.0f, 1.0f, 1.0f, 0.05f * value), 1); + } + + labelStyle = labelStyle ?? SirenixGUIStyles.WhiteLabelCentered; + + if (icon == SdfIconType.None) + { + GUI.Label(position, text, labelStyle); + } + else + { + float textWidth = SirenixGUIStyles.WhiteLabelCentered.CalcWidth(text); + + Rect contentPosition = position.AlignCenter(ICON_SIZE + SPACE + textWidth); + + SdfIcons.DrawIcon(contentPosition.AlignLeft(ICON_SIZE), icon, Color.white); + + GUI.Label(contentPosition.AlignRight(textWidth), text, labelStyle); + } + + return Event.current.OnMouseDown(position, 0); + } + + public static bool Metadata(Type metadataType, bool isFirst) + { + var isRemoved = false; + + if (isFirst) + { + EditorGUI.DrawRect(GUILayoutUtility.GetRect(0, 1), new FancyColor(0.06603771f)); + } + + Vector2 padding = new Vector2(4, 4); + Rect rect = GUILayoutUtility.GetRect(0, 24); + + if (Event.current.IsMouseOver(rect)) + { + EditorGUI.DrawRect(rect, new FancyColor(0.2784314f)); + } + else + { + EditorGUI.DrawRect(rect, new FancyColor(0.2431373f)); + } + + + EditorGUI.DrawRect(GUILayoutUtility.GetRect(0, 1), new FancyColor(0.06603771f)); + + var iconWidth = 16.0f; + var iconPadding = new Vector2(2, 2); + + SdfIcons.DrawIcon(rect.TakeFromLeft(iconWidth).Padding(iconPadding.x, iconPadding.y), SdfIconType.GripVertical); + + rect = rect.Padding(padding.x, 0); + + SdfIcons.DrawIcon(rect.TakeFromLeft(iconWidth).Padding(iconPadding.x, iconPadding.y), SdfIconType.Braces); + + rect.TakeFromLeft(5); + GUI.Label(rect, metadataType.GetNiceName(), SirenixGUIStyles.BoldLabel); + + var removeRect = rect.TakeFromRight(iconWidth).Padding(iconPadding.x, iconPadding.y); + + SdfIcons.DrawIcon(removeRect, SdfIconType.X); + + if (GUI.Button(removeRect, GUIContent.none, GUIStyle.none)) + { + isRemoved = true; + } + + return isRemoved; + } + + public static void DrawRoundBlur20(Rect position, Color color) + { + position = position.Expand(63); + SirenixEditorGUI.DrawTextureSliced(position, OdinLocalizationGUITextures.RoundBlur20, color, 63); + } + + public static void DrawRoundBlur6(Rect position, Color color) + { + position = position.Expand(10); + SirenixEditorGUI.DrawTextureSliced(position, OdinLocalizationGUITextures.RoundBlur6, color, 10); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUI.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUI.cs.meta new file mode 100644 index 000000000..e85c5679d --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUI.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 12ea4fb9c8db4471801a31e2e0b353de +timeCreated: 1704803170 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUITextures.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUITextures.cs new file mode 100644 index 000000000..882f4c724 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUITextures.cs @@ -0,0 +1,310 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using Sirenix.Utilities.Editor; +using UnityEngine; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public static class OdinLocalizationGUITextures + { + private const float FADE_STRENGTH = 0.4f; + + public static Texture2D LeftToRightFade + { + get + { + if (leftToRightFade != null) + { + return leftToRightFade; + } + + leftToRightFade = new Texture2D(32, 32) + { + hideFlags = HideFlags.HideAndDontSave + }; + + var pixels = new Color[32 * 32]; + + var index = 0; + + for (var x = 0; x < 32; x++) + { + for (var y = 0; y < 32; y++) + { + pixels[index++] = Color.Lerp(Color.white, Color.clear, Mathf.Pow(y / 31.0f, FADE_STRENGTH)); + } + } + + leftToRightFade.SetPixels(pixels); + + leftToRightFade.Apply(); + + CleanupUtility.DestroyObjectOnAssemblyReload(leftToRightFade); + + return leftToRightFade; + } + } + + public static Texture2D TopToBottomFade + { + get + { + if (topToBottomFade != null) + { + return topToBottomFade; + } + + topToBottomFade = new Texture2D(32, 32) + { + hideFlags = HideFlags.HideAndDontSave + }; + + var pixels = new Color[32 * 32]; + + var index = 0; + + for (var x = 0; x < 32; x++) + { + for (var y = 0; y < 32; y++) + { + pixels[index++] = Color.Lerp(Color.white, Color.clear, Mathf.Pow(1.0f - x / 31.0f, FADE_STRENGTH)); + } + } + + topToBottomFade.SetPixels(pixels); + + topToBottomFade.Apply(); + + CleanupUtility.DestroyObjectOnAssemblyReload(topToBottomFade); + + return topToBottomFade; + } + } + + public static Texture2D BottomToTopFade + { + get + { + if (bottomToTopFade != null) + { + return bottomToTopFade; + } + + bottomToTopFade = new Texture2D(32, 32) + { + hideFlags = HideFlags.HideAndDontSave + }; + + var pixels = new Color[32 * 32]; + + var index = 0; + + for (var x = 0; x < 32; x++) + { + for (var y = 0; y < 32; y++) + { + pixels[index++] = Color.Lerp(Color.white, Color.clear, Mathf.Pow(x / 31.0f, FADE_STRENGTH)); + } + } + + bottomToTopFade.SetPixels(pixels); + + bottomToTopFade.Apply(); + + CleanupUtility.DestroyObjectOnAssemblyReload(bottomToTopFade); + + return bottomToTopFade; + } + } + + public static Texture2D RoundBlur6 + { + get + { + if (roundBlur6 == null) + { + const string BASE64 = + "iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAYAAAA53+RiAAAFDElEQVR4Ae2dzZIURRSFaQFBDGBBsHGB76Ju0BfxkXwRZaXvIgs3BhEiIT/DYHu+pG+R3XN6mDa6uZuTEacr61ZWVcb3kVXFaq5dSwuBELg6gVUN" + + "Xa/X1a1tHWO7G8bU8RqfrSdQYNnuhjPq+Dh7tXqP9cbY2/4p4J+pTK5PqRrbGqdu2iUEAP/vlHfqV6rO6VuCdsUAm5SQm+p/vgl9wjklSN3RIqlIvN/OkAv+uQ693eRMW8I+khhDW87bFcNBoFO/pdxW7ihfbML+" + + "LCdCBOSSVqulpLzW2FebvNSW/TcKxxG0tFnMvFKQgpC7yn3l3qZPreTkcSYYH2klhpWBBGS8UJ4r/AOHIY1xNZbtWBlsqzGQE4CPlAfKQ+Vb5XvlkcKjLe1wAjy6nio/K78pcKbxGKvHWT3SPrzA9VWGFKCzKlgl" + + "SPlK+VF5rKQdj8ATXeon5Q/lmcIKYjWd6atsyKmlpNqQxBcYcninIOcbJVIE4cgNpjyFYAxrmMN+eWc7MSwxBvMo+0FJOw0BXg0whjXMLxWDqHrH8Eh7pKSdhgBsYWw/pnZXDPt8qZUclljaaQjAtqTAHPb2Ucbt" + + "OTjLoZZ2OgIsgJIC96XNO9iq/8uUoGVgOichUJzZFv9xo1nMfOetQfOB9I9KYC/nfWKOevdc7HACTgwW0z4tgQvMnZhPO6XczRKIGIulvxgx/Q7sDCLGYukvRky/AzuDiLFY+osR0+/AziBiLJb+YsT0O7AziBiL" + + "pb8YMf0O7AwixmLpL0ZMvwM7g4ixWPqLEdPvwM4gYiyW/mLE9DuwM4gYi6W/GDH9DuwMIsZi6S9GTL8DO4OIsVj6ixHT78DOIGIslv5ixPQ7sDOIGIulvxgx/Q7sDCLGYukvRky/AzuDiLFY+osR0+/AziBiLJb+" + + "YsT0O7AziBiLpb8YMf0O7AwixmLpL0ZMvwM7g4ixWPqLEdPvwM4gYiyW/mLE9DuwM4gYi6W/GDH9DuwMIsZi6S9GTL8DO4OIsVj6ixHT78DOIGIslv5ixPQ7sDOIGIulvxgx/Q7sDCLGYukvRky/AzuDiLFY+osR" + + "0+/AziBiLJb+YsT0O7AziBiLpb8YMf0O7AwixmLpL0ZMvwM7g4ixWPqLEdPvwM4gYiyW/mLE9DuwM4gYi6W/GDH9DuwMnJjxZ8vt6BRPReACcyfmVDfPdQ8gsE8MBi9YPOC6GXo1Ans5z2JqEH9PvnK1y2fU/yVQ" + + "nNkW/3GtWQyFGniu/tsxIj+nJABjWBf35V6zGIwxoKS8Vv9sGZnOsQnAFsazHByM5sQwkBNeKk/HqPycggBsYVxy6nE27rUr5p2qiHmlvFB+UdJOQwC2MIY1zGG/d8VwkCXG4L+VX5UnStpxCcAUtjCGNcy3xCx/" + + "fHm9XtO/odxSvlTuKw+Uh8p3ymPla+WmknY4AVbF7worBSl/Ks+U58o/yhvlfLVajVWzK4ZHG3JuK3eUuwqC7m361DiGHMYu56ufdpEAkHl3zO9tHl+sFITQr/fM+DorMUioVhdhSWGPVhfF6F9KSeG8iBGEj7Ri" + + "On/p8ugiJQTWMN96+c9idGw0BnAhLsoJ9THAKiElZf5wyMoRmKnBrho8iyksCe8UQr+kqPuhLUD1jqlq1QBPrk+pGtsap27aJQRq1ZQgRFSqxulDgB5l41IL3EnMOKCfOsZ2N4yp4/TT9hOof/Fsd8NZdXxcocSM" + + "nfyEQAhckcB/Z2rwteNGzXsAAAAASUVORK5CYII="; + + byte[] bytes = Convert.FromBase64String(BASE64); + + roundBlur6 = TextureUtilities.LoadImage(102, 102, bytes); + + roundBlur6.hideFlags = HideFlags.HideAndDontSave; + + CleanupUtility.DestroyObjectOnAssemblyReload(roundBlur6); + } + + return roundBlur6; + } + } + + public static Texture2D RoundBlur20 + { + get + { + if (roundBlur20 == null) + { + const string BASE64 = + "iVBORw0KGgoAAAANSUhEUgAAAMEAAADBCAYAAAB2QtScAAAgAElEQVR4Ae2di5bjOI5Ep3f3//94t1fXruuMhEGKsmVnVlXiHDkCgQdBiazqeZ35z39+7OcN/LyBnzfw8wZ+3sDPG/h5Az9v4OcN/LyBnzfw8wZ+" + + "3sBf/Ab+6fb+77//dvKP9vwbaN/3pO3Ph5i8nEdD//zz+TP8z6ON/tK6z2/v9S/h2fV+LtHCN/q5BJ9f0rOH7nO3r/f29vNzSbZv9Ddfgr0D8vVH+PUTdO/gr7sYf8sl6D7264/Y77lC967+6IvxJ1+C7mP+nsfy" + + "66fOd/nHXYg/6RLkh/rKY/OuOb7qMNb9fdUcp33jP+ES1I9y2suJRu9YI5ZbokdmeuVBdY5XrrH0Qh5N+l0vgS/+0X2P6l7Vd7Teu/TRvs48uLnGmX1f/o5+t0uQL/rZl3NmrzrLK3uz1lmHrJvzjN72PaNXfben" + + "+7/LJfClPvsCnu3zbP2z81u/OscjhzB7P1LvjKC9nu2TPU/n3/0S+BIf3fij9Y/WzeZ8tOczB2i05mrPWr9aV9+DfR6tr/1O9b/rJfClPbLZo7VH85npkZpH9vLoWnuHrZt/r6bOspJf9+y6j9TWXqf53/ES+KKO" + + "bnK1bjWP9Y/k1nmfqa290l85QKO1Z7W1ZpbLPObv5eXscmofqbP+VPxOl8CXenSDK3Vn5TDbSq+jeziSv7p+d8i62i6v7nOUk3mznG5/znK0ruv1lPZdLoEvZHUzK/l7Oc/GnXWvj3mvxnqYRnPt5dU4c2evLr6a" + + "070Deo96dvmna7m5W/M3/u8J2vVvg/Rkr2YWf0Usp5z1z7yz+OrhmeW9Isb+Zn1H+3+kZtRrqNf/PUH70d50Cdq1h5N//tOops16jWJHddYc1RyZp+Y+4q8ellneKHZUZ/5RzV6s2/usV5d/WPsul2D1MLHBWe4o" + + "dkQ/krs3T36QUd/MeYSvHpJR3hH9SC57GeXvxep7mPWpuYf973AJjhyOWW4Xe4fGS+/WyY+xF8/cR/jeIRnFO/0dmnvs1jJW8UhurZ36X30JVg/HLK+LrWg1p/q8uKpV35c70rse1pyNs0MyilW9+sxYtT2/qxlp" + + "6FjteVXvf1fz7isnyldegtnByZFHeZ2+omVOctY86nc1zl57qXe4l3vk449yO71qR/y9XPZZc0baTCeW1vXM+GH+VZdg76O7kVFe1atPfWrJz4rVPvhYXeuqXn9nscxb5bMD0cWqNvPPirGXWa/ca83LWPLVvKwZ" + + "8q+4BKsHoctb0TInOS8h/aN8Vu8Lzp4zzVjFWn/kY3e5e1qNp3+Us5dRTY2578yfacYSu9qML/N3X4L6kbtBRzlVn/kZezVnD7lG57vPmqf+KI4OQtVnfsZezdlnrtH5vouap564kpP5LX/nJVg5AKOcqqefnE2m" + + "LxePxPdqaq8Vnxwt+6ut4OzD19jMz1jHVzVmNldMrfIVnxws+12V+9+VnPuqUN51CVY++Cin6unv8S4+02YxXptxMTVfa8a6uHl7scyTzz54jc18YyL95WKnzWJdfmozXmP4Wq6pVnElp9bc/O9yCerBccDUkxNP" + + "Xy5mXK3iSs6spqtHw6y7evf+nm684uhjV33kp95xtT1krkdyss692aeLdTlqidkj9SX+jktQD0Q3WM2Z+RnruNqrkPlr79Qq7/yRhr5n3QevWvodn2nGzkb2Zc8Zr7HOR6uWvWts6r/6EnhYZkN0Oant8S6ulpic" + + "eTq/00a5qa9y8jDXuXrHf7sPntoeN76CZ+Sww9ontRknhll/9frflZy7ynoJ3v1fpe4OQ2p73PgKdjmrGi+O3C7fl1pj1hjv/JXY7MPWWPpykbXkiXBm75CaGkM7anu96ec6lbtWxtVegix0Zw/+t0jbXtG8i6e2" + + "x413uKdlfMQZlVjGZxoxrOandkn49WNeaivcA5y5qclF8uSJyc3Z0zI+4rNexhJXOXmY6169+9+9+F3Fq/4m2PvAXTy1PW48MTkbxU+t8upnzSxm3gpmTuX4mGtdvfFv93FT67jaDDPWceZTTz6alNy6J7UO6ZN9" + + "R9z1Mq6WuBfP3Ja/+x+HHILBtT1uHExOfdUybqzTsnYvnrnyGWascnzNdfVFD6C+mHrH1TpMrXJ8ZgF90mf96qN1Zq+MqSUSt+eMZ5+X8TMuAZuZWY1X39rU5YmrvObh+7CWPLHqM9/YCmYOPI31O+OwdJa6fAUz" + + "B77im8OMWeNc6vodUuce5YnUjPpUvfp1vb14zf/kn3EJPjUsDsPNzLhIrjxxxmsM38d++h3OcmosffkMMwbXmGNmHJZqqclnmDF456uDzJS+POfInNST2wut42ogZk/xqt7/7sXvKxaVZy8Bgx2xzE9uD7XEGSdW" + + "42pHkPVn+TWevrzD1OCY81698a+HxIz05R2mBu98dZE15HvoPDOkh/vsuBqYRo1a8swZ8aP5tz7PXoJbo4b4Egyl33G1xBknlg/rpN/x/1rIsW7Ur+r6MySG0fuIeSCs0Z8hsYzri/SS7+H/ufAE2RN9qqG5346r" + + "JdIj+yWvMfxT7JlL4AafGcQeHaZWOf4zz5HLUNdhv6mlL0+svPPR0jgYaenLEyvvfLTVx8PPe1qpyVmTU8u7wjqulnjNfuyXteh1yJ65BLOF3Lg56cvFmpM6XF9+BEeH/aieazJv+nAsUZ565fh7lh+0cv1EuA+9" + + "5SPksHexUa2Xg/iq0d/3Acfw1dUugV8/xnGTd/6vksfh0UvgprqVj8YyXw76sIZ8BesBP+q7Rq1TB7H0q2b8kvgrt+NqHebh6Diaulykn7xiHnzmNl719MnB551k/uYuGTW+Iwr0Qcw5xNQuCeUn80ro1qvqQ//R" + + "SzBs2ARy84bVKhJHU09ffYT10KZ/lLtG1qlVrDPqd4iG0WNmHg5z9DtES12/Qw4ya2fMw44ur/3yAsAx3g15+mgzs6d7Tx/uXGL26rSMP8VffQncMEMmz6HVQbn5ajOsBzV9uUgfecWMuZ45+nuYc8tBjFotuVqi" + + "BwSt42jq8hVk3czjAKvJwdp7ky4aMd4JcThW/as6/rW37wDfGWpV6slr3lP+I5fA4buFZzHzzRHRK8dfefKQdlxtFVnT3Mo73xndQ+cTw4hpydUSPSholeuDPubpix5ofdaVE9OXd0g+lkge7wkNjuHLL8LOj/2c" + + "gXS5OGsxy5nF7no+cgnumgwEBtGSo+mLavipoWvGOuwOLpp6h51G76qn1q3dacysLgcx9BXzkJArBytX65C9oHM4QXw5cxiDo4sb/bRO+uTZBz15tzfWqJZ5xtHgojXpJzf+NB69BAwxslnMmi4HrepqifRIn5eP" + + "v4KZs8K7vqnlHB3PWeUgRv6KeTjIlYOVq3XogWfPctYnN7FeAGJomOvh0wdTA9UTL0m/8rr9Wk+e8dTUq4ae5h5Sk89i5lzw6CX4VLzouEnT9UE5Mf1ncHbAa2zmMwNxc/SdLXW1xNyPPLFyfC0/vDyxcvz6cCDR" + + "mLNy5iSWCCfPPcAx9av3cfiJ25scrGJql4TBD7Ng1uds18g1Zp7aaXjWJXADDlZ99NQqT98e1hCrj4cwsfLOR/Ohp1xMTd5havDu2eSbLgcx8meWH1wOVq6W6AFFk4P4zo0PV3N+9fS3tJuRr9kbX56ITp+0rFc3" + + "xxh+xzPfOFrmm3MIj1wChz2yQK1JPzk98esz0jOPA6zvYRbR5StY89OXg5WrVcz55aBGflp+XHR9sHK1ihxENTmYB9Q5yZOL5I2M/DRyqePdyomjYSLcteBp2ZN8/eTkVz97PMWPXILVhXLj1nQaMfRHH168tSsH" + + "fDWHnjVXrUNnGOHW7jYnHCN3Zh4EcuD68hlyGImD7CPRg+o+0h/Nnzr5ndnH9dyfSE3yrgea+8w4dVXvtKyRL+WdcQlWNudQIPkrNZknB3nR+nlY1cSMjfh//+o3iruecf3EXE8OYp1/jVx/zVOrH1sf9CFXDnIA" + + "O18drIc0tTrjlj411soa3o1W13F/1pAHn1nWzPIyRs1e38z/xM+4BJ8ahuNmKpqC/ujDi6+1HtQZdoe+07oerKcudwZ0ecUtdIvBMXJmlh8Uri+vyOFTk3vQmU0O1vn0t9DF9EczOov5tafr2Ye87JXcHonZn1z8" + + "ipn/NF+9BHuDO8he3l6cPuSYJ+/QA7mKedhHfLUX85Cb2M2Y2pZ+21fl+FoeAjm493AYyUmE10OaMyXfUj+9e/zOnKmLodX10FgHozb5RRz8kDdbay9u29281Utgw0fRjVMPTz81dXOO4ugQe+hF8uSitdVXT2Qu" + + "/MTKnT33Jwc18rD6wfXBytU88PjyRPjo+d8t5ozOIG6hu2+EhjmLPHt0nDz7ivSQ2wfE1F0HX35JOPvn2UvgwHUudZF4cn201NNXV/PQ6Yvd4UzNQ72H1JhjffXRWde4PNG5Km5lt70Sm5kfPRHePXnoiXvomVEu" + + "1oOfPvM4l4hWLWdiDQ297tkZ0I2L1Nkr11Mjbl3y1NC1kW58iM9egmycG0k9+SgH3Zh8hh5C0LzURtxDvYr2Md/11NPPOeQgpi9PhKd5CBIrx/fwJ/ewG9PPw46mz7rOCO8s1ybe+fTgXWjk2Ne9p09e5tjTepD8" + + "Tj+ak/ktP/MStAtsops3ni9FnjG4NcZFD58+mJq8Yh5iOTji1hvX79AZEnM+ufvCXzEOgIdAXjEPOzEPvejaYB5+fC8CiHVzuT5xeSKcd4LBXU+NNdVAcxI3eXdta8k93VYuAQN0tqdnPPmolzmJ8NnDyyaeh7P6" + + "xrpD7yGvMWoyZo8RumbOSi4+lvpV+YjpixwQDe6DBudgqaXvwR9hHvqci76Y2tX7/Ot6qHL2B8dA/dxrx8lFFzd66wOvZi66XJzlZmyUf8lZuQTZ7BnOINXQ1OWr6CHrEI3Hg6yv5qE33vnmJmaf5MyMn1j3sYUv" + + "cXQtOZqHSq4P1sfLkLh6AfJCsBZWZ0HLNfGx1NgzfsW69+rTx/WoT05MQyf+UjvrEriJOmzV8fMx37xE88iRi/XApQ/PJw+4h34WN2eEWStnLniis1bc0m4fHd6ZHx4cPXn4yXnmAjhDrqWWmHE5+4ZXzH3TI33y" + + "8RPNATXimvn64kg3votnXYLdhSYJbAJLlHc6sXzy8MH3nnopRj59Hr0IzOdczrpJt7nhGLG0/OhwfTno4Zfrd5cg/8Rnrdk//+cc8lx3xtkrcfeaSC984pgx8xOvGW/+PfsSsEFMrPwS/PXjy8icWmdOh3nI4Eee" + + "0cGvOj1XLwIzOpNY5x7tFV3zsCTC88mDj756AZzHy+CaFXOtVe7+yXedDoljxMwV0Y3DNXPx5aI5D+PeJWChzkZ6l4tGfn3MtVdizU0/D1jyzIETq4+HXF1/huSuXATXTKwz4WPi1bv/9SCA3bN3Cbq/AVhz9fCz" + + "X2y0drcv3hP5xJJ3uWjmJm5y+27IWTV71/yR/p+9S1AbHfFZdM/MSYQfeTzQFemRmgcZzUOfXK3DzOt65lry0R54J8Qw8epdDwbcjw52T14CODOBHn76yhM3eWisw94x18SXg66VWvLRnkc6tcQSN3do5g4THgmc" + + "cQkY7BGzrmLtRfzIk4e043xYdTm491CT+faoyKxos5m38MXISeMwaHm4Kq+XAN/18jKsXAB7s7eOsxf15Lmma8/QfSWST++KmbPCrV/Jvcs54xLUpgykJVcDq64Pjh7riNdDhu9jXH+E9UDvXYIuv+vt+qN9oGPi" + + "1fv45VBgHrwOu0uAdvQCuI6YF4G9sbaYnHVSx3e/6u5PvUN6ooNa9Tt9lGPuITzzEjBYZ+j1MS9rzCEmN56+nJftUzV8YqJ5o4OcOnz20Mv85LmWHOyeTb7oYDUPBNg9HkAPHjPA/VOf9eTgzOjPXmZIf+K5bmru" + + "NWete97KP72H9KnTT/5LvoGxm7AR1un0zNnlZ16C3cVKAhvAxKv32a8vc+bzYYzD9x4Pcodos4fe1nXrMAe68yRu8m3P6Gl+0ER4PhxGfNDH/vhnXABmZw33JhdZhzWJy51hhlv6xcihl6Yvqr8FH7kEDLpneznG" + + "E+H1YZ29HOJ54Pxw6vpiHl55h2ijh17WJM814fryTbrtET4yDoiHRM5hg7OeB0/uwWcdTLx697/0Yf4O3Y9r4ctZF9913Z/zuM/ELf02T+rJ6Y+fSF1n5nUxtZUcc1/67w7dFimEAVeMvKMPH8caPxa+vEMPc4do" + + "o8de1unnes5ScWt7OxjwNA4CBuZDf3wPHL6c/nkRZv8YRA9m7tA9EJO7jr5rqte97flb612jBzO8xWZ/EzDIns1yulhqcrB7WHsvhzgfo6Kauh9whB7kPPDkpl+58a6n6ybCMVCuD+ZHh+vLOXxwe3oY7Qd6ETba" + + "GvXso8PcB/H04a6njq8u5izJt9TbnlNP7t5AjJj8Igy0ldg0Z3YJLDyCDJ6WfnJzOq3GyKl5ajP0YyWan5qcwyEH9evhr3rWJGctfNcUN+m2H7Q0P3oinIdeefDsl5i9KqcHs3eYc7sOfauesVy38lzbGBp8ZMSY" + + "LS215ORUP+sO8bMuAQONjFiNp5+cHpnfcfONJfKR0q+8+6ip5QFH15frg8mzh5y14XUGfEy8eh+/HgSwPtSgjXp+dPlg9mBeeEXn7dA//bv1yO/irJz56VeOj7mvyvVBZu8sa7v4rnbWJdhdaCehvjTS0bSM7/Hu" + + "Yz6i5SGX0wfuo9/1Z070bt5N/rQ/fM2P7eFNpBf+ak9ymRWTg8wldrOvaN0F6OZC0yo3n1m+zL7iEvgixG7zxnxJZ+LeB84DX3Pz8BPL3OTMSzwx98Ce8TvzQID5eOhE+9Ue1qNnPfPgO7ccv3vsfyZuSw33bYy5" + + "WBN8i73iErCBkdVY56uJtRe6Mfke5kc2N7URz4Ndub7Y9ci15OwHjolX7+PDewBAHg8+nBr8tNqHGLnMZg85c6J186LRiyfjanu4ld3q4dWox+xz9a6/aMylVV8dnMUyb4m/4hKsLMwmNLhPanD1xKpXP3Ph+WH1" + + "R5p6HgD47KCbmzmjdXI25h6ZB1ekDu7h7/p4gKwRPfz4zkofefaCdzpazUt/C3+KV99cdRBTB50/+SXp1T/vvARsbsXME7MGTV0+w/rx0vdjp0avqqdfuQdfzLi9EuFYxav6cRA8EB5kDq0atV4G6xKtSWSuPPj6" + + "zlbnVgd9yJHPkFmMw9PQMfHqjX/Jc9/jrCcjr7oEK5vscqqGn4/bVcOX72F+xOTU5SHo+ErOrK7O5txgNT96HmLqOcTiSo31efjRRnM6I/GOq42QmYzBMX3xql5/0aqhuf8a01/JMXcJj16CbvCVhbLuKM/+1Pqg" + + "y49g/cjp1z55YIilv8KtqX2dHazmIfAQi+QZW63xAlDHvF6kOo97UceXH0Hmynz8asS1yt0fesetW8HsMc0/egmyWW4gdblxUb0i8cyRqydSW+Ojflm3wj0Iidap4ctBfTFjNW4vEBOv3sevHx/MhwxjH9lXjbWI" + + "ifC8AB7+Op8z5myrPGeAWycX1UV1EFPv9nbNuOYQJ3clz7olfOYS1AUYsFqn1Zwjvv1EauH5pJY8c+B5AJJnnofG/JpnXL3zrbVvzgSvxkfODw73QIvWEGNNLOtcM2vJ8zI4i3n67kM/kTX0k6emngg/w1iH/aR1" + + "WsaX+JmXYGVBhsbEq/fxqy5+RO5ryBk91I1iz+r1oNNPLXt7oMSMwTHx6t0ffnV6eAHyIKNjHA564XsZMq+u/Yy/LTF9t8S1uj90NdFcEd391ENvzqn47ktwZHheRj7Wjl5exs1ZwVxjxD3Ionmdj6Ze0TpmhVdD" + + "ywOQB5peXgTrzKWOePXNX70Q9HWuGRojv7OMw/Pp8r9U+06XIF/c6KWY40s1T7/GU38VHx30kZ4zOv8e5gXIA+3BF1+1x9qXeVNzfjXj6iMk/8vtjEvw6EaybsT3XhB1WUu+/iNov3ege3NO/hTH8OUX4dePeWfP" + + "RvvsfcT/Ndql3h5qM8zcyru9z3oRo8cjdZe+o0uQg10SX/TDOqtrmSd2IxlbQXLyoV/6yY2JGXuU0wujfsXMW12Pnns15tSe6itITrVct8Y63/UfPshd04HGWp/WGV2CQf3bZF+iC674Ncda0TiYnHhq6Wde5sgz" + + "vlc3qqEOsxcfSH4J/PpBM2YvQuaqrfrWZv5IQ+/MNTNmP7U937wvw3degvoyVjeddZXjp0ZP/YoZg2vm4cPTr9osPqtb6UOO5mHH908t19YnpjZb2xzytarVevJSk1es/YyP6s1fRfrlflfrDuXxL6i+k9WXmP7K" + + "nKP81OWifTs/tcrxU6OPmpgaHMvYUd9a8dLw148aqFWePjkjP/Xk9u1qM9Zx+mSv5F3+27SvuATv2LxriKMXalwkD179rM+Y+Ymz3IzVmtp3lmvMGrHqnU9u5stFayoaF2v8TP8da9zm/YpLcFv8zeSMF/tMD2qz" + + "PrmvIrWab84qZq/Vmpp3Ro/a89v5f9Ml+HYv/2eg7/EG/qZLcMa/wHqmB7VZn9zTkFrNN2cVs9dqTc07o0ft+e38r7gE73ixriGOXrxxkTx49bM+Y+YnznIzVmtq31muMWvEqnc+uZkvF62paFys8TP9d6xxm/cr" + + "LsFt8Ybk5uHpN+l30ig/dblok85PrXL81OijJqYGxzJ21LdWvDT89aMGapWnT87ITz25fbvajHWcPtkreZf/Nu2d/zkBm37kX2jly6ocPzVenH7FjME18/Dh6VdtFh/VuWfj+HL6VzMGysmpfmqZl3rl+FjtVevN" + + "uST/yk+t5tsv9RG35wpmj5X8h3LeeQmODFg3v+LXnLqecTA5eamln3mZI894rfOwm0NcM4ZfLwla9k9eY/qiuSt+5shFZxbRO8v1jNeaPd+6L8PRJWBwP84rh+te4mg9X6bY5RlbQXLyoV/6yY2JGZtx88E9o482" + + "67kao5c9RzXm1Lj6CpJTLdetsc53/S52tuZst76jS3BLWCA0feTCZF0OlnxveXJrvv4jaL+zkPmdI/eC5jurcX3wHQ9z5ZpHfHIx57x6+7+uZ60Vqaut4KN1l95nXIKVIVdyVjZiDiint75a+q/m/vf7RdfD5994" + + "EJlzxbo90ANdzDU63firkH1kb3xMTX4RJz/kf7l9p0tQX4YvVDS+9+Iy39wZmj9DD7JoLj5/oqfvnHkBzCPXhxr/NrAGDbNfIj3wQZ8urpb5anu4tb6ssYf0mVnG65qzui+JvfsS8EI8NPUA8AJ8eWK+lKrhjx57" + + "jeLP6BwuD7J7QcP06Y+WF4E4Rsx6eDVnQ5ePDjS6MXL1U7PHWZhzdT2Ja8SrqYlH4zX/af/MS8Cm+LhpnZbxo9wXJ1IPzye15JkDz4OSPPM8VB5m9gc3h7h7BvE1a0TiPtRbZ75IDHMN0RmdaeRnfs0xlmgOWvLM" + + "gWNqyVNTT4SfYc6QvTot40v8mUvAAKMPyeLGxdFAxHk0uXoiOTVunZj5RzgHoD4eeHT22h1oY2A13w+YD3nGak3dn3ugPxzMR000lj48fXNAY0dxK/1k1iPCMbVE9UtC5Oh3mP26uJp5+kt49BKwyOjjzRbMuhm3" + + "x2gz6D7kyo9gfngPw6jeOHvuLoDvQmSmNHUwH3KMZT6cWbA6k3M70wrSI/NqT31z0pcfwTo3fjX6aUe5dSuYvaf5Ry/BtFkEGWD0kU3rcurg+PlkrbkZn3E+tPHkaB6CiuwBbXQB3KO4pd6Mvv5NApJjXkWLqMES" + + "na9inXXkWzeKo5Pjk35y4yN0buJazVUHM0+904yJKznmLuGrLkG3OMP78bu4mpsU1UE0dfkM60dMH56PfVLz8KN5iBM3uTV6UYuRj5918Jk5S0VnQ5fzf9YHF9UrZg0xe3d55prT+RlLvrW+9YankYeJV2/8u5o3" + + "7rAQeeclyHHYnAcB7mOOm1dPJGfmZwyeH1y/aqnnwSePOf1/hewOsvvY0m5zeQHoSxzf2o3e9p616ORjic4GyuvBnfnd5cg+9hXtpW9u+pU7s3r1q04cUwe15GovxVdcAjZRP66bqLHO9yWI1oroxuR76IcFzU2t" + + "cuZHy8OffAt9MudRdA36cAHw4T4bnb4j4vYQnT3RGUF5HvoRN7/DXM+42h7m3PBq1GP2uXrXX2Nq1VcHZ7HMW+KvuAR7C7MBDoPY5btJ8OzHDztCDztx5hThxDT8as7qwRfJzYe6rh59tndmId7NXg98+jV/FjPX" + + "vZyJuT94tdx7jb3M/4pL0G0mX7RxXwh+xve4H/FR5HBSy0GBg5iH+Opdf52xm4l8dOsSqcbvbNaTuYh3e/Ngg3L3oS929Ue1bs8jzX26N/zMNf4leNYlYEN7HzXjmZ+cl+DLGXHiGTMf5EP6p2/q8r0PzSFhzopq" + + "W6g1+ydSgw/mQwN8TLx613w4dVj2gzO/2O2FuT3oyclNPf2uj1pdP31y0pdv8ic9/crxMWq15GjZ15zEmp+xJX7WJXAxBsoPm37yUb466OZAuXG1GfohE70gqck5JMzeoet22M1AT9YS6et7SU4/9dyjPYnL6QVP" + + "hOeTBx2eD3kZTz97wHPNUcycDrcWNzOOAB9ZF0stOT2qP+q7q88uAYv4gUaNZjldLDU52D2siY51cTU+Uh44P9rswLMv80AOB1qHm9ya6+f/OySa88BdB8yHhvidUYfZv6Jzo8vdg34e/uSZh56+tSN0DuOun2hO" + + "Rfcj1ji+sV/09u31azz1vZi5rqN/wdkl+JR4osMgowOQy3Qvak/jA9XD7wXx44Gsr98dfOLoI2OOPPzyuj59WB/kwZJflftf90lETu/k+qAHOjla99Sc9OHdw7rqOYP8CG6tdo1+b7NHLgED+kFHg+7lGE+E14f+" + + "aFiNpc8Hmh1+5vUjcjD05R1uaUPrZmL9nMHDz7oefN9bRRfKvmi5Rzn94O6nIntBA0eP8Q5Tg+eT69Z59CtuLXa/Yc3BHxn993Q2/NkAABGMSURBVGwl59bjkUtwK36SMCiHQbRdbgC++vCx8hDi0z8xeXfwyUef" + + "GfP4Jz/ryV3fwy/Ssz70R+vM/Y/2zTrEwOTMrSYHRw+5mZe+fUbobMTlK7ilX4zcNH0xYy/nZ14CNtB92G5j5mUNXF8OYunL+QAerjz8aPjERTR8Pjp8hlt4aKztoRfRWCdnyHWdMZEF8DujH+Y+O/TwgfXpDjZa" + + "9/hOZmh/5oCL8vRTy7m3sk/7SR+Oka9lrdxYYtakfoifeQlcmMH8wMmNg1XXB0ePdcR52axhrj5aHsDU5WJehK3sNjO8M9by4Ise/kRnAEeP/YmnsYbm3jpkD+hg9xy5CF4O+ljX9Uytrp0zkqe/0RtXSzQOasQ7" + + "Sz15l3tIO+MSMFD9mCtDWFex1hI/8vARPHwd9/CTU3ldW5/1PfgiB1/OOl4E+sKdoeIWur0vYmmsgyV2e/eggcnzEMsT4fWxh3n4yY1X7OaaaVvbO8t9EtS/S9wRHq27tD3jEozmY7D6kWuuOYnwIw8fpx40fA5i" + + "xviw5sExfPlFaH6YxcNekZiHn7U8/KLrJbIE/szoi43eA2sRS4T7eIg7ROseatVrH33X1E8czTrTtyVvB5+8PVvJ2etxF9+7BCzafbCRfrfAL6Eb3r72SoSPHl48tcST13xj5PrwkbHqX9X7X3rWg6/v4Rfp6eEX" + + "XUdkBTgmXr2PX9bEEru9obFHEZ4Pe8Xv0MNe0Xp1/cQ6iz45HVeruKV/2iM+VvPwj9gof6T/Z+8SHFmcXBbi44qpwdMcKvNrHf7o4aVbK8dfefjIM3NND3xFD77Imsn1cxbW03dt/DTW1ZwBXw7Ww6YP1od9oiVW" + + "jl+f2mfPdz7y5CPcUi5GHEuUXyMfv6nLxY+sB9nZl+CRMdgMhyFRTj83C3YPL5560YM2wi1113LNvQvgn/oVZ+sTm1mu3+0ZzQOXCK9PHnpi6dfDn37tM/KdhXg36ybfvqGcPHniVX3z71mXgE11H7bqbt5tWmNe" + + "Irzz0Xjh1I6QmM9G78wYWI3+9eDr+6d9RfrsXQLWcV04VtdnbQ2uL0/00CXCuycPPvH0Pfi1Tl2scXzmEZ2t+uiY8fTVLwklx7yMyRNrXsaW+FmXYGUxhh19dHQ3kwgfPbxs6kaYa8F9NvrJXA8R7oGvWA9++vT2" + + "EriOPn3VQC25Gljncf/G6iHTB2dPHnzy0q9cP/tVjbmId+jMK7i1uH1jeBr1L7eVS8Ag3Qfb0zOevNsUcYx1zAX3Hj4CNSAG1wcxtat3/+vaROSu60XIA185/T3womsm0l8fvmfOQJ68YncI0UZPHmQ5uMdrP+ZI" + + "Tb/O1/lb6d17RhsZPTS5qC4e1S91K5fABR5FBuPja92gxs1NhPvw4jHyO424vSpaB6bRBwM99CIaBzt91siLwDp5+JPnDMm3ktuc8LScBx0/NX3mqBzNh5jcQ1599RGSb8zaxFzDWUYaOlZRLevNuRREjf6peOYl" + + "YHA/9GjIUY6bpl6eCE+fD6FZo+YMI7SuYvaH18Pvwadv5Wrg6GE9Yph49e5/cxai+KOHfRNLrByfpx7o9OUVrR2hc2VcbYbbOLc9watRu2crOXs9nv63SBmi+6DqIoMk1wcxe5CD4ZsP8vCSOXz6IrpGnb49jSVS" + + "iyXaL//UR/PAJzoLa6CDlattoVtcDmrkYc5y9T585zJHH2QOfXkifPR42I3ri+hy0VzQ9dWcI9E8NCxRrm7dJfHXT80xN3Pkmau2hGf+TTBbkAHrx9anLjeArt8h2ujhpWvZXw20Z/LaLw98x+nt4RfRZg/r5UzJ" + + "iWkr89V58T1wifDVJw/6iNde3RwrGnvNPHxNPX35S3D1EjDY6KPlYHt5e3F6kYOxnjwRzsMHmdnevPahh3yGrOeFoHce/uTE8tncmw/HVma7Zn7Mhj+aj9mMycHK1TrMg2+804yN0Dn2kP3MjPqZ7cWt3c1bvQQ2" + + "PIIszseuaI+94TIuB3n4ABw8fbVNutnooGWNyakldx0Pvz6968GvPr3J89EHtToja6fp50zE02emzlcHfciTd3jGoadvzpN8Cw1j5pGjoWEVr+pJv2dcAgasH3M2nhvaq8k8OchL9gLANTVyzDM2Q/NF+9PPnmrM" + + "jJYInz1b+BaHY+TPjFk058KXz5BZiXeI5mOO/irWtbPOGJocxPSv3vh3NS87uEZqy/yMS1AXY6D6kTuNupXhM0cO8qLzkNKvGnlHnuyZa7COMZD9eRmOXID6XqrPmmn67oGYfITMZ0wOVt755o2Qvl2srqd/FLf2" + + "d0aPap1Wc/CX8o5cAhrWj9YtnFqtST85NfjVWC91eSIfZXQZZvPSoz6uh25fkVge/OTE6rNJN00OYuTOzP2RI3dWNf2KzKsm7zA1uA+18oo1VtfR73A0N7pGnZYcrfrmPY1HLsFsMQbMD1t9alOrnHjW42Pkpenz" + + "cTiEieSpwbHak3ofcuUi+XD7wtH0QXzXgXfPJt90eWLl+BpravLEyvHrw5xqlesnwo/69K91aq5dcSu5M3MM4GvJR1qXY+4SnnUJZosxJAdF03d4Y/rmdZg58kQ+igeUenvDySOGwfXlIPmJ9kOvHG30bKFbTA5i" + + "1KwYc2hysHK1DplZXd5haiucnubZ/1HMPdIDE6/eva9+Ch69BAw3+oizmMN2OW44+6pZBxJPnY/ggRftIapbD9IjLwMcjcc1El0HDQ7uPVvKLUcOYtSuWO5V7pzUy1cwD6x8hkdirF/znWk0J7qWuWog+p7Ncmax" + + "T32PXoJPxTsOQ/jBk1OmL6qBmHVX7/pLbjU1PoIHWw5i9qpIrRdAJMeZ7IMGB8kD67NJn7T04Rg1WnK1RPeFVrk+6GOevsjccjD9jqutYu2Za8mZrZoxUJOLVcevMXOewkcuAYOMPuIs5qDmiOiVm7uHfKw8/MyF" + + "j+6Miazjga9orbPgJ8e3L7x7Nvmmy0GMfC25WiLrah1HU5evoIfbXH0RXS7uabWX/h7u7c/4COk/slnsruaRS3DXZCIwjB88eZaoO3jmZ96I87GoWbkM9gZZz4tgvbPgmyMf4ZZ6yTWu3yEaRu7MfBfm6HeIlrp+" + + "h3mwjad2lNMja+w5w9wTeZh49T5+U0/+kXECe/UlYESGrx9draL5oDWrm+djUDO7DPYEeehNvlwdzAuSOhybacYvib9yO67WYe6742jqcpF+8oqjQ1v1o35dp/ruUT195000PtIy/hR/9BKwEQ9DHeBoLPPloMY6" + + "6auP0MtAHQc5fXt58PVB8+XOoi+yrlxUE9G1ETc+w9x35fqJcB/6ykdYD7p5R3XrRlhn0Qcx6jCx8kswfjIv5AudxWruxX/0ErTNQmSQ/Pjpy0XL9EV0OEYv+UVY/KkXgD7OJU907dQqZ+nU0pcnVt75aGl1r+nL" + + "EyvvfLTVZ3QJVuszj33pu0d8TLx6H7+pJ5/VfFQfZM9cAobjMDxj9uiQvvT3JSTv1rRHHtDK+RsAG12OzCcvfXnV9WdIDKPHEXPv1ujPkFjG9UV6yfdw5TLM+mWs42qJ8EeN/Ry2Zy7B3mIMlB89/Y6rJbIGPdCw" + + "5Ffl+mtNah0fHX5y6T16ajx9eYepwTHWWDH3bG768g5Tg3e+usga8kewq0+t42qJM15j+KfYs5eAF7b6URk485O7GbVEYqyBhiW/KuNf+1AzeqhejWWufIYZg2usNzP3mjmpyWeYMXjnq+/FzGMeeWLV0++4Gpjm" + + "HGjJM2fEj+bf+jx7CW6NBoTBZh/cuEgbeSI6fdCw5Ffl86+1de3UiflUnW7G7KFvbAUzB55m39Tg7nGmm7OCmQNf8Ud5I925a+9OVwOxrLkq/a95ffQJ9YxLwHCjD8poNV59x09dnkge66DNzJrMUXPO9NVAH2pn" + + "3HiHqVWOr7muvjjaX+odV+swtcpX/L0cZicn82YaMcz8q/fxW/Xqf2Re2V685n/yz7gEnxouOgztIdjjxutGqa9aXd7aupa1oE/NVacnHNvDzKkcH7PH1Rv/dntLreNqM8xY5dVnOjSf9Ds+04yBmGvN+CXx1T9n" + + "XQI2NPu4XTy1PW48Md8NaxObmbXkjDh93Edicur1k3cacS3jaivY7Ss1uUhPeWJyc/a0jI/4rJexxFVOHua6V+/+dy9+X1GU9sP8++/Dfdt+sWYXT22PG1/BLmdVY2Ryu3y3U2PWGO/8ldjs5ddY+nKRteSJyWtO" + + "F1vVaq/OT23GiWGuffXuf/fi9xWb8s8/frpr+Ky/CdrFGpGhP09w3ahaxjuuBj5iWV/XrDF91jFXTG3GiWFZd1WO/Xb7TW2PG1/BM3LYXe2T2owTw6y/ei/8bT/OE38TMGrbs+yh5sz8jHVc7VWYe3KN1Crv/JGG" + + "vmfdYaha+h2facbORvZlzxmvsc5Hq5a9a2zq178J8qPeCp+8BPRp+94WGMezLnntaUzMuFrFlZxZTVePhll39e79Pd14xdGHrvrIT73janvIXI/kZJ17s08X63LUErNH6kv8u1wChq0Hxw1UPf093sVn2iyWM3Z5" + + "K/OaI2YftRnOPnaNzXxjImvKxU6bxbr81Ga8xvC1XFOt4kpOrbn577oELLjywUc5VZ/5GZOLdQ51MeOdlvHKV3xytOyvtoKzD15jMz9jHV/VmNlcMbXKV3xysOx3Ve5/V3Luq0J55yVg2ZUPP8qp+szP2Kt5t69c" + + "M1730v4zf4+PDkDVZ37GXs3ZT67R+e655qknruRkfsvffQkYYnRA6oBd3oqWOcnr2hlb4bN6Z88+M81YxVp/5CN3uXtajad/lLOXUU2Nue/Mn2nGErvajC/zr7gEDFc/9mjgUV7Vq1/XqPH0kx+pq7nuofZTH+Vn" + + "/CifHYQuVrWZf1aMPc165Z5rXsaSr+ZlzZB/1SVgoNlhyYFHeZ2+omVO8m6mvXhX4+y1Vr3DvdwjH32U2+lVO+Lv5bLPmjPSZjqxtK5nxg/zr7wEDLv38d3QLK+LrWg1p/rdfF1Ol+fce7HMe5bPDscoVvXqM1PV" + + "9vyuZqShY7XnVb3/Xc27r5woX30JGG10sLqxZ7ld7B3ayh66Obr9PartHY5RvNPfobnPbi1jFY/k1tqp/x0uAQMeOSSz3FHsiH4k98jso77TD7QQXD0co7wj+pFcRh/l78Xqtmd9au5h/7tcAgY/ekhm+Y/ERjUj" + + "/cjMsx6HP1pTsHpIZnmj2FGd8UY1e7Fma9NeXf5h7TtdAoZ/5LDs1czir4jlR5j1z7yz+Ozw5RqzvFfEWHvWN2dL/khN1i/x73YJHPro4VnJ38t5Nv7o7NadjasHaC/v2Tj72utR9340v9Yf8r/rJWATe4dytNGV" + + "urNynplzNP+r9NWDtZJ3Vk6315XeXd3DWr0E7/7fE8wG92WsHNjss1JnDnWj/plj/y63yzM/savN+KN8df2u/5Ha1dzVvDrPo3W1z9P+d7oEboaX88gB8qXu1ZrnerP8mrtSY86o1vgr8ZG1j9Yczc/9PlObfU7h" + + "3/ESsDFf0uyAjl6AtcRX6jPfnnt1XY21I9zrOap7ZK1RL/VHez5a9+y61r8Ev+slcLO+9LMO0Gof13UOcbXe/MRRz8w5mz+75rP17uesPvY7Fb/7JXCzvsRnDiG97AN/pFfW02Nkj/Qe9er01Tm62j3tzN5n9tqb" + + "++H473IJ3KAv9YxDZi97g2f0pU/XG/272avmfFXfl7y/3+0S+BLyJZ91cOmdfV0LPHON7PsuPtrXmeu/Y40z5731+l0vwW0DG/Hlv/KgukauO+KvnCPXPDJT1p3Nv8scD+/rT7gEbr5+jHcdRtcX6xzqfwr+cfv7" + + "ky5BPWT5sb7qQtSZflc/3+Xvuofh3H/yJchNdx/x52LkG/rg3bv6iP6B7G+5BN2n6z7233YxunfQvas/WvubL0H3YfcOxe92Sfb2072Dv077uQTHPvmzh+roJXp2vWO7+8n+eQM/b+DnDfy8gZ838PMGft7Azxv4" + + "eQM/b+DnDfyFb+D/AdGPZ94O5ww1AAAAAElFTkSuQmCC"; + + byte[] bytes = Convert.FromBase64String(BASE64); + + roundBlur20 = TextureUtilities.LoadImage(193, 193, bytes); + + roundBlur20.hideFlags = HideFlags.HideAndDontSave; + + CleanupUtility.DestroyObjectOnAssemblyReload(roundBlur20); + } + + return roundBlur20; + } + } + + private static Texture2D leftToRightFade; + private static Texture2D topToBottomFade; + private static Texture2D bottomToTopFade; + private static Texture2D roundBlur6; + private static Texture2D roundBlur20; + + public static void Clear() + { + if (leftToRightFade != null) + { + UnityEngine.Object.Destroy(leftToRightFade); + } + + if (topToBottomFade != null) + { + UnityEngine.Object.Destroy(topToBottomFade); + } + + if (bottomToTopFade != null) + { + UnityEngine.Object.Destroy(bottomToTopFade); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUITextures.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUITextures.cs.meta new file mode 100644 index 000000000..1fb902d6e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationGUITextures.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 78842ff15d254d9b8994383880b759f1 +timeCreated: 1704903394 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationMetadataRegistry.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationMetadataRegistry.cs new file mode 100644 index 000000000..9a70db77f --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationMetadataRegistry.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine.Localization.Metadata; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public class OdinLocalizationMetadataRegistry + { + public static readonly List AssetEntryMetadataTypes = new List(); + + public static readonly List StringEntryMetadataTypes = new List(); + + public static readonly Dictionary MetadataAllowsMultiple = new Dictionary(); + + static OdinLocalizationMetadataRegistry() + { + TypeCache.TypeCollection metadataTypes = TypeCache.GetTypesDerivedFrom(typeof(IMetadata)); + + for (var i = 0; i < metadataTypes.Count; i++) + { + Type currentType = metadataTypes[i]; + + var attr = currentType.GetCustomAttribute(); + + if (attr is null) + { + MetadataAllowsMultiple[currentType] = true; + continue; + } + + MetadataAllowsMultiple[currentType] = attr.AllowMultiple; + + MetadataType currentAllowedTypes = attr.AllowedTypes; + + if (currentAllowedTypes.HasFlag(MetadataType.StringTableEntry)) + { + StringEntryMetadataTypes.Add(currentType); + } + + if (currentAllowedTypes.HasFlag(MetadataType.AssetTableEntry)) + { + AssetEntryMetadataTypes.Add(currentType); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationMetadataRegistry.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationMetadataRegistry.cs.meta new file mode 100644 index 000000000..e47018072 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationMetadataRegistry.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7deb6e0b5f6c4579ba2ead2af5620d3e +timeCreated: 1706509329 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValidator.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValidator.cs new file mode 100644 index 000000000..54e3fc26f --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValidator.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if SIRENIX_INTERNAL +using System.Collections; +using System.Reflection; +using Sirenix.OdinInspector.Editor.Validation; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; + +[assembly: RegisterValidator(typeof(OdinLocalizationReflectionValidator))] +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public class OdinLocalizationReflectionValidator : GlobalValidator + { + public override IEnumerable RunValidation(ValidationResult result) + { + OdinLocalizationReflectionValues.EnsureInit(); + + FieldInfo[] fields = typeof(OdinLocalizationReflectionValues).GetFields(BindingFlags.Static | BindingFlags.Public); + + for (var i = 0; i < fields.Length; i++) + { + if (fields[i].IsLiteral) + { + continue; + } + + if (fields[i].GetValue(null) != null) + { + continue; + } + + result.AddError($"[Odin Localization Module]: {fields[i].Name} was not found."); + } + + return null; + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValidator.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValidator.cs.meta new file mode 100644 index 000000000..bb30c80b5 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValidator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c12d37dc91fe4285bd661d45717bf34a +timeCreated: 1704797628 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValues.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValues.cs new file mode 100644 index 000000000..62426c162 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValues.cs @@ -0,0 +1,174 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Reflection; +using Sirenix.Serialization; +using UnityEditor.AddressableAssets.Settings; +using UnityEditor.Localization; +using UnityEngine.Localization; +using UnityEngine.Localization.Metadata; +using UnityEngine.Localization.Tables; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public static class OdinLocalizationReflectionValues + { + public const string TABLE_ENTRY_DATA__METADATA__PATH = "m_Metadata"; + public const string METADATA_COLLECTION__ITEMS__PATH = "m_Items"; + public const string TABLE_ENTRY__DATA__PATH = "Data"; + + public static readonly bool HasAPIForCustomUndo = false; + + public static readonly PropertyInfo TableEntry_Data_Property; + public static readonly PropertyInfo AssetTableEntry_Data_Property; + public static readonly PropertyInfo StringTableEntry_Data_Property; + + public static readonly FieldInfo TableEntryData_m_Metadata_Field; + public static readonly FieldInfo MetadataCollection_m_Items_Field; + + public static readonly PropertyInfo LocalizationEditorSettings_Instance; + public static readonly MethodInfo LocalizationEditorSettings_GetAddressableAssetSettings; + public static readonly MethodInfo LocalizationEditorSettings_IsTableNameValid; + + public static readonly MethodInfo RaiseTableEntryModified_Method; + public static readonly MethodInfo RaiseTableEntryAdded_Method; + public static readonly MethodInfo RaiseTableEntryRemoved_Method; + public static readonly MethodInfo RaiseAssetTableEntryAdded_Method; + public static readonly MethodInfo RaiseAssetTableEntryRemoved_Method; + public static readonly MethodInfo AssetTableCollection_SetEntryAssetType_PrivateMethod; + public static readonly MethodInfo AssetTableCollection_RemoveEntryAssetType_PrivateMethod; + + public static readonly Type AddressHelper; + public static readonly MethodInfo FormatAssetLabelMethod; + public static readonly MethodInfo UpdateAssetGroupMethod; + + private const BindingFlags INSTANCE_ALL = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + private const BindingFlags INSTANCE_NON_PUBLIC = BindingFlags.Instance | BindingFlags.NonPublic; + private const BindingFlags STATIC_NON_PUBLIC = BindingFlags.Static | BindingFlags.NonPublic; + + internal static Func LocalizationEditorSettings_GetAddressableAssetSettingsFunc; + + static OdinLocalizationReflectionValues() + { + TableEntry_Data_Property = typeof(TableEntry).GetProperty(TABLE_ENTRY__DATA__PATH, INSTANCE_ALL); + AssetTableEntry_Data_Property = typeof(AssetTableEntry).BaseType.GetProperty(TABLE_ENTRY__DATA__PATH, INSTANCE_ALL); + StringTableEntry_Data_Property = typeof(StringTableEntry).BaseType.GetProperty(TABLE_ENTRY__DATA__PATH, INSTANCE_ALL); + + Type tableEntryDataType = TwoWaySerializationBinder.Default.BindToType("UnityEngine.Localization.Tables.TableEntryData, Unity.Localization"); + + TableEntryData_m_Metadata_Field = tableEntryDataType?.GetField(TABLE_ENTRY_DATA__METADATA__PATH, INSTANCE_ALL); + MetadataCollection_m_Items_Field = typeof(MetadataCollection).GetField(METADATA_COLLECTION__ITEMS__PATH, INSTANCE_ALL); + + LocalizationEditorSettings_Instance = typeof(LocalizationEditorSettings).GetProperty("Instance", STATIC_NON_PUBLIC); + LocalizationEditorSettings_GetAddressableAssetSettings = typeof(LocalizationEditorSettings).GetMethod("GetAddressableAssetSettings", + INSTANCE_NON_PUBLIC); + LocalizationEditorSettings_IsTableNameValid = typeof(LocalizationEditorSettings).GetMethod("IsTableNameValid", INSTANCE_NON_PUBLIC); + + + RaiseTableEntryModified_Method = LocalizationEditorSettings.EditorEvents.GetType().GetMethod("RaiseTableEntryModified", INSTANCE_ALL); + RaiseTableEntryAdded_Method = LocalizationEditorSettings.EditorEvents.GetType().GetMethod("RaiseTableEntryAdded", INSTANCE_ALL); + RaiseTableEntryRemoved_Method = LocalizationEditorSettings.EditorEvents.GetType().GetMethod("RaiseTableEntryRemoved", INSTANCE_ALL); + RaiseAssetTableEntryAdded_Method = LocalizationEditorSettings.EditorEvents.GetType().GetMethod("RaiseAssetTableEntryAdded", INSTANCE_ALL); + RaiseAssetTableEntryRemoved_Method = LocalizationEditorSettings.EditorEvents.GetType().GetMethod("RaiseAssetTableEntryRemoved", INSTANCE_ALL); + AssetTableCollection_SetEntryAssetType_PrivateMethod = typeof(AssetTableCollection).GetMethod("SetEntryAssetType", INSTANCE_NON_PUBLIC); + AssetTableCollection_RemoveEntryAssetType_PrivateMethod = typeof(AssetTableCollection).GetMethod("RemoveEntryAssetType", INSTANCE_NON_PUBLIC); + + if (LocalizationEditorSettings_Instance != null && LocalizationEditorSettings_GetAddressableAssetSettings != null) + { + LocalizationEditorSettings_GetAddressableAssetSettingsFunc = + (Func) Delegate.CreateDelegate(typeof(Func), + LocalizationEditorSettings_Instance.GetValue(null), + LocalizationEditorSettings_GetAddressableAssetSettings); + } + + AddressHelper = TwoWaySerializationBinder.Default.BindToType("UnityEngine.Localization.AddressHelper"); + + FormatAssetLabelMethod = AddressHelper?.GetMethod("FormatAssetLabel", + BindingFlags.Static | BindingFlags.Public, + null, + new[] {typeof(LocaleIdentifier)}, + null); + + UpdateAssetGroupMethod = typeof(AssetTableCollection).GetMethod("UpdateAssetGroup", + BindingFlags.Instance | BindingFlags.NonPublic, + null, + new[] + { + typeof(AddressableAssetSettings), + typeof(AddressableAssetEntry), + typeof(bool) + }, + null); + + HasAPIForCustomUndo = AddressHelper != null && + FormatAssetLabelMethod != null && + UpdateAssetGroupMethod != null && + LocalizationEditorSettings_GetAddressableAssetSettingsFunc != null; + } + + public static Action Create_RaiseTableEntryModified_Method_Delegate(LocalizationEditorEvents events) + { + return (Action) Delegate.CreateDelegate(typeof(Action), + events, + RaiseTableEntryModified_Method); + } + + public static Action Create_RaiseTableEntryAdded_Method_Delegate( + LocalizationEditorEvents events) + { + return (Action) + Delegate.CreateDelegate(typeof(Action), + events, + RaiseTableEntryAdded_Method); + } + + public static Action Create_RaiseTableEntryRemoved_Method_Delegate( + LocalizationEditorEvents events) + { + return (Action) + Delegate.CreateDelegate(typeof(Action), + events, + RaiseTableEntryRemoved_Method); + } + + public static Action Create_AssetTableEntryAdded_Method_Delegate( + LocalizationEditorEvents events) + { + return (Action) + Delegate.CreateDelegate(typeof(Action), + events, + RaiseAssetTableEntryAdded_Method); + } + + public static Action Create_AssetTableEntryRemoved_Method_Delegate( + LocalizationEditorEvents events) + { + return (Action) + Delegate.CreateDelegate(typeof(Action), + events, + RaiseAssetTableEntryRemoved_Method); + } + + public static Action Create_AssetTableCollection_SetEntryAssetType_PrivateMethod_Delegate(AssetTableCollection collection) + { + return (Action) Delegate.CreateDelegate(typeof(Action), + collection, + AssetTableCollection_SetEntryAssetType_PrivateMethod); + } + + public static Action Create_AssetTableCollection_RemoveEntryAssetType_PrivateMethod_Delegate(AssetTableCollection collection) + { + return (Action) Delegate.CreateDelegate(typeof(Action), + collection, + AssetTableCollection_RemoveEntryAssetType_PrivateMethod); + } + +#if SIRENIX_INTERNAL + public static void EnsureInit() { } +#endif + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValues.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValues.cs.meta new file mode 100644 index 000000000..c6267e259 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationReflectionValues.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b54903c48e344164a8ef89c56ba21f22 +timeCreated: 1704797678 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationSyntaxHighlighter.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationSyntaxHighlighter.cs new file mode 100644 index 000000000..45fc9a6f4 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationSyntaxHighlighter.cs @@ -0,0 +1,196 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System.Runtime.CompilerServices; +using System.Text; +using Sirenix.OdinInspector.Modules.Localization.Editor.Configs; +using UnityEditor.Localization.Plugins.XLIFF.V12; +using UnityEngine; +using UnityEngine.Localization.SmartFormat; +using UnityEngine.Localization.SmartFormat.Core.Parsing; +using UnityEngine.Localization.SmartFormat.Core.Settings; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor.Internal +{ + public static class OdinLocalizationSyntaxHighlighter + { + private const string END_RICH_COLOR = ""; + + private static readonly SmartFormatter Formatter; + + private static readonly StringBuilder Buffer; + + // TODO: if this works nicely, maybe implement a custom solution that doesn't rely on SmartFormatter + + static OdinLocalizationSyntaxHighlighter() + { + Formatter = Smart.CreateDefaultSmartFormat(); + Formatter.Settings.ParseErrorAction = ErrorAction.MaintainTokens; + Formatter.Settings.FormatErrorAction = ErrorAction.MaintainTokens; + + Buffer = new StringBuilder(); + } + + public static string HighlightAsRichText(string source) + { + Format format = Formatter.Parser.ParseFormat(source, Formatter.GetNotEmptyFormatterExtensionNames()); + + Buffer.Clear(); + + int expectedSize = source.Length; + AppendToBuffer(format, source, ref expectedSize); + + // NOTE: we fallback to source in-case any obvious discrepancies are happening. + return Buffer.Length != expectedSize ? source : Buffer.ToString(); + } + + public static string GetErrorMessage(string source, out bool foundError) + { + Formatter.Settings.ParseErrorAction = ErrorAction.OutputErrorInResult; + Formatter.Settings.FormatErrorAction = ErrorAction.OutputErrorInResult; + + Format format = Formatter.Parser.ParseFormat(source, Formatter.GetNotEmptyFormatterExtensionNames()); + + Buffer.Clear(); + + int expectedSize = source.Length; + AppendToBuffer(format, source, ref expectedSize); + + foundError = expectedSize != Buffer.Length; + + Formatter.Settings.ParseErrorAction = ErrorAction.MaintainTokens; + Formatter.Settings.FormatErrorAction = ErrorAction.MaintainTokens; + + return Buffer.ToString(); + } + + private static void AppendColorAsRichTag(Color color, ref int expectedSize) + { + var color32 = (Color32) color; + + var richTag = $""; + expectedSize += richTag.Length; + + Buffer.Append(richTag); + } + + private static bool IsLastBufferEqual(string expected) + { + if (expected.Length > Buffer.Length) + { + return false; + } + + int bufferIndex = Buffer.Length - 1; + + for (int i1 = expected.Length - 1; i1 >= 0; i1--, bufferIndex--) + { + if (Buffer[bufferIndex] != expected[i1]) + { + return false; + } + } + + return true; + } + + private static void AppendToBuffer(Format format, string source, ref int expectedSize) + { + for (var i = 0; i < format.Items.Count; i++) + { + if (Buffer.Length == source.Length) + { + break; + } + + FormatItem item = format.Items[i]; + + if (!(item is Placeholder placeholder)) + { + Buffer.Append(item.RawText); + continue; + } + + AppendColorAsRichTag(OdinLocalizationConfig.Instance.placeholderColor, ref expectedSize); + + Buffer.Append('{'); + + for (var j = 0; j < placeholder.Selectors.Count; j++) + { + Selector selector = placeholder.Selectors[j]; + + AppendColorAsRichTag(OdinLocalizationConfig.Instance.selectorColor, ref expectedSize); + + string op = selector.Operator; + + if (!string.IsNullOrEmpty(op)) + { + Buffer.Append(selector.Operator); + } + + Buffer.Append(selector.RawText); + + Buffer.Append(END_RICH_COLOR); + expectedSize += END_RICH_COLOR.Length; + } + + if (placeholder.Alignment != 0) + { + Buffer.Append(','); + + Buffer.Append(placeholder.Alignment); + } + + if (!string.IsNullOrEmpty(placeholder.FormatterName)) + { + Buffer.Append(':'); + + AppendColorAsRichTag(OdinLocalizationConfig.Instance.formatterColor, ref expectedSize); + + Buffer.Append(placeholder.FormatterName); + + if (!string.IsNullOrEmpty(placeholder.FormatterOptions)) + { + Buffer.Append('('); + Buffer.Append(placeholder.FormatterOptions); + Buffer.Append(')'); + } + + Buffer.Append(END_RICH_COLOR); + expectedSize += END_RICH_COLOR.Length; + } + + if (placeholder.Format != null) + { + Format nextFormat = placeholder.Format; + + bool showColon; + + if (nextFormat.startIndex > 0) + { + showColon = nextFormat.baseString[nextFormat.startIndex - 1] == ':'; + } + else + { + showColon = true; + } + + if (showColon) + { + Buffer.Append(':'); + } + + AppendToBuffer(nextFormat, source, ref expectedSize); + } + + Buffer.Append('}'); + + Buffer.Append(END_RICH_COLOR); + expectedSize += END_RICH_COLOR.Length; + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationSyntaxHighlighter.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationSyntaxHighlighter.cs.meta new file mode 100644 index 000000000..b75002cdd --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Internal/OdinLocalizationSyntaxHighlighter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: edfba57bc4284142a39f658cc44f70c6 +timeCreated: 1704797761 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/LocalizationSupport.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/LocalizationSupport.cs new file mode 100644 index 000000000..825c069f2 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/LocalizationSupport.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + using UnityEngine.Localization; + using Sirenix.OdinInspector.Editor; + using System; + using Sirenix.Utilities.Editor; + + public class LocalizedReferenceResolver : OdinPropertyResolver + { + public override int ChildNameToIndex(string name) + { + throw new NotSupportedException(); + } + + public override int ChildNameToIndex(ref StringSlice name) + { + throw new NotSupportedException(); + } + + public override InspectorPropertyInfo GetChildInfo(int childIndex) + { + throw new NotSupportedException(); + } + + protected override int GetChildCount(LocalizedReference value) + { + return 0; + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/LocalizationSupport.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/LocalizationSupport.cs.meta new file mode 100644 index 000000000..347fefe2f --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/LocalizationSupport.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46db7b2a049564544ad19a2e480a1333 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/OdinLocalizationConstants.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/OdinLocalizationConstants.cs new file mode 100644 index 000000000..b5c220810 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/OdinLocalizationConstants.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using Sirenix.OdinInspector.Modules.Localization.Editor.Configs; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public static class OdinLocalizationConstants + { + public static int AssetPreviewRowHeight => OdinLocalizationConfig.Instance.assetRowHeight; + public const int DEFAULT_COLUMN_WIDTH = 300; + public const int MIN_COLUMN_WIDTH = 200; + public const int COLUMN_HEIGHT = 38; + public const int ROW_MENU_WIDTH = 28; + public const int ROW_HEIGHT = 30; + public const int EMPTY_ASSET_ROW_HEIGHT = ROW_HEIGHT; //96; + public const int ASSET_ROW_HEIGHT = 104; //96; + public const int ENTRY_PADDING = 4; + public const int TOOLBAR_HEIGHT = 28; + public const int DRAG_HANDLE_WIDTH = 27; + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/OdinLocalizationConstants.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/OdinLocalizationConstants.cs.meta new file mode 100644 index 000000000..b314d14f4 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/OdinLocalizationConstants.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cd2728f4c9e842db8d6b5e8c18cce611 +timeCreated: 1706411619 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef new file mode 100644 index 000000000..a33eec9c2 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef @@ -0,0 +1,29 @@ +{ + "name": "Sirenix.OdinInspector.Modules.UnityLocalization.Editor", + "references": [ + "Unity.Localization", + "Sirenix.Serialization", + "Sirenix.OdinInspector.Attributes", + "Sirenix.OdinInspector.Editor", + "Sirenix.Utilities.Editor", + "Unity.Localization.Editor", + "Sirenix.Utilities", + "Unity.Addressables.Editor" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [ + "Sirenix.Serialization.dll", + "Sirenix.OdinInspector.Attributes.dll", + "Sirenix.OdinInspector.Editor.dll", + "Sirenix.Utilities.Editor.dll" + ], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef.meta new file mode 100644 index 000000000..fd0f63831 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3656feb4b010c5941972fb7b3b9eec3e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows.meta new file mode 100644 index 000000000..03c97b2a1 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 835e118525d8475f939f4105af066578 +timeCreated: 1704796852 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows/OdinLocalizationEditorWindow.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows/OdinLocalizationEditorWindow.cs new file mode 100644 index 000000000..015789d6d --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows/OdinLocalizationEditorWindow.cs @@ -0,0 +1,663 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using Sirenix.OdinInspector.Editor; +using Sirenix.OdinInspector.Editor.Internal; +using Sirenix.OdinInspector.Modules.Localization.Editor.Configs; +using Sirenix.OdinInspector.Modules.Localization.Editor.Internal; +using Sirenix.Serialization; +using Sirenix.Utilities; +using Sirenix.Utilities.Editor; +using UnityEditor; +using UnityEditor.Localization; +using UnityEngine; +using UnityEngine.Localization; + +namespace Sirenix.OdinInspector.Modules.Localization.Editor +{ + public class OdinLocalizationCreateTableMenu + { + [Serializable] + public class LocaleItem + { + [HideInInspector] + public Locale Locale; + + [HideLabel] + public bool Enabled; + } + + public enum TableCollectionType + { + StringTableCollection, + AssetTableCollection + } + + private string FolderPath => string.IsNullOrEmpty(this.Folder) ? "Assets" : $"Assets/{this.Folder}"; + + [ValidateInput(nameof(ValidateName), "@this." + nameof(nameErrorMessage))] + [VerticalGroup("Split/Left")] + [PropertySpace(SpaceAfter = 2, SpaceBefore = 2)] + public string Name; + + [EnableIf("@this." + nameof(EnableFolder))] + [InfoBox("The directory is not found, this will create a new directory on creation.", visibleIfMemberName: nameof(ShowFolderInfoBox))] + [HorizontalGroup("Split")] + [VerticalGroup("Split/Left")] + [FolderPath(ParentFolder = "Assets")] + public string Folder; + + [VerticalGroup("Split/Left")] + [PropertySpace(SpaceAfter = 2, SpaceBefore = 2)] + [HideLabel] + [EnumToggleButtons] + public TableCollectionType Type; + + [EnableIf(nameof(EnableCreateIf))] + [VerticalGroup("Split/Left")] + [PropertySpace(SpaceBefore = 4)] + [Button(ButtonSizes.Large)] + public void Create() + { + var localizationWindow = EditorWindow.focusedWindow as OdinLocalizationEditorWindow; + + if (!this.HasAnyLocaleSelected()) + { + if (localizationWindow) + { + localizationWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.ExclamationOctagonFill, + "At least 1 Locale must be selected.", + new Color(0.68f, 0.2f, 0.2f), + 5.0f); + } + + return; + } + + if (!Directory.Exists(this.FolderPath)) + { + Directory.CreateDirectory(this.FolderPath); + } + + var collectionLocales = new List(this.Locales.Count); + + foreach (LocaleItem localeItem in this.Locales) + { + if (localeItem.Enabled) + { + collectionLocales.Add(localeItem.Locale); + } + } + + switch (this.Type) + { + case TableCollectionType.StringTableCollection: + LocalizationEditorSettings.CreateStringTableCollection(this.Name, this.FolderPath, collectionLocales); + break; + + case TableCollectionType.AssetTableCollection: + LocalizationEditorSettings.CreateAssetTableCollection(this.Name, this.FolderPath, collectionLocales); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + if (localizationWindow) + { + string typeNiceName; + + switch (this.Type) + { + case TableCollectionType.StringTableCollection: + typeNiceName = "String Table Collection"; + break; + + case TableCollectionType.AssetTableCollection: + typeNiceName = "Asset Table Collection"; + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + localizationWindow.ShowToast(ToastPosition.BottomLeft, + SdfIconType.Check2, + $"{typeNiceName} '{this.Name}' created at: {this.FolderPath}.", + new Color(0.29f, 0.57f, 0.42f), + 16.0f); + } + } + + [HorizontalGroup("Split")] + [VerticalGroup("Split/Right")] + [InlineProperty] + [ListDrawerSettings(ListElementLabelName = "@this.Locale.LocaleName", + HideAddButton = true, + HideRemoveButton = true, + DefaultExpandedState = true, + ShowFoldout = false, + ShowItemCount = false, + DraggableItems = false)] + public List Locales = new List(); + + [HorizontalGroup("Split/Right/Split")] + [Button] + public void LocaleGenerator() + { + try + { + TwoWaySerializationBinder.Default.BindToType("UnityEditor.Localization.UI.LocaleGeneratorWindow, Unity.Localization.Editor") + .GetMethod("ShowWindow", BindingFlags.Static | BindingFlags.Public) + .Invoke(null, null); + } + catch (NullReferenceException nullReferenceException) + { + Debug.LogError($"[Odin]: Failed to find LocaleGeneratorWindow.ShowWindow.\n{nullReferenceException.Message}"); + } + } + + [HorizontalGroup("Split/Right/Split")] + [Button] + public void SelectNone() + { + for (var i = 0; i < this.Locales.Count; i++) + { + this.Locales[i].Enabled = false; + } + } + + [HorizontalGroup("Split/Right/Split")] + [Button] + public void SelectAll() + { + for (var i = 0; i < this.Locales.Count; i++) + { + this.Locales[i].Enabled = true; + } + } + + [HideInInspector] + internal bool EnableFolder = true; + + private string nameErrorMessage = string.Empty; + + private bool ValidateName(string name) + { + if (string.IsNullOrEmpty(name)) + { + this.nameErrorMessage = $"{nameof(this.Name)} can't be empty."; + return false; + } + + Type collectionType; + + switch (this.Type) + { + case TableCollectionType.StringTableCollection: + collectionType = typeof(StringTableCollection); + break; + + case TableCollectionType.AssetTableCollection: + collectionType = typeof(AssetTableCollection); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + + bool isTableNameValid = OdinLocalizationEditorSettings.IsTableNameValid(collectionType, name, out string localizationErrorMsg); + + if (isTableNameValid) + { + return true; + } + + this.nameErrorMessage = localizationErrorMsg; + + return false; + } + + private bool ShowFolderInfoBox() + { + if (string.IsNullOrEmpty(this.Folder)) + { + return false; + } + + return !Directory.Exists(this.FolderPath); + } + + private bool EnableCreateIf() => this.Locales.Count > 0 && this.ValidateName(this.Name); + + private bool HasAnyLocaleSelected() + { + for (var i = 0; i < this.Locales.Count; i++) + { + if (this.Locales[i].Enabled) + { + return true; + } + } + + return false; + } + } + + public class OdinLocalizationEditorWindow : OdinMenuEditorWindow, IDisposable + { + public enum RightMenuTopTabs + { + [LabelText(SdfIconType.Braces)] + Metadata, + + [LabelText(SdfIconType.GearFill)] + Settings + } + + public enum RightMenuBottomTabs + { + [LabelText(SdfIconType.FlagFill)] + Locale, + +#if false + [LabelText(SdfIconType.BorderWidth)] + Template, +#endif + + [LabelText(SdfIconType.GearFill)] + Settings + } + + public class WindowState : IDisposable + { + public static string EditorPrefsKey = "OdinLocalizationEditorWindow_EditorPrefs"; + + public RightMenuTopTabs CurrentTopTab; + public RightMenuBottomTabs CurrentBottomTab; + public PropertyTree MetadataTree = null; + public bool ShowSharedMetadata = true; + + public float LeftMenuWidth; + public float RightMenuWidth; + public float RightMenuTopPanelHeight; + public float LastOpenRightMenuWidth; + + public void Save() + { + EditorPrefs.SetFloat($"{EditorPrefsKey}_LeftMenuWidth", this.LeftMenuWidth); + EditorPrefs.SetFloat($"{EditorPrefsKey}_RightMenuWidth", this.RightMenuWidth); + EditorPrefs.SetFloat($"{EditorPrefsKey}_RightMenuTopHeight", this.RightMenuTopPanelHeight); + EditorPrefs.SetFloat($"{EditorPrefsKey}_LastOpenRightMenuWidth", this.LastOpenRightMenuWidth); + } + + public void Load() + { + this.LeftMenuWidth = EditorPrefs.GetFloat($"{EditorPrefsKey}_LeftMenuWidth", 300); + this.RightMenuWidth = EditorPrefs.GetFloat($"{EditorPrefsKey}_RightMenuWidth", 300); + this.RightMenuTopPanelHeight = EditorPrefs.GetFloat($"{EditorPrefsKey}_RightMenuTopHeight"); + this.LastOpenRightMenuWidth = EditorPrefs.GetFloat($"{EditorPrefsKey}_LastOpenRightMenuWidth"); + } + + public void Dispose() + { + this.MetadataTree?.Dispose(); + this.MetadataTree = null; + } + } + + [MenuItem("Tools/Odin/Localization Editor", priority = 10_100)] + public static void OpenFromMenu() + { + var wnd = GetWindow(); + wnd.MenuWidth = 300.0f; + } + + public WindowState State; + + private object lastSelection; + + protected override void Initialize() + { + this.State = new WindowState(); + this.State.Load(); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + + this.DisposeActiveCollection(); + this.State.Dispose(); + } + + protected override void OnDisable() + { + base.OnDisable(); + this.State.Save(); + + this.DisposeActiveCollection(); + this.State.Dispose(); + } + + protected override void OnImGUI() + { + if (LocalizationEditorSettings.ActiveLocalizationSettings == null) + { + Rect popupPosition = this.position.SetPosition(Vector2.zero).AlignCenter(360, 160); + + if (EditorGUIUtility.isProSkin) + { + //OdinLocalizationGUI.DrawRoundGlowRect(popupPosition.Expand(54), FancyColor.CreateHex(0x323232)); + OdinLocalizationGUI.DrawRoundBlur6(popupPosition, new Color(0, 0, 0, 0.025f)); + SirenixEditorGUI.DrawRoundRect(popupPosition, FancyColor.CreateHex(0x383838), 5.0f); + } + else + { + OdinLocalizationGUI.DrawRoundBlur6(popupPosition, new Color(0, 0, 0, 0.02f)); + SirenixEditorGUI.DrawRoundRect(popupPosition, new FancyColor(0.84f), 5.0f); //, new Color(0, 0, 0, 0.2f), 1); + + SirenixEditorGUI.DrawRoundRect(popupPosition.AlignBottom(32 + 12 + 8 + 6), new Color(1, 1, 1, 0.2f), 0.0f, 0.0f, 5.0f, 5.0f); + } + + popupPosition = popupPosition.Padding(12); + + Rect buttonsArea = popupPosition.TakeFromBottom(32); + + popupPosition.height -= 16; + + GUIStyle labelStyle = EditorGUIUtility.isProSkin ? SirenixGUIStyles.WhiteLabelCentered : SirenixGUIStyles.BlackLabelCentered; + + if (EditorGUIUtility.isProSkin) + { + GUI.Label(popupPosition, "No Localization Settings found in project.", labelStyle); + } + else + { + GUIHelper.PushColor(new Color(1, 1, 1, 0.75f)); + GUI.Label(popupPosition, "No Localization Settings found in project.", SirenixGUIStyles.BlackLabelCentered); + } + + if (OdinLocalizationGUI.OverlaidButton(buttonsArea.AlignCenter(120), "Create", labelStyle: labelStyle, invert: true)) + { + if (OdinLocalizationEditorSettings.CreateDefaultLocalizationSettingsAsset()) + { + this.ShowToast(ToastPosition.BottomLeft, + SdfIconType.GearWide, + "Default Localization Settings created.", + new Color(0.13f, 0.26f, 0.39f), + 8.0f); + } + } + + if (!EditorGUIUtility.isProSkin) + { + GUIHelper.PopColor(); + } + + this.Repaint(); + return; + } + + base.OnImGUI(); + } + + protected override OdinMenuTree BuildMenuTree() + { + var tree = new OdinMenuTree + { + Config = + { + AutoHandleKeyboardNavigation = false, + DrawSearchToolbar = true + }, + DefaultMenuStyle = + { + Height = 28, + AlignTriangleLeft = true, + TrianglePadding = 0.0f + } + }; + + this.MenuBackgroundColor = OdinLocalizationGUI.MenuBackground; + + if (LocalizationEditorSettings.ActiveLocalizationSettings == null) + { + return tree; + } + + var createMenu = new OdinLocalizationCreateTableMenu(); + + tree.Add("Create Table", createMenu, SdfIconType.Plus); + tree.Add("User Config", OdinLocalizationConfig.Instance, SdfIconType.GearFill); + +#if true + tree.Selection.SelectionChanged += type => + { + switch (type) + { + case SelectionChangedType.ItemAdded: + if (this.lastSelection != null) + { + switch (this.lastSelection) + { + case OdinAssetTableCollectionEditor assetCollection: + { + assetCollection.DetachEvents(); + break; + } + + case OdinStringTableCollectionEditor stringCollection: + { + stringCollection.DetachEvents(); + break; + } + } + + this.State.MetadataTree?.Dispose(); + this.State.MetadataTree = null; + } + + switch (tree.Selection.SelectedValue) + { + case OdinAssetTableCollectionEditor assetCollection: + { + assetCollection.OnSelectInWindow(); + + if (assetCollection.SelectionType == OdinTableSelectionType.TableEntry && this.State.CurrentTopTab == RightMenuTopTabs.Metadata) + { + assetCollection.UpdateMetadataViewForEntry(assetCollection.CurrentSelectedEntry); + } + + break; + } + + case OdinStringTableCollectionEditor stringCollection: + { + stringCollection.OnSelectInWindow(); + + if (stringCollection.SelectionType == OdinTableSelectionType.TableEntry && this.State.CurrentTopTab == RightMenuTopTabs.Metadata) + { + stringCollection.UpdateMetadataViewForEntry(stringCollection.CurrentSelectedEntry); + } + + break; + } + + case OdinLocalizationCreateTableMenu createTableMenu: + createTableMenu.Locales.Clear(); + + foreach (Locale locale in LocalizationEditorSettings.GetLocales()) + { + createTableMenu.Locales.Add(new OdinLocalizationCreateTableMenu.LocaleItem {Locale = locale, Enabled = true}); + } + + break; + } + + this.lastSelection = this.MenuTree.Selection.SelectedValue; + + break; + } + }; +#endif + + string[] collectionGUIDs = AssetDatabase.FindAssets($"t:{nameof(LocalizationTableCollection)}"); + + for (var i = 0; i < collectionGUIDs.Length; i++) + { + string assetPath = AssetDatabase.GUIDToAssetPath(collectionGUIDs[i]); + + var collection = AssetDatabase.LoadAssetAtPath(assetPath); + + AssetTableCollection assetTableCollection = LocalizationEditorSettings.GetAssetTableCollection(collection.TableCollectionNameReference); + + if (assetTableCollection != null) + { + var guiCollection = new OdinAssetTableCollectionEditor(assetTableCollection, this, this.State); + + assetPath = assetPath.Replace(".asset", string.Empty); + + if (assetPath.StartsWith("Assets/")) + { + assetPath = assetPath.Remove(0, "Assets/".Length); + } + + tree.Add(assetPath, guiCollection, SdfIconType.Table); + + continue; + } + + StringTableCollection stringTableCollection = LocalizationEditorSettings.GetStringTableCollection(collection.TableCollectionNameReference); + + if (stringTableCollection != null) + { + var guiCollection = new OdinStringTableCollectionEditor(stringTableCollection, this, this.State); + + assetPath = assetPath.Replace(".asset", string.Empty); + + if (assetPath.StartsWith("Assets/")) + { + assetPath = assetPath.Remove(0, "Assets/".Length); + } + + tree.Add(assetPath, guiCollection, SdfIconType.LayoutTextWindow); + + continue; + } + } + + foreach (OdinMenuItem treeMenuItem in tree.EnumerateTree()) + { + if (treeMenuItem.Value != null) + { + if (treeMenuItem.Value is OdinAssetTableCollectionEditor assetEditor) + { + treeMenuItem.Name = assetEditor.Collection.SharedData.TableCollectionName; + + assetEditor.MenuItem = treeMenuItem; + + treeMenuItem.OnDrawItem += item => + { + if (Event.current.OnMouseDown(item.Rect, 0, false)) + { + if (Event.current.clickCount > 1) + { + EditorGUIUtility.PingObject(assetEditor.Collection); + } + } + }; + + continue; + } + + if (treeMenuItem.Value is OdinStringTableCollectionEditor stringEditor) + { + treeMenuItem.Name = stringEditor.Collection.SharedData.TableCollectionName; + + stringEditor.MenuItem = treeMenuItem; + + treeMenuItem.OnDrawItem += item => + { + if (Event.current.OnMouseDown(item.Rect, 0, false)) + { + if (Event.current.clickCount > 1) + { + EditorGUIUtility.PingObject(stringEditor.Collection); + } + } + }; + + continue; + } + + continue; + } + + treeMenuItem.Value = createMenu; + + treeMenuItem.SdfIcon = SdfIconType.FolderFill; + + treeMenuItem.OnDrawItem += item => + { + Rect addTableRect = item.Rect.AlignRight(20).SubX(14); + + bool isMouseOver = Event.current.IsMouseOver(addTableRect); + + if (EditorGUIUtility.isProSkin) + { + SdfIcons.DrawIcon(addTableRect.AlignCenter(16, 16), + SdfIconType.Plus, + isMouseOver ? new Color(1, 1, 1, 0.8f) : new Color(1, 1, 1, 0.4f)); + } + else + { + SdfIcons.DrawIcon(addTableRect.AlignCenter(16, 16), + SdfIconType.Plus, + isMouseOver ? new Color(0, 0, 0, 0.8f) : new Color(0, 0, 0, 0.4f)); + } + + if (Event.current.OnMouseDown(item.Rect, 0, false)) + { + createMenu.Folder = treeMenuItem.GetFullPath(); + } + }; + } + + return tree; + } + + public void Dispose() + { + this.DisposeActiveCollection(); + this.State.Dispose(); + } + + private void DisposeActiveCollection() + { + if (this.MenuTree == null) + { + return; + } + + switch (this.MenuTree.Selection.SelectedValue) + { + case OdinAssetTableCollectionEditor assetCollection: + assetCollection.DetachEvents(); + break; + + case OdinStringTableCollectionEditor stringCollection: + stringCollection.DetachEvents(); + break; + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows/OdinLocalizationEditorWindow.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows/OdinLocalizationEditorWindow.cs.meta new file mode 100644 index 000000000..009df3f5a --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Editor/Windows/OdinLocalizationEditorWindow.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a7cd6c96ce4b4c2c98fae9f89eedc690 +timeCreated: 1704796865 \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime.meta new file mode 100644 index 000000000..650a9338c --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b2477452e56429547b05666cbaaf3502 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/LocalizedStringFormatter.cs b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/LocalizedStringFormatter.cs new file mode 100644 index 000000000..6bdeb3c03 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/LocalizedStringFormatter.cs @@ -0,0 +1,58 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix ApS. All rights reserved. +// +//----------------------------------------------------------------------- + +using Sirenix.Serialization; +using System.Reflection; +using UnityEngine.Localization; +using System; + +#if !ODIN_INSPECTOR_EDITOR_ONLY +[assembly: RegisterFormatter(typeof(Sirenix.OdinInspector.Modules.Localization.LocalizedStringFormatter))] +#endif + +namespace Sirenix.OdinInspector.Modules.Localization +{ + #if !ODIN_INSPECTOR_EDITOR_ONLY + public class LocalizedStringFormatter : ReflectionOrEmittedBaseFormatter + { + private static readonly FieldInfo m_LocalVariables_Field; + + static LocalizedStringFormatter() + { + m_LocalVariables_Field = typeof(LocalizedString).GetField("m_LocalVariables", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + + if (m_LocalVariables_Field == null) + { + DefaultLoggers.DefaultLogger.LogError("Could not find field 'UnityEngine.LocalizedString.m_LocalVariables'" + + " - the internals of the Localization package have changed, and deserialization of Odin-serialized" + + " LocalizedString instances may be broken in some cases."); + } + } + + protected override LocalizedString GetUninitializedObject() + { + return new LocalizedString(); + } + + protected override void DeserializeImplementation(ref LocalizedString value, IDataReader reader) + { + base.DeserializeImplementation(ref value, reader); + + if (m_LocalVariables_Field != null && value != null) + { + var localVariablesList = m_LocalVariables_Field.GetValue(value); + + // This list is not allowed to be null! + if (localVariablesList == null) + { + localVariablesList = Activator.CreateInstance(m_LocalVariables_Field.FieldType); + m_LocalVariables_Field.SetValue(value, localVariablesList); + } + } + } + } + #endif +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/LocalizedStringFormatter.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/LocalizedStringFormatter.cs.meta new file mode 100644 index 000000000..f0c54924f --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/LocalizedStringFormatter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93ff93294e9339b40b68190c779d0009 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef new file mode 100644 index 000000000..661c1e804 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef @@ -0,0 +1,11 @@ +{ + "name": "Sirenix.OdinInspector.Modules.UnityLocalization", + "references": [ "Unity.Localization", "Sirenix.Serialization", "Sirenix.Serialization.Config" ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "autoReferenced": true, + "overrideReferences": false, + "precompiledReferences": [ "Sirenix.Serialization.dll", "Sirenix.Serialization.Config.dll" ], + "defineConstraints": [ "!ODIN_INSPECTOR_EDITOR_ONLY" ] +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef.meta new file mode 100644 index 000000000..953108842 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 09320d9ddd505f84d9a6e5203cf75192 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/manifest.txt b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/manifest.txt new file mode 100644 index 000000000..71f575a0c --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/manifest.txt @@ -0,0 +1,62 @@ +ManifestVersion: 1 +ModuleID: Unity.Localization +ModuleVersion: 2.0.0.2 +ModuleFiles: + Editor.meta + Runtime.meta + Editor/Configs.meta + Editor/GUI.meta + Editor/Internal.meta + Editor/LocalizationSupport.cs + Editor/LocalizationSupport.cs.meta + Editor/OdinLocalizationConstants.cs + Editor/OdinLocalizationConstants.cs.meta + Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef + Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef.meta + Editor/Windows.meta + Editor/Configs/OdinLocalizationConfig.asset + Editor/Configs/OdinLocalizationConfig.asset.meta + Editor/Configs/OdinLocalizationConfig.cs + Editor/Configs/OdinLocalizationConfig.cs.meta + Editor/GUI/LocalizationMetadata.cs + Editor/GUI/LocalizationMetadata.cs.meta + Editor/GUI/OdinAssetTableCollectionEditor.cs + Editor/GUI/OdinAssetTableCollectionEditor.cs.meta + Editor/GUI/OdinGUITable.cs + Editor/GUI/OdinGUITable.cs.meta + Editor/GUI/OdinGUITableCollection.cs + Editor/GUI/OdinGUITableCollection.cs.meta + Editor/GUI/OdinSharedEntryCollection.cs + Editor/GUI/OdinSharedEntryCollection.cs.meta + Editor/GUI/OdinStringTableCollectionEditor.cs + Editor/GUI/OdinStringTableCollectionEditor.cs.meta + Editor/GUI/OdinTableCollectionEditor.cs + Editor/GUI/OdinTableCollectionEditor.cs.meta + Editor/GUI/OdinTemplateMetadata.cs + Editor/GUI/OdinTemplateMetadata.cs.meta + Editor/GUI/Toggle.cs + Editor/GUI/Toggle.cs.meta + Editor/Internal/OdinLocalizationAssetCache.cs + Editor/Internal/OdinLocalizationAssetCache.cs.meta + Editor/Internal/OdinLocalizationEditorSettings.cs + Editor/Internal/OdinLocalizationEditorSettings.cs.meta + Editor/Internal/OdinLocalizationEvents.cs + Editor/Internal/OdinLocalizationEvents.cs.meta + Editor/Internal/OdinLocalizationGUI.cs + Editor/Internal/OdinLocalizationGUI.cs.meta + Editor/Internal/OdinLocalizationGUITextures.cs + Editor/Internal/OdinLocalizationGUITextures.cs.meta + Editor/Internal/OdinLocalizationMetadataRegistry.cs + Editor/Internal/OdinLocalizationMetadataRegistry.cs.meta + Editor/Internal/OdinLocalizationReflectionValidator.cs + Editor/Internal/OdinLocalizationReflectionValidator.cs.meta + Editor/Internal/OdinLocalizationReflectionValues.cs + Editor/Internal/OdinLocalizationReflectionValues.cs.meta + Editor/Internal/OdinLocalizationSyntaxHighlighter.cs + Editor/Internal/OdinLocalizationSyntaxHighlighter.cs.meta + Editor/Windows/OdinLocalizationEditorWindow.cs + Editor/Windows/OdinLocalizationEditorWindow.cs.meta + Runtime/LocalizedStringFormatter.cs + Runtime/LocalizedStringFormatter.cs.meta + Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef + Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef.meta diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/manifest.txt.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/manifest.txt.meta new file mode 100644 index 000000000..ee510fec7 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Localization/manifest.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc96f962541a9024e9bb1192bdb086dd +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Excel/CardDataTable.xlsx b/Assets/Resources/Excel/CardDataTable.xlsx index 7c701819e..5549b3f3e 100644 Binary files a/Assets/Resources/Excel/CardDataTable.xlsx and b/Assets/Resources/Excel/CardDataTable.xlsx differ diff --git a/Assets/Resources/JSON/CardDataTable.json b/Assets/Resources/JSON/CardDataTable.json index f58163b2d..9ceeaf0ef 100644 --- a/Assets/Resources/JSON/CardDataTable.json +++ b/Assets/Resources/JSON/CardDataTable.json @@ -1,7 +1,7 @@ [ { "Idx": "HeartSlotPlus", - "ScriptText": "하트 한칸 추가", + "ScriptText": "하트 한칸을 추가합니다.", "Max": 3, "Ratio": 5, "Type": 0, @@ -10,7 +10,7 @@ }, { "Idx": "HeartRecovery", - "ScriptText": "하트 한칸 회복", + "ScriptText": "하트 한칸을 회복합니다.", "Max": 10, "Ratio": 0, "Type": 0, @@ -19,7 +19,7 @@ }, { "Idx": "FullHeartRecovery", - "ScriptText": "하트 전체 회복", + "ScriptText": "하트 전체를 회복합니다.", "Max": 0, "Ratio": 5, "Type": 0, @@ -28,7 +28,7 @@ }, { "Idx": "AddLiquidB", - "ScriptText": "B 술을 4000ml 추가", + "ScriptText": "B술 재료를 4000ml 추가합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -37,7 +37,7 @@ }, { "Idx": "AddLiquidC", - "ScriptText": "C 술을 4000ml 추가", + "ScriptText": "C술 재료를 4000ml 추가합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -46,7 +46,7 @@ }, { "Idx": "AddLiquidD", - "ScriptText": "D 술을 4000ml 추가", + "ScriptText": "D술 재료를 4000ml 추가합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -55,7 +55,7 @@ }, { "Idx": "AddLiquidE", - "ScriptText": "E 술을 4000ml 추가", + "ScriptText": "E술 재료를 4000ml 추가합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -64,7 +64,7 @@ }, { "Idx": "AddGarnish1", - "ScriptText": "1번 가니쉬를 4000ml 추가", + "ScriptText": "1번 가니쉬 재료를 4000ml 추가합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -73,7 +73,7 @@ }, { "Idx": "AddGarnish2", - "ScriptText": "2번 가니쉬를 4000ml 추가", + "ScriptText": "2번 가니쉬 재료를 4000ml 추가합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -82,7 +82,7 @@ }, { "Idx": "AllLiquidAdd", - "ScriptText": "전체 재료 1000ml 추가", + "ScriptText": "모든 술 재료 1000ml 추가합니다.", "Max": 0, "Ratio": 5, "Type": 0, @@ -91,7 +91,7 @@ }, { "Idx": "ServerNpcAdd", - "ScriptText": "서빙 종업원 추가", + "ScriptText": "서빙 종업원을 추가합니다.", "Max": 5, "Ratio": 5, "Type": 0, @@ -100,7 +100,7 @@ }, { "Idx": "CleanerNpcAdd", - "ScriptText": "청소 종업원 추가", + "ScriptText": "청소 종업원을 추가합니다.", "Max": 5, "Ratio": 5, "Type": 0, @@ -109,7 +109,7 @@ }, { "Idx": "BartenderNpcAdd", - "ScriptText": "바텐터 종업원 추가", + "ScriptText": "바텐터 종업원을 추가합니다.", "Max": 6, "Ratio": 5, "Type": 0, @@ -118,7 +118,7 @@ }, { "Idx": "SpeedBoost", - "ScriptText": "플레이어 이동 속도 10% 증가", + "ScriptText": "플레이어의 이동속도가 10% 증가합니다.", "Max": 10, "Ratio": 5, "Type": 0, @@ -127,7 +127,7 @@ }, { "Idx": "ExpBoost", - "ScriptText": "경험치 획득 20% 증가", + "ScriptText": "경험치 획득량이 20% 증가합니다.", "Max": 10, "Ratio": 4, "Type": 0, @@ -136,7 +136,7 @@ }, { "Idx": "GoldBoost", - "ScriptText": "골드 획득 20% 증가", + "ScriptText": "골드 획득 20%이 증가합니다.", "Max": 10, "Ratio": 4, "Type": 0, @@ -145,7 +145,7 @@ }, { "Idx": "AllCleanUp", - "ScriptText": "레스토랑 한번에 청소", + "ScriptText": "레스토랑을 전부 청소합니다.", "Max": 0, "Ratio": 4, "Type": 0, @@ -154,7 +154,7 @@ }, { "Idx": "GaugeReset", - "ScriptText": "모든 손님들의 기다림 초기화", + "ScriptText": "모든 손님들의 기다림 게이지를 초기화합니다.", "Max": 0, "Ratio": 0, "Type": 0, @@ -163,7 +163,7 @@ }, { "Idx": "DashCooldownReduction", - "ScriptText": "대시 쿨타임 감소", + "ScriptText": "플레이어의 대시 쿨타임이 1초 감소합니다.", "Max": 5, "Ratio": 4, "Type": 0, @@ -172,7 +172,7 @@ }, { "Idx": "TipBoost", - "ScriptText": "팁 획득량 20% 증가", + "ScriptText": "팁 획득량이 20% 증가합니다.", "Max": 5, "Ratio": 4, "Type": 0, @@ -181,7 +181,7 @@ }, { "Idx": "EndGoldBoost", - "ScriptText": "게임 오버 후 획득 골드 10% 증가", + "ScriptText": "게임오버 후 획득 골드량이 10% 증가합니다.", "Max": 10, "Ratio": 4, "Type": 0, @@ -190,7 +190,7 @@ }, { "Idx": "AllCustomerPurification", - "ScriptText": "손님들 전부 정화", + "ScriptText": "손님들을 전부 정화시킵니다.", "Max": 0, "Ratio": 4, "Type": 0, @@ -199,7 +199,7 @@ }, { "Idx": "GaugeTimeUp", - "ScriptText": "손님들의 기다림 시간 3초 증가", + "ScriptText": "손님들의 기다림 시간이 3초 증가합니다.", "Max": 5, "Ratio": 5, "Type": 0, @@ -208,7 +208,7 @@ }, { "Idx": "BarrelAutoSupply", - "ScriptText": "모든 술 재료 자동 충천 (1초에 N리터)", + "ScriptText": "모든 술 재료를 초당 2ml 추가로 자동 충전합니다.", "Max": 10, "Ratio": 5, "Type": 0, @@ -217,7 +217,7 @@ }, { "Idx": "ServerNpcUpgrade", - "ScriptText": "서빙 종업원 업그레이드 (팁 획득 비율 증가)", + "ScriptText": "종업원이 서빙 중 팁 획득량이 20% 증가합니다.", "Max": 5, "Ratio": 5, "Type": 0, @@ -226,7 +226,7 @@ }, { "Idx": "CleanerNpcUpgrade", - "ScriptText": "청소 종업원 업그레이드 (청소 속도 증가)", + "ScriptText": "종업원의 청소 시간이 1초 감소합니다.", "Max": 5, "Ratio": 5, "Type": 0, @@ -235,7 +235,7 @@ }, { "Idx": "BartenderNpcUpgrade", - "ScriptText": "바텐터 종업원 업그레이드 (술 제조 속도 증가)", + "ScriptText": "종업원의 술 제조 속도가 1초 감소합니다.", "Max": 5, "Ratio": 5, "Type": 0, @@ -243,8 +243,8 @@ "Price": 300 }, { - "Idx": "DoubleServing", - "ScriptText": "플레이어가 양손에 서빙 가능", + "Idx": "PassiveDoubleServing", + "ScriptText": "플레이어가 양손에 서빙이 가능해집니다.", "Max": 1, "Ratio": 2, "Type": 1, @@ -252,8 +252,8 @@ "Price": 1000 }, { - "Idx": "RandomChange", - "ScriptText": "휴지통을 랜덤 제조통으로 변경", + "Idx": "PassiveRandomChange", + "ScriptText": "특정 휴지통에서 완성된 칵테일 중 랜덤으로 변경 가능해집니다.", "Max": 1, "Ratio": 2, "Type": 1, @@ -261,8 +261,8 @@ "Price": 1000 }, { - "Idx": "GoldAutoGain", - "ScriptText": "자동으로 60초마다 돈통의 골드 회수", + "Idx": "PassiveGoldAutoGain", + "ScriptText": "자동으로 60초마다 계산대의 골드를 회수합니다.", "Max": 1, "Ratio": 2, "Type": 1, @@ -271,7 +271,7 @@ }, { "Idx": "PassiveMakingBonus", - "ScriptText": "술 제조 성공 시 골드 추가 획득", + "ScriptText": "플레이어가 술 제조 성공 시 팁 획득량만큼 추가로 골드를 획득합니다.", "Max": 1, "Ratio": 2, "Type": 1, @@ -280,7 +280,7 @@ }, { "Idx": "PassiveServingBonus", - "ScriptText": "서빙 3번 성공 시 하트 반개 회복", + "ScriptText": "플레이어가 서빙을 3번 성공할 때마다 하트를 반 개 회복합니다.", "Max": 1, "Ratio": 2, "Type": 1, @@ -289,7 +289,7 @@ }, { "Idx": "PassiveCleaningBonus", - "ScriptText": "청소 5번 성공 시 바텐더 제조 속도 증가", + "ScriptText": "플레이어가 청소를 5번 성공할 때마다 새로 제작되는 종업원의 술 제조 속도를 10초간 2배로 증가합니다.", "Max": 1, "Ratio": 2, "Type": 1, diff --git a/Packages/manifest.json b/Packages/manifest.json index 46054476f..cdc188c3d 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -13,6 +13,7 @@ "com.unity.feature.development": "1.0.2", "com.unity.feature.worldbuilding": "1.0.1", "com.unity.inputsystem": "1.9.0", + "com.unity.localization": "1.5.3", "com.unity.nuget.newtonsoft-json": "3.2.1", "com.unity.postprocessing": "3.4.0", "com.unity.recorder": "5.1.1", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index de5964ddd..88b1d53d9 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -199,6 +199,21 @@ }, "url": "https://packages.unity.com" }, + "com.unity.addressables": { + "version": "2.2.2", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.profiling.core": "1.0.2", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.scriptablebuildpipeline": "2.1.4", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.bindings.openimageio": { "version": "1.0.0", "depth": 1, @@ -336,6 +351,16 @@ }, "url": "https://packages.unity.com" }, + "com.unity.localization": { + "version": "1.5.3", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.addressables": "1.22.2", + "com.unity.nuget.newtonsoft-json": "3.0.2" + }, + "url": "https://packages.unity.com" + }, "com.unity.mathematics": { "version": "1.3.2", "depth": 2, @@ -394,6 +419,13 @@ }, "url": "https://packages.unity.com" }, + "com.unity.profiling.core": { + "version": "1.0.2", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.recorder": { "version": "5.1.1", "depth": 0, @@ -448,6 +480,13 @@ "com.unity.modules.terrain": "1.0.0" } }, + "com.unity.scriptablebuildpipeline": { + "version": "2.1.4", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.searcher": { "version": "4.9.2", "depth": 2, diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 0844088fb..e66e1f503 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -12,6 +12,8 @@ EditorBuildSettings: path: Assets/01.Scenes/01.Tycoon.unity guid: b2b07a151b44ee849a1d12d9dc5bc87a m_configObjects: + com.unity.addressableassets: {fileID: 11400000, guid: f03eb8afe743ba2408eba2f226d4915f, type: 2} com.unity.input.settings: {fileID: 11400000, guid: c779df660591ce64c983341df1e4c85c, type: 2} com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3} + com.unity.localization.settings: {fileID: 11400000, guid: 112e4950c7d9b7a429feb9bb058a93a7, type: 2} m_UseUCBPForAssetBundles: 0