From f76256d49d0f70e79f2a658728d52a84d9487e14 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Fri, 11 Jul 2025 14:48:49 +0900 Subject: [PATCH] =?UTF-8?q?DDD-18=20=ED=94=8C=EB=A0=88=EC=9D=B4=EC=96=B4?= =?UTF-8?q?=20=EC=A1=B0=EC=9E=91=20=EB=B0=8F=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssetGroups/Group.asset | 29 +- .../States.meta => Addressables.meta} | 2 +- Assets/_DDD/Addressables/Sprites.meta | 8 + .../Addressables/Sprites/Items.spriteatlasv2 | 18 + .../Sprites/Items.spriteatlasv2.meta | 30 + Assets/_DDD/_Addressables/Prefabs.meta | 8 + .../Prefabs/CreateRestaurantPlayer.prefab | 47 + .../CreateRestaurantPlayer.prefab.meta | 7 + .../Prefabs}/RestaurantPlayer.prefab | 8 +- .../Prefabs}/RestaurantPlayer.prefab.meta | 0 .../_Addressables/Scenes/Restaurant.unity | 842 +----------------- Assets/_DDD/_Addressables/Scenes/Voyage.unity | 138 --- .../So/RestaurantPlayerDataSo.asset | 4 + .../Sprites => _Raw/Sprites/Items}/Gold.png | 0 .../Sprites/Items}/Gold.png.meta | 0 .../Sprites => _Raw/Sprites/Items}/Gold01.png | 0 .../Sprites/Items}/Gold01.png.meta | 0 .../_Scripts/AssetManagement/AssetManager.cs | 2 +- .../_Scripts/CameraSystem/CameraGameObject.cs | 12 +- .../_Scripts/CameraSystem/CameraManager.cs | 5 +- .../CameraSystem/CameraManager.prefab | 2 +- .../_Scripts/GameFlow/GameFlowAssetsSo.asset | 45 +- .../_DDD/_Scripts/GameFlow/GameFlowManager.cs | 58 +- .../_Scripts/GameFramework/FadeManager.cs | 54 ++ .../GameFramework/FadeManager.cs.meta | 2 + .../_Scripts/GameFramework/FadeManager.prefab | 206 +++++ .../GameFramework/FadeManager.prefab.meta | 7 + .../_Scripts/GameFramework/GameManager.cs | 2 - .../GameFramework/ManagerDefinitionSo.asset | 2 + .../_Scripts/GameFramework/SceneManager.cs | 11 +- .../BaseRestaurantCharacter.prefab | 95 ++ .../CreateRestaurantPlayer.cs | 26 + .../CreateRestaurantPlayer.cs.meta | 2 + .../Players/RestaurantPlayer/IStateMachine.cs | 9 - .../RestaurantPlayer/IStateMachine.cs.meta | 2 - .../RestaurantPlayer/PlayerStateMachine.cs | 19 - .../PlayerStateMachine.cs.meta | 2 - .../RestaurantPlayer/RestaurantPlayer.cs | 382 ++++---- .../RestaurantPlayer/RestaurantPlayerData.cs | 6 +- .../RestaurantPlayer/RestaurantPlayerView.cs | 114 +-- .../RestaurantPlayer/States/IdleState.cs | 32 - .../RestaurantPlayer/States/IdleState.cs.meta | 2 - .../RestaurantPlayer/States/WalkingState.cs | 32 - .../States/WalkingState.cs.meta | 2 - .../RestaurantCharacterAnimation.cs | 255 ++++++ .../RestaurantPlayerMovement.cs | 145 ++- .../RestaurantCharacter/SpineController.cs | 265 ------ .../SpineController.cs.meta | 2 - 48 files changed, 1303 insertions(+), 1638 deletions(-) rename Assets/_DDD/{_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States.meta => Addressables.meta} (77%) create mode 100644 Assets/_DDD/Addressables/Sprites.meta create mode 100644 Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2 create mode 100644 Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2.meta create mode 100644 Assets/_DDD/_Addressables/Prefabs.meta create mode 100644 Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab create mode 100644 Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab.meta rename Assets/_DDD/{_Scripts/RestaurantCharacter => _Addressables/Prefabs}/RestaurantPlayer.prefab (95%) rename Assets/_DDD/{_Scripts/RestaurantCharacter => _Addressables/Prefabs}/RestaurantPlayer.prefab.meta (100%) rename Assets/_DDD/{_Addressables/Sprites => _Raw/Sprites/Items}/Gold.png (100%) rename Assets/_DDD/{_Addressables/Sprites => _Raw/Sprites/Items}/Gold.png.meta (100%) rename Assets/_DDD/{_Addressables/Sprites => _Raw/Sprites/Items}/Gold01.png (100%) rename Assets/_DDD/{_Addressables/Sprites => _Raw/Sprites/Items}/Gold01.png.meta (100%) create mode 100644 Assets/_DDD/_Scripts/GameFramework/FadeManager.cs create mode 100644 Assets/_DDD/_Scripts/GameFramework/FadeManager.cs.meta create mode 100644 Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab create mode 100644 Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab.meta create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs.meta delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs.meta delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs.meta delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs.meta delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs.meta delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs delete mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs.meta diff --git a/Assets/AddressableAssetsData/AssetGroups/Group.asset b/Assets/AddressableAssetsData/AssetGroups/Group.asset index 3da310b14..b89effa02 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Group.asset @@ -15,29 +15,48 @@ MonoBehaviour: m_GroupName: Group m_GUID: 30e7f67fe9aaa7849a34c9b6e2bc53ae m_SerializeEntries: + - m_GUID: 1aad5f6adfc7c7d44b36ce007d3c0f1e + m_Address: Items + m_ReadOnly: 0 + m_SerializedLabels: + - Atlas + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 29dcda970aef9584d9b157e766b8a278 + m_Address: RestaurantPlayer + m_ReadOnly: 0 + m_SerializedLabels: + - Prefab + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 2eb88deceda8c443db7ec557aaef30af m_Address: Entry m_ReadOnly: 0 m_SerializedLabels: - Scene FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 4c9d045012b65fc4b974bb4e132e6e6a + m_Address: CreateRestaurantPlayer + m_ReadOnly: 0 + m_SerializedLabels: + - Prefab + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: a60e7a432b7eb65419f3942f4f422fb4 m_Address: Voyage m_ReadOnly: 0 m_SerializedLabels: - Scene FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: ddb0db863be8f254bb8a8f07d39a960e + m_Address: RestaurantPlayerDataSo + m_ReadOnly: 0 + m_SerializedLabels: + - So + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: de073d0136201ac4cbb36dbeb4b76fb2 m_Address: Restaurant m_ReadOnly: 0 m_SerializedLabels: - Scene FlaggedDuringContentUpdateRestriction: 0 - - m_GUID: e15933f76da90e742866563b5cd9e45f - m_Address: Gold - m_ReadOnly: 0 - m_SerializedLabels: [] - FlaggedDuringContentUpdateRestriction: 0 m_ReadOnly: 0 m_Settings: {fileID: 11400000, guid: d12ffbb6f886d48418efb0b6d15ccb88, type: 2} m_SchemaSet: diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States.meta b/Assets/_DDD/Addressables.meta similarity index 77% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States.meta rename to Assets/_DDD/Addressables.meta index 9e2c22289..30c25eb10 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States.meta +++ b/Assets/_DDD/Addressables.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ef03a607bdc3e914aad8e99ab5c6f91b +guid: 190b0dbdbdc29b2459a7d0eae707f531 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/_DDD/Addressables/Sprites.meta b/Assets/_DDD/Addressables/Sprites.meta new file mode 100644 index 000000000..7891908a4 --- /dev/null +++ b/Assets/_DDD/Addressables/Sprites.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba3a9fb25b878f647b1df9cfebb30f5b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2 b/Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2 new file mode 100644 index 000000000..23a8785da --- /dev/null +++ b/Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2 @@ -0,0 +1,18 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!612988286 &1 +SpriteAtlasAsset: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + serializedVersion: 2 + m_MasterAtlas: {fileID: 0} + m_ImporterData: + packables: + - {fileID: 21300000, guid: 189d780f1507008429f2cdd1a2b4c9e8, type: 3} + - {fileID: 21300000, guid: e15933f76da90e742866563b5cd9e45f, type: 3} + - {fileID: 21300000, guid: 0db84c35b16f34681b0309b33d8760fe, type: 3} + m_IsVariant: 0 + m_ScriptablePacker: {fileID: 0} diff --git a/Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2.meta b/Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2.meta new file mode 100644 index 000000000..9caef868b --- /dev/null +++ b/Assets/_DDD/Addressables/Sprites/Items.spriteatlasv2.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: b16c797aa0ede8947b35fd354145121e +SpriteAtlasImporter: + externalObjects: {} + textureSettings: + serializedVersion: 2 + anisoLevel: 0 + compressionQuality: 0 + maxTextureSize: 0 + textureCompression: 0 + filterMode: 1 + generateMipMaps: 0 + readable: 0 + crunchedCompression: 0 + sRGB: 1 + platformSettings: [] + packingSettings: + serializedVersion: 2 + padding: 4 + blockOffset: 0 + allowAlphaSplitting: 0 + enableRotation: 0 + enableTightPacking: 0 + enableAlphaDilation: 0 + secondaryTextureSettings: {} + variantMultiplier: 1 + bindAsDefault: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Addressables/Prefabs.meta b/Assets/_DDD/_Addressables/Prefabs.meta new file mode 100644 index 000000000..f05457645 --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31fdb3fac3e3a964f9e5bf1aa25158af +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab b/Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab new file mode 100644 index 000000000..6888b5adb --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5717669528680924896 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5172050782918397531} + - component: {fileID: 5336591719806944066} + m_Layer: 0 + m_Name: CreateRestaurantPlayer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5172050782918397531 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5717669528680924896} + 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: 1 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5336591719806944066 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5717669528680924896} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 246a7785bd15ac84b9f240005b987f1f, type: 3} + m_Name: + m_EditorClassIdentifier: + _spawnPosition: {x: 0, y: 0, z: 15} diff --git a/Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab.meta b/Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab.meta new file mode 100644 index 000000000..3124860d8 --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/CreateRestaurantPlayer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4c9d045012b65fc4b974bb4e132e6e6a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayer.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab similarity index 95% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayer.prefab rename to Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab index 47085849c..ca7f5ce53 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayer.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab @@ -52,6 +52,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3095965496140440094, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: _initialSkinName + value: Basic + objectReference: {fileID: 0} - target: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} propertyPath: m_Name value: RestaurantPlayer @@ -63,10 +67,10 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - insertIndex: 3 + insertIndex: 4 addedObject: {fileID: 4699468658517678862} - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - insertIndex: 4 + insertIndex: 5 addedObject: {fileID: 4956037093100801085} m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} --- !u!1 &7316134055819320434 stripped diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayer.prefab.meta b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayer.prefab.meta rename to Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab.meta diff --git a/Assets/_DDD/_Addressables/Scenes/Restaurant.unity b/Assets/_DDD/_Addressables/Scenes/Restaurant.unity index e213676bc..0cfc649ab 100644 --- a/Assets/_DDD/_Addressables/Scenes/Restaurant.unity +++ b/Assets/_DDD/_Addressables/Scenes/Restaurant.unity @@ -416,50 +416,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 04cb72fe661fd534b950283199ac4a83, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1 &121938432 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 121938434} - - component: {fileID: 121938433} - m_Layer: 0 - m_Name: Inventory - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &121938433 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 121938432} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6c667d81563204249aea17e2052c7e50, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!4 &121938434 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 121938432} - 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: 877873993} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &141274235 MonoBehaviour: m_ObjectHideFlags: 0 @@ -808,10 +764,10 @@ RectTransform: - {fileID: 1640982676} m_Father: {fileID: 1713185378} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 500, y: -100} + m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &296314362 MonoBehaviour: @@ -2014,7 +1970,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &788164720 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2246,8 +2202,7 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 - m_Children: - - {fileID: 121938434} + m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &883453358 @@ -2346,149 +2301,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 04cb72fe661fd534b950283199ac4a83, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1 &948964996 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 948964997} - - component: {fileID: 948965003} - - component: {fileID: 948965002} - - component: {fileID: 948965001} - - component: {fileID: 948965000} - m_Layer: 0 - m_Name: VisualLook - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &948964997 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 948964996} - serializedVersion: 2 - m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 968554881} - m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} ---- !u!114 &948965000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 948964996} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 04cb72fe661fd534b950283199ac4a83, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &948965001 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 948964996} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d247ba06193faa74d9335f5481b2b56c, type: 3} - m_Name: - m_EditorClassIdentifier: - skeletonDataAsset: {fileID: 11400000, guid: 57e95ec929c09d64c9f85a40f849786a, type: 2} - initialSkinName: Basic - fixPrefabOverrideViaMeshFilter: 2 - initialFlipX: 0 - initialFlipY: 0 - updateWhenInvisible: 3 - separatorSlotNames: [] - zSpacing: 0 - useClipping: 1 - immutableTriangles: 0 - pmaVertexColors: 1 - clearStateOnDisable: 0 - tintBlack: 0 - singleSubmesh: 0 - fixDrawOrder: 0 - addNormals: 0 - calculateTangents: 0 - maskInteraction: 0 - maskMaterials: - materialsMaskDisabled: [] - materialsInsideMask: [] - materialsOutsideMask: [] - disableRenderingOnOverride: 1 - physicsPositionInheritanceFactor: {x: 1, y: 1} - physicsRotationInheritanceFactor: 1 - physicsMovementRelativeTo: {fileID: 0} - updateTiming: 1 - unscaledTime: 0 - _animationName: - loop: 1 - timeScale: 1 ---- !u!23 &948965002 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 948964996} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RayTracingAccelStructBuildFlagsOverride: 0 - m_RayTracingAccelStructBuildFlags: 1 - m_SmallMeshCulling: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 288333d9c9df2d84cadf3b48d918ebdb, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 5 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &948965003 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 948964996} - m_Mesh: {fileID: 0} --- !u!114 &954313032 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2525,140 +2337,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 04cb72fe661fd534b950283199ac4a83, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1 &968554876 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 968554881} - - component: {fileID: 968554883} - - component: {fileID: 968554882} - - component: {fileID: 968554884} - - component: {fileID: 968554885} - - component: {fileID: 968554886} - m_Layer: 0 - m_Name: RestaurantPlayer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &968554881 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 968554876} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0, z: 15} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 948964997} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!136 &968554882 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 968554876} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.2 - m_Height: 0.1 - m_Direction: 1 - m_Center: {x: 0, y: 0.1, z: 0} ---- !u!54 &968554883 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 968554876} - serializedVersion: 5 - m_Mass: 1 - m_LinearDamping: 0 - m_AngularDamping: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 116 - m_CollisionDetection: 1 ---- !u!114 &968554884 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 968554876} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 620909d88f805ee4898b9af964a7f0e8, type: 3} - m_Name: - m_EditorClassIdentifier: - IsMoving: 0 - IsDashing: 0 - IsDashCoolDownActive: 0 ---- !u!114 &968554885 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 968554876} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c665f9c268555a74a8a805d67d09c80e, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &968554886 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 968554876} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 06e836de83eb924449235839869a147c, type: 3} - m_Name: - m_EditorClassIdentifier: - _originalMaterial: {fileID: 2100000, guid: 288333d9c9df2d84cadf3b48d918ebdb, type: 2} - _replacementMaterial: {fileID: 0} - _isSkinSet: 1 - _initialSkinName: Basic - _isRandomSkin: 0 - _isRandomRange: 0 - _randomRange: {x: 0, y: 0} - _randomStrings: [] --- !u!114 &985479691 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2726,7 +2404,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &1015166833 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5016,67 +4694,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 04cb72fe661fd534b950283199ac4a83, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1001 &1972254857 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 303053621953959099, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4059976348031579783, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_DefaultActionMap - value: df70fa95-8a34-4494-b137-73ab6b9c7d37 - objectReference: {fileID: 0} - - target: {fileID: 6312950592041400320, guid: f17834b768fb4724380bafc46049b63c, type: 3} - propertyPath: m_Name - value: KeyManager - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: f17834b768fb4724380bafc46049b63c, type: 3} --- !u!114 &1977940846 MonoBehaviour: m_ObjectHideFlags: 0 @@ -21913,27 +21530,6 @@ Transform: - {fileID: 7000665217524502242} m_Father: {fileID: 3192988027884070626} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1771319329464945910 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8954672182622810066} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 44, y: 0, z: 25} - m_Center: {x: 0, y: 0, z: 0} --- !u!1 &1771730087959953993 GameObject: m_ObjectHideFlags: 0 @@ -25361,23 +24957,6 @@ Transform: m_Children: [] m_Father: {fileID: 1920806406095033276} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2181005474682564920 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2845279302837869120} - - component: {fileID: 2297189639773934291} - m_Layer: 0 - m_Name: Grid Object Ghost - m_TagString: Untagged - m_Icon: {fileID: 2800000, guid: e03d6ecba68ab5d47ae39c20870a16e4, type: 3} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &2185030763711925164 Transform: m_ObjectHideFlags: 0 @@ -26475,21 +26054,6 @@ Light: m_LightUnit: 1 m_LuxAtDistance: 1 m_EnableSpotReflector: 1 ---- !u!114 &2297189639773934291 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2181005474682564920} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: aaa500fa45d76b34e9104974d8fab70c, type: 3} - m_Name: - m_EditorClassIdentifier: - ghostObjectLayer: - serializedVersion: 2 - m_Bits: 4 --- !u!65 &2297771402022871221 BoxCollider: m_ObjectHideFlags: 0 @@ -28748,25 +28312,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 5 m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &2621506066710331840 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4763878935355813204} - - component: {fileID: 4011341578346064693} - - component: {fileID: 7759589599513505956} - - component: {fileID: 5271584215083939538} - m_Layer: 0 - m_Name: Grid Manager - m_TagString: Untagged - m_Icon: {fileID: 2800000, guid: 24affbcac39faab4485a94d192e831c3, type: 3} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!23 &2622785348478663979 MeshRenderer: m_ObjectHideFlags: 0 @@ -31258,21 +30803,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!4 &2845279302837869120 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2181005474682564920} - 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: 4763878935355813204} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &2849913003786355722 Transform: m_ObjectHideFlags: 0 @@ -31819,23 +31349,6 @@ Transform: m_Children: [] m_Father: {fileID: 3211503303673724826} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &2917450759388136202 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2976630059373737899} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.5, y: 0, z: 15.700001} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4763878935355813204} - - {fileID: 3110541919575609766} - m_Father: {fileID: 7627145480117215977} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &2917543754014491348 Transform: m_ObjectHideFlags: 0 @@ -32241,22 +31754,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &2976630059373737899 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2917450759388136202} - m_Layer: 0 - m_Name: Grid - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!114 &2978385039024061897 MonoBehaviour: m_ObjectHideFlags: 0 @@ -33086,21 +32583,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &3110541919575609766 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8954672182622810066} - 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: 2917450759388136202} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &3110981711583394591 SpriteRenderer: m_ObjectHideFlags: 0 @@ -33462,21 +32944,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &3160715917071968891 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 9148521891413374300} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: eae0c4b8fc4979e4d8d83b276761c814, type: 3} - m_Name: - m_EditorClassIdentifier: - ghostObjectLayer: - serializedVersion: 2 - m_Bits: 4 --- !u!1 &3162414746202592844 GameObject: m_ObjectHideFlags: 0 @@ -40123,21 +39590,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &3926311914335318364 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 9148521891413374300} - 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: 4763878935355813204} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3926429089597874348 GameObject: m_ObjectHideFlags: 0 @@ -40631,24 +40083,6 @@ Transform: - {fileID: 3708059010181611848} m_Father: {fileID: 4499449394227042963} m_LocalEulerAnglesHint: {x: 30, y: 0, z: 0} ---- !u!114 &4011341578346064693 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2621506066710331840} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 10b87f85c07a35e4189b1698dff30c8e, type: 3} - m_Name: - m_EditorClassIdentifier: - mouseColliderLayerMask: - serializedVersion: 2 - m_Bits: 2147483648 - easyGridBuilderProList: [] - activeGridSystem: {fileID: 0} - onGrid: 0 --- !u!23 &4015136994482710094 MeshRenderer: m_ObjectHideFlags: 0 @@ -44556,120 +43990,6 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 0.5, y: 1, z: 0.2} m_Center: {x: 0, y: 0.5, z: 0.1} ---- !u!114 &4490920062285985167 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8954672182622810066} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 28061f5e303cbcf4e97fb0b9bef94f5f, type: 3} - m_Name: - m_EditorClassIdentifier: - gridEditorMode: 2 - buildableGridObjectTypeSOList: - - {fileID: 11400000, guid: db38344e6a3f47245936c7801e21da4a, type: 2} - - {fileID: 11400000, guid: 3ca29f507bc64be49b297cead4c98d9c, type: 2} - buildableEdgeObjectTypeSOList: [] - buildableFreeObjectTypeSOList: [] - gridAxis: 0 - gridWidth: 44 - gridLength: 25 - cellSize: 0.5 - gridOriginXZ: {x: -9.5, y: 0, z: 9.450001} - gridOriginXY: {x: -9.5, y: -6.25, z: 15.700001} - useHolderPositionAsOrigin: 1 - showVerticalGridData: 0 - verticalGridsCount: 1 - gridHeight: 2 - changeHeightWithInput: 1 - autoDetectHeight: 0 - autoDetectHeightLayerMask: - serializedVersion: 2 - m_Bits: 3221225473 - showBuildableDistanceData: 0 - useBuildableDistance: 0 - distanceCheckObject: {fileID: 0} - distanceMin: 0 - distanceMax: 50 - showGridObjectCollisionData: 0 - mouseColliderLayerMask: - serializedVersion: 2 - m_Bits: 2147483648 - freeObjectCollidingLayerMask: - serializedVersion: 2 - m_Bits: 3221225473 - colliderSizeMultiplier: 2 - lockColliderOnHeightChange: 0 - showCanvasGridData: 1 - showEditorAndRuntimeCanvasGrid: 0 - gridCanvasPrefab: {fileID: 7023326040891081457, guid: b008e2f959515844dac4c16b66bf9c2b, type: 3} - gridImageSprite: {fileID: 21300000, guid: 2eacf68fc32face47bf4335fb2cc57c1, type: 3} - showColor: {r: 0.6415094, g: 0.6415094, b: 0.6415094, a: 0.39215687} - hideColor: {r: 0.47058824, g: 0.47058824, b: 0.47058824, a: 0} - colorTransitionSpeed: 20 - showOnDefaultMode: 1 - showOnBuildMode: 1 - showOnDestructMode: 1 - showOnSelectedMode: 1 - lockCanvasGridOnHeightChange: 0 - showDebugGridData: 0 - showEditorAndRuntimeDebugGrid: 0 - editorGridLineColor: {r: 0.27802968, g: 1, b: 0, a: 1} - lockDebugGridOnHeightChange: 1 - showNodeGridData: 0 - showRuntimeNodeGrid: 0 - gridNodePrefab: - - {fileID: 7695809926237117888, guid: 7223ba8911998394d89308bd7b14aadd, type: 3} - - {fileID: 2555192278033704093, guid: 1e5873c3d2d49494395b19a5b78c1d35, type: 3} - - {fileID: 4722525440239903003, guid: 6107dac8e8a7bf74eb16182562da881d, type: 3} - gridNodeMarginPercentage: 95 - gridNodeLocalOffset: {x: 0, y: 0, z: 0} - showTextGridData: 0 - showRuntimeGridText: 0 - gridTextColor: {r: 0, g: 0, b: 0, a: 1} - gridTextSizeMultiplier: 1 - showCellValueText: 1 - gridTextPrefix: - gridTextSuffix: - gridTextLocalOffset: {x: 0, y: 0, z: 0} - showSaveAndLoadData: 0 - enableSaveAndLoad: 1 - uniqueSaveName: EasyGridBuilder_SaveData_ - saveLocation: /EasyGridBuilder Pro/LocalSaves/ - showConsoleText: 0 - showConsoleData: 0 - objectPlacement: 0 - objectDestruction: 0 - objectSelected: 0 - gridLevelChange: 0 - saveAndLoad: 1 - enableUnityEvents: 0 - showBaseEvent: 0 - OnSelectedBuildableChangedUnityEvent: - m_PersistentCalls: - m_Calls: [] - OnGridCellChangedUnityEvent: - m_PersistentCalls: - m_Calls: [] - OnActiveGridLevelChangedUnityEvent: - m_PersistentCalls: - m_Calls: [] - showObjectInteractEvents: 0 - OnObjectPlacedUnityEvent: - m_PersistentCalls: - m_Calls: [] - OnObjectRemovedUnityEvent: - m_PersistentCalls: - m_Calls: [] - OnObjectSelectedUnityEvent: - m_PersistentCalls: - m_Calls: [] - OnObjectDeselectedUnityEvent: - m_PersistentCalls: - m_Calls: [] --- !u!4 &4491378940361586220 Transform: m_ObjectHideFlags: 0 @@ -47049,24 +46369,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4763878935355813204 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2621506066710331840} - 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: - - {fileID: 2845279302837869120} - - {fileID: 3926311914335318364} - - {fileID: 7553054689557630467} - m_Father: {fileID: 2917450759388136202} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4764451847785976625 Transform: m_ObjectHideFlags: 0 @@ -51352,21 +50654,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &5271584215083939538 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2621506066710331840} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ce04da996a952774f9fcff585ac87ccd, type: 3} - m_Name: - m_EditorClassIdentifier: - _buildableGridObjectTypeSOList: [] - _buildableEdgeObjectTypeSOList: [] - _buildableFreeObjectTypeSOList: [] --- !u!1 &5275416401350183943 GameObject: m_ObjectHideFlags: 0 @@ -58760,8 +58047,8 @@ MonoBehaviour: m_StreamingVersion: 20241001 m_LegacyPriority: 0 Target: - TrackingTarget: {fileID: 968554881} - LookAtTarget: {fileID: 968554881} + TrackingTarget: {fileID: 0} + LookAtTarget: {fileID: 0} CustomLookAtTarget: 1 Lens: FieldOfView: 35 @@ -60315,20 +59602,6 @@ Transform: - {fileID: 6859274816566502181} m_Father: {fileID: 6482072525005805910} m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} ---- !u!114 &6263033593499020960 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7507660465387801097} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 419979f1ccdd2eb47a750a427788a53a, type: 3} - m_Name: - m_EditorClassIdentifier: - selectedObject: {fileID: 0} - deselectOnFalseSelect: 0 --- !u!1 &6265769743017788977 GameObject: m_ObjectHideFlags: 0 @@ -71001,18 +70274,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &7476665737616502578 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8954672182622810066} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 0} - m_Name: - m_EditorClassIdentifier: --- !u!114 &7478249416128488248 MonoBehaviour: m_ObjectHideFlags: 0 @@ -71152,23 +70413,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &7507660465387801097 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7553054689557630467} - - component: {fileID: 6263033593499020960} - m_Layer: 0 - m_Name: Grid Object Selector - m_TagString: Untagged - m_Icon: {fileID: 2800000, guid: 4dde9464ddb31d6489f80535002aa3e2, type: 3} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &7512157961536089909 Transform: m_ObjectHideFlags: 0 @@ -71431,21 +70675,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &7553054689557630467 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7507660465387801097} - 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: 4763878935355813204} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &7555376018348149457 MeshFilter: m_ObjectHideFlags: 0 @@ -72130,7 +71359,6 @@ Transform: - {fileID: 6020240437717891290} - {fileID: 6816504441442965616} - {fileID: 613465926699939291} - - {fileID: 2917450759388136202} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7632545107564320626 @@ -72944,20 +72172,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &7759589599513505956 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2621506066710331840} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 86635d7713df74b4d89c0ac4b1cb89f9, type: 3} - m_Name: - m_EditorClassIdentifier: - easyGridBuilderProInputsSO: {fileID: 11400000, guid: 747d9a1fc1b787747b790d7a3c2252a9, type: 2} - gridObjectSelector: {fileID: 6263033593499020960} --- !u!4 &7759967422652606161 Transform: m_ObjectHideFlags: 0 @@ -83673,25 +82887,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &8954672182622810066 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3110541919575609766} - - component: {fileID: 4490920062285985167} - - component: {fileID: 1771319329464945910} - - component: {fileID: 7476665737616502578} - m_Layer: 31 - m_Name: EGB Pro Grid XZ - m_TagString: Grid - m_Icon: {fileID: 2800000, guid: 7e4350e634f86ed4eb78f2b5857f4d89, type: 3} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &8954855718254133870 Transform: m_ObjectHideFlags: 0 @@ -85365,23 +84560,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 5 m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &9148521891413374300 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3926311914335318364} - - component: {fileID: 3160715917071968891} - m_Layer: 0 - m_Name: Free Object Ghost - m_TagString: Untagged - m_Icon: {fileID: 2800000, guid: e03d6ecba68ab5d47ae39c20870a16e4, type: 3} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &9151080317827763244 Transform: m_ObjectHideFlags: 0 @@ -85939,13 +85117,11 @@ SceneRoots: m_Roots: - {fileID: 1041959416} - {fileID: 45031421} - - {fileID: 1972254857} - {fileID: 1804444097} - {fileID: 5280945432206803416} - {fileID: 1625822452} - {fileID: 1932987510} - {fileID: 877873993} - {fileID: 575217084} - - {fileID: 968554881} - {fileID: 7627145480117215977} - {fileID: 1785845839} diff --git a/Assets/_DDD/_Addressables/Scenes/Voyage.unity b/Assets/_DDD/_Addressables/Scenes/Voyage.unity index 8e24aa376..be4be430e 100644 --- a/Assets/_DDD/_Addressables/Scenes/Voyage.unity +++ b/Assets/_DDD/_Addressables/Scenes/Voyage.unity @@ -240,146 +240,8 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &961739749 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 961739753} - - component: {fileID: 961739752} - - component: {fileID: 961739751} - - component: {fileID: 961739750} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &961739750 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 961739749} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_VolumeFrameworkUpdateModeOption: 2 - m_RenderPostProcessing: 0 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_AllowXRRendering: 1 - m_AllowHDROutput: 1 - m_UseScreenCoordOverride: 0 - m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} - m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 - m_TaaSettings: - m_Quality: 3 - m_FrameInfluence: 0.1 - m_JitterScale: 1 - m_MipBias: 0 - m_VarianceClampScale: 0.9 - m_ContrastAdaptiveSharpening: 0 ---- !u!81 &961739751 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 961739749} - m_Enabled: 1 ---- !u!20 &961739752 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 961739749} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_Iso: 200 - m_ShutterSpeed: 0.005 - m_Aperture: 16 - m_FocusDistance: 10 - m_FocalLength: 50 - m_BladeCount: 5 - m_Curvature: {x: 2, y: 11} - m_BarrelClipping: 0.25 - m_Anamorphism: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &961739753 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 961739749} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - 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!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 961739753} - {fileID: 203844589} diff --git a/Assets/_DDD/_Addressables/So/RestaurantPlayerDataSo.asset b/Assets/_DDD/_Addressables/So/RestaurantPlayerDataSo.asset index 9ab4b53f0..7ecc3f51d 100644 --- a/Assets/_DDD/_Addressables/So/RestaurantPlayerDataSo.asset +++ b/Assets/_DDD/_Addressables/So/RestaurantPlayerDataSo.asset @@ -18,3 +18,7 @@ MonoBehaviour: DashSpeed: 20 DashTime: 0.2 DashCooldown: 0.5 + WalkingSfxName: + DashSfxName: + MoveActionReference: {fileID: -1680190386980627800, guid: 052faaac586de48259a63d0c4782560b, type: 3} + DashActionReference: {fileID: -8150158440837788775, guid: 052faaac586de48259a63d0c4782560b, type: 3} diff --git a/Assets/_DDD/_Addressables/Sprites/Gold.png b/Assets/_DDD/_Raw/Sprites/Items/Gold.png similarity index 100% rename from Assets/_DDD/_Addressables/Sprites/Gold.png rename to Assets/_DDD/_Raw/Sprites/Items/Gold.png diff --git a/Assets/_DDD/_Addressables/Sprites/Gold.png.meta b/Assets/_DDD/_Raw/Sprites/Items/Gold.png.meta similarity index 100% rename from Assets/_DDD/_Addressables/Sprites/Gold.png.meta rename to Assets/_DDD/_Raw/Sprites/Items/Gold.png.meta diff --git a/Assets/_DDD/_Addressables/Sprites/Gold01.png b/Assets/_DDD/_Raw/Sprites/Items/Gold01.png similarity index 100% rename from Assets/_DDD/_Addressables/Sprites/Gold01.png rename to Assets/_DDD/_Raw/Sprites/Items/Gold01.png diff --git a/Assets/_DDD/_Addressables/Sprites/Gold01.png.meta b/Assets/_DDD/_Raw/Sprites/Items/Gold01.png.meta similarity index 100% rename from Assets/_DDD/_Addressables/Sprites/Gold01.png.meta rename to Assets/_DDD/_Raw/Sprites/Items/Gold01.png.meta diff --git a/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs b/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs index edf4ddecb..680148187 100644 --- a/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs +++ b/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs @@ -25,7 +25,7 @@ public async void PostInit() } catch (Exception e) { - Debug.Assert(false, "Addressables initialization failed"); + Debug.Assert(false, $"Addressables initialization failed\n{e}"); } } diff --git a/Assets/_DDD/_Scripts/CameraSystem/CameraGameObject.cs b/Assets/_DDD/_Scripts/CameraSystem/CameraGameObject.cs index 25fb47207..44484f659 100644 --- a/Assets/_DDD/_Scripts/CameraSystem/CameraGameObject.cs +++ b/Assets/_DDD/_Scripts/CameraSystem/CameraGameObject.cs @@ -22,10 +22,20 @@ private void Start() private void OnDestroy() { - CameraManager.Instance.UnRegisterCamera(this); + if (CameraManager.Instance) + { + CameraManager.Instance.UnRegisterCamera(this); + } } public int GetPriority() => _cinemachineCamera.Priority; public void SetPriority(int newPriority) => _cinemachineCamera.Priority = newPriority; + public void SetFollowTarget(Transform target) => _cinemachineCamera.Follow = target; + public void SetLookAtTarget(Transform target) => _cinemachineCamera.LookAt = target; + public void SetFollowAndLookAtTarget(Transform target) + { + SetFollowTarget(target); + SetLookAtTarget(target); + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/CameraSystem/CameraManager.cs b/Assets/_DDD/_Scripts/CameraSystem/CameraManager.cs index 271e7d645..33dd4de1a 100644 --- a/Assets/_DDD/_Scripts/CameraSystem/CameraManager.cs +++ b/Assets/_DDD/_Scripts/CameraSystem/CameraManager.cs @@ -7,13 +7,12 @@ namespace DDD public class CameraManager : Singleton, IManager { [ShowInInspector, ReadOnly] - private Dictionary _cameraGameObjects; + private Dictionary _cameraGameObjects = new(); private CinemachineBrain _cinemachineBrain; public void Init() { - _cameraGameObjects = new Dictionary(); _cinemachineBrain = GetComponent(); } @@ -41,5 +40,7 @@ public void SwitchCamera(CameraGameObject cameraGameObject, CinemachineBlendDefi item.Value.SetPriority(newPriority); } } + + public CameraGameObject GetCameraGameObject(string id) => _cameraGameObjects[id]; } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/CameraSystem/CameraManager.prefab b/Assets/_DDD/_Scripts/CameraSystem/CameraManager.prefab index 8fde022d3..f1e6d992a 100644 --- a/Assets/_DDD/_Scripts/CameraSystem/CameraManager.prefab +++ b/Assets/_DDD/_Scripts/CameraSystem/CameraManager.prefab @@ -45,7 +45,7 @@ Camera: m_GameObject: {fileID: 7292682221138498026} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 2 + m_ClearFlags: 1 m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowAssetsSo.asset b/Assets/_DDD/_Scripts/GameFlow/GameFlowAssetsSo.asset index e68c2d6c5..091263bb5 100644 --- a/Assets/_DDD/_Scripts/GameFlow/GameFlowAssetsSo.asset +++ b/Assets/_DDD/_Scripts/GameFlow/GameFlowAssetsSo.asset @@ -56,7 +56,50 @@ MonoBehaviour: Data: 1 - Name: Entry: 12 - Data: 0 + Data: 1 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 3 + Data: 1 + - Name: $v + Entry: 7 + Data: 3|System.Collections.Generic.List`1[[UnityEngine.AddressableAssets.AssetReference, + Unity.Addressables]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 4|UnityEngine.AddressableAssets.AssetReference, Unity.Addressables + - Name: m_AssetGUID + Entry: 1 + Data: 4c9d045012b65fc4b974bb4e132e6e6a + - Name: m_SubObjectName + Entry: 6 + Data: + - Name: m_SubObjectType + Entry: 6 + Data: + - Name: m_SubObjectGUID + Entry: 1 + Data: + - Name: m_EditorAssetChanged + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs b/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs index ebc24fd2f..6ad63d9ca 100644 --- a/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs +++ b/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs @@ -2,8 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; -using UnityEngine.ResourceManagement.ResourceProviders; -using UnityEngine.SceneManagement; +using UnityEngine.AddressableAssets; namespace DDD { @@ -23,7 +22,7 @@ public class GameFlowManager : Singleton, IManager public void Init() { - + GameFlowDataSo.CurrentGameState = GameFlowState.None; } public async void PostInit() @@ -42,7 +41,7 @@ public async void PostInit() } } - public bool IsGameStarted() => GameFlowDataSo.CurrentGameState != GameFlowState.None; + private bool IsGameStarted() => GameFlowDataSo.CurrentGameState != GameFlowState.None; public async Task ChangeFlow(GameFlowState newFlowState) { @@ -62,33 +61,38 @@ private bool CanChangeFlow(GameFlowState newFlowState) return true; } - public void EndCurrentFlow() + private void EndCurrentFlow() { } - public async Task ReadyNewFlow(GameFlowState newFlowState) + private async Task ReadyNewFlow(GameFlowState newFlowState) { + GameFlowDataSo.CurrentGameState = newFlowState; + if (GameFlowAssetsSo.FlowItems.TryGetValue(newFlowState, out var stringKeys)) { - List> loadTasks = new(stringKeys.Count); foreach (var key in stringKeys) { - loadTasks.Add(AssetManager.LoadAsset(key)); + await AssetManager.LoadAsset(key); } - - await Task.WhenAll(loadTasks); } if (GameFlowAssetsSo.FlowAssets.TryGetValue(newFlowState, out var assetRefs)) { - List> loadTasks = new(assetRefs.Count); foreach (var assetRef in assetRefs) { - loadTasks.Add(AssetManager.LoadAsset(assetRef)); + var obj = await AssetManager.LoadAsset(assetRef); + + if (obj is GameObject prefab) + { + Instantiate(prefab); + } + else + { + Debug.LogWarning($"[ReadyNewFlow] Not a GameObject: {assetRef.RuntimeKey}"); + } } - - await Task.WhenAll(loadTasks); } OpenFlowScene(newFlowState); @@ -96,26 +100,36 @@ public async Task ReadyNewFlow(GameFlowState newFlowState) StartFlow(); } - public void OpenFlowScene(GameFlowState newFlowState) + private async void OpenFlowScene(GameFlowState newFlowState) { - if (GetFlowScene(newFlowState, out var sceneToLoad)) + try { - SceneManager.Instance.ActivateScene(sceneToLoad); + if (GetFlowScene(newFlowState, out var sceneToLoad)) + { + await FadeManager.Instance.FadeOut(); + SceneManager.Instance.ActivateScene(sceneToLoad); + await Task.Delay(1000); + await FadeManager.Instance.FadeIn(); + } + else + { + Debug.Assert(false, "Scene not found!"); + } } - else + catch (Exception e) { - Debug.Assert(false, "Scene not found!"); + Debug.LogError(e.Message); } } - public bool GetFlowScene(GameFlowState flowState, out SceneType sceneType) + private bool GetFlowScene(GameFlowState flowState, out SceneType sceneType) { return GameFlowSceneMappingSo.FlowToSceneMapping.TryGetValue(flowState, out sceneType); } - public void StartFlow() + private void StartFlow() { - // Broadcast new flow started + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/FadeManager.cs b/Assets/_DDD/_Scripts/GameFramework/FadeManager.cs new file mode 100644 index 000000000..ff7a3f6b8 --- /dev/null +++ b/Assets/_DDD/_Scripts/GameFramework/FadeManager.cs @@ -0,0 +1,54 @@ +using System.Threading.Tasks; +using DG.Tweening; +using UnityEngine; + +namespace DDD +{ + public class FadeManager : Singleton, IManager + { + [SerializeField] + private float _fadeOutDuration = 0.5f; + + [SerializeField] + private float _fadeInDuration = 1f; + + private CanvasGroup _canvasGroup; + + public void Init() + { + _canvasGroup = GetComponent(); + } + + public void PostInit() + { + _canvasGroup.alpha = 0f; + _canvasGroup.gameObject.SetActive(false); + } + + public async Task FadeOut() + { + _canvasGroup.gameObject.SetActive(true); + _canvasGroup.blocksRaycasts = true; + + await _canvasGroup.DOFade(1f, _fadeOutDuration) + .SetUpdate(true) + .AsyncWaitForCompletion(); + } + + public async Task FadeIn() + { + await _canvasGroup.DOFade(0f, _fadeInDuration) + .SetUpdate(true) + .AsyncWaitForCompletion(); + + _canvasGroup.blocksRaycasts = false; + _canvasGroup.gameObject.SetActive(false); + } + + public async Task FadeOutIn() + { + await FadeOut(); + await FadeIn(); + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/FadeManager.cs.meta b/Assets/_DDD/_Scripts/GameFramework/FadeManager.cs.meta new file mode 100644 index 000000000..8c526c9c7 --- /dev/null +++ b/Assets/_DDD/_Scripts/GameFramework/FadeManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 41f0ee0aabb2f954d918caa8d484f646 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab b/Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab new file mode 100644 index 000000000..69f67755e --- /dev/null +++ b/Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab @@ -0,0 +1,206 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &645007492175346922 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8625885928614466139} + - component: {fileID: 5533625503660040844} + - component: {fileID: 2068856588424138268} + - component: {fileID: 827366504865157138} + - component: {fileID: 8205940526588409056} + - component: {fileID: 5136368050551183548} + m_Layer: 5 + m_Name: FadeManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8625885928614466139 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 645007492175346922} + 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: 1 + m_Children: + - {fileID: 2840604718763097518} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &5533625503660040844 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 645007492175346922} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 6 + m_TargetDisplay: 0 +--- !u!114 &2068856588424138268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 645007492175346922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &827366504865157138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 645007492175346922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 55 +--- !u!225 &8205940526588409056 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 645007492175346922} + m_Enabled: 1 + m_Alpha: 0 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &5136368050551183548 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 645007492175346922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 41f0ee0aabb2f954d918caa8d484f646, type: 3} + m_Name: + m_EditorClassIdentifier: + _persistent: 1 +--- !u!1 &6954525544416039378 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2840604718763097518} + - component: {fileID: 8274624108829164416} + - component: {fileID: 4134486114940038904} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2840604718763097518 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6954525544416039378} + 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: [] + m_Father: {fileID: 8625885928614466139} + 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!222 &8274624108829164416 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6954525544416039378} + m_CullTransparentMesh: 1 +--- !u!114 &4134486114940038904 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6954525544416039378} + 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: 0, g: 0, b: 0, 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 diff --git a/Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab.meta b/Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab.meta new file mode 100644 index 000000000..64474a920 --- /dev/null +++ b/Assets/_DDD/_Scripts/GameFramework/FadeManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0aa6654feb91ef040b8b99d4f64688fc +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/GameFramework/GameManager.cs b/Assets/_DDD/_Scripts/GameFramework/GameManager.cs index 56b288405..cf3b1ceff 100644 --- a/Assets/_DDD/_Scripts/GameFramework/GameManager.cs +++ b/Assets/_DDD/_Scripts/GameFramework/GameManager.cs @@ -20,7 +20,6 @@ protected void Start() return; } - // Entry Scene에서 뭘 해야할까? // 매니저 초기화 _managerInstances = new List(_managerDefinitionSo.ManagerClasses.Count); @@ -42,7 +41,6 @@ protected void Start() manager.PostInit(); } } - // 초기 씬으로 보내주기 } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.asset b/Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.asset index 24ae09132..1786b61ce 100644 --- a/Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.asset +++ b/Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.asset @@ -17,3 +17,5 @@ MonoBehaviour: - {fileID: 4889131746858770208, guid: d90fdb17f0162334daadc6fc93e9a0e3, type: 3} - {fileID: 6471498998539637564, guid: fa2ad62c75b1549f09597e47ed5f7cfb, type: 3} - {fileID: 7665229218737596710, guid: 71b177c2a18314c588da30429451666a, type: 3} + - {fileID: 622422277636247943, guid: d95124918e5a4a246abb0d378b14d3fa, type: 3} + - {fileID: 5136368050551183548, guid: 0aa6654feb91ef040b8b99d4f64688fc, type: 3} diff --git a/Assets/_DDD/_Scripts/GameFramework/SceneManager.cs b/Assets/_DDD/_Scripts/GameFramework/SceneManager.cs index 3bb19f9ad..78a7f7e84 100644 --- a/Assets/_DDD/_Scripts/GameFramework/SceneManager.cs +++ b/Assets/_DDD/_Scripts/GameFramework/SceneManager.cs @@ -35,16 +35,7 @@ public async void PostInit() { if (sceneType == SceneType.Entry) continue; - var sceneInstance = await AssetManager.LoadScene(sceneType.ToString()); - if (sceneInstance.Scene.IsValid()) - { - _loadedScenes[sceneType] = sceneInstance; - - foreach (var go in sceneInstance.Scene.GetRootGameObjects()) - { - go.SetActive(false); - } - } + await PreloadSceneAsync(sceneType); } } catch (Exception e) diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/BaseRestaurantCharacter.prefab b/Assets/_DDD/_Scripts/RestaurantCharacter/BaseRestaurantCharacter.prefab index b28ee57a8..3b974c2fe 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/BaseRestaurantCharacter.prefab +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/BaseRestaurantCharacter.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 1761643478070701343} - component: {fileID: 5176902543201676162} - component: {fileID: 5246526151924390639} + - component: {fileID: 8352859907019760819} - component: {fileID: 3365694194251356714} - component: {fileID: 127430239903465757} - component: {fileID: 3095965496140440094} @@ -87,6 +88,92 @@ CapsuleCollider: m_Height: 0.1 m_Direction: 1 m_Center: {x: 0, y: 0.1, z: 0} +--- !u!114 &8352859907019760819 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5259510642736920361} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} + m_NotificationBehavior: 2 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 351f2ccd-1f9f-44bf-9bec-d62ac5c5f408 + m_ActionName: 'Restaurant/Move[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 6c2ab1b8-8984-453a-af3d-a3c78ae1679a + m_ActionName: 'Restaurant/Attack[/Mouse/leftButton,/Keyboard/enter]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: f1e71b7e-271b-4382-876a-260ea451296a + m_ActionName: 'Restaurant/Dash[/Keyboard/space]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 852140f2-7766-474d-8707-702459ba45f3 + m_ActionName: 'Restaurant/Interact[/Keyboard/e]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: c95b2375-e6d9-4b88-9c4c-c5e76515df4b + m_ActionName: 'Ui/Navigate[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 7607c7b6-cd76-4816-beef-bd0341cfe950 + m_ActionName: 'Ui/Submit[/Keyboard/enter]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 15cef263-9014-4fd5-94d9-4e4a6234a6ef + m_ActionName: 'Ui/Cancel[/Keyboard/escape]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 32b35790-4ed0-4e9a-aa41-69ac6d629449 + m_ActionName: 'Ui/Point[/Mouse/position]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 3c7022bf-7922-4f7c-a998-c437916075ad + m_ActionName: 'Ui/Click[/Mouse/leftButton]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 44b200b1-1557-4083-816c-b22cbdf77ddf + m_ActionName: 'Ui/RightClick[/Mouse/rightButton]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: dad70c86-b58c-4b17-88ad-f5e53adf419e + m_ActionName: 'Ui/MiddleClick[/Mouse/middleButton]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 0489e84a-4833-4c40-bfae-cea84b696689 + m_ActionName: 'Ui/ScrollWheel[/Mouse/scroll]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 24908448-c609-4bc3-a128-ea258674378a + m_ActionName: Ui/TrackedDevicePosition + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be + m_ActionName: Ui/TrackedDeviceOrientation + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: Restaurant + m_SplitScreenIndex: -1 + m_Camera: {fileID: 0} --- !u!114 &3365694194251356714 MonoBehaviour: m_ObjectHideFlags: 0 @@ -123,6 +210,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e20368314a3139f4fb4b4e35af9fcf98, type: 3} m_Name: m_EditorClassIdentifier: + _originalMaterial: {fileID: 0} + _replacementMaterial: {fileID: 0} + _isSkinSet: 1 + _initialSkinName: default + _isRandomSkin: 0 + _isRandomRange: 0 + _randomRange: {x: 0, y: 0} + _randomStrings: [] --- !u!1 &6791841979869644848 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs new file mode 100644 index 000000000..d1f62385d --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs @@ -0,0 +1,26 @@ +using System; +using UnityEngine; + +namespace DDD +{ + public class CreateRestaurantPlayer : MonoBehaviour + { + [SerializeField] + private Vector3 _spawnPosition; + + private async void Start() + { + try + { + var playerPrefab = await AssetManager.LoadAsset("RestaurantPlayer"); + var player = Instantiate(playerPrefab, _spawnPosition, playerPrefab.transform.rotation); + player.name = "RestaurantPlayer"; + CameraManager.Instance.GetCameraGameObject("RestaurantBaseCamera").SetFollowAndLookAtTarget(player.transform); + } + catch (Exception e) + { + Debug.LogError($"Create player failed\n{e.Message}"); + } + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs.meta new file mode 100644 index 000000000..8013e8ac6 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 246a7785bd15ac84b9f240005b987f1f \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs deleted file mode 100644 index 61b6b1e85..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace DDD -{ - public interface IStateMachine - { - void Enter(); - void Update(); - void Exit(); - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs.meta deleted file mode 100644 index f27309a77..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/IStateMachine.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: c111bfa40d649ac4c9d401efa650734d \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs deleted file mode 100644 index 2b091c37a..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace DDD -{ - public class PlayerStateMachine - { - private IStateMachine _currentStateMachine; - - public void ChangeState(IStateMachine newStateMachine) - { - _currentStateMachine?.Exit(); - _currentStateMachine = newStateMachine; - _currentStateMachine.Enter(); - } - - public void Update() - { - _currentStateMachine?.Update(); - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs.meta deleted file mode 100644 index 10753e2e7..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/PlayerStateMachine.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 2887dac388e7a244585d84329954e38f \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayer.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayer.cs index 040ffcb4f..2e748c3f5 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayer.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayer.cs @@ -1,191 +1,191 @@ -using System.Collections; -using UnityEngine; -using UnityEngine.AddressableAssets; -using UnityEngine.InputSystem; -using UnityEngine.Serialization; - -namespace DDD -{ - public class RestaurantPlayer : MonoBehaviour - { - #region Variables - - private RestaurantPlayerDataSo _playerData; - private RestaurantPlayerView _playerView; - - private InputAction _moveAction; - private InputAction _dashAction; - private Coroutine _dashInstance; - - private Vector3 _inputDirection; - private Vector3 _currentDirection = Vector3.back; - - public bool IsMoving; - public bool IsDashing; - public bool IsDashCoolDownActive; - - private float _finalSpeed; - - private PlayerStateMachine _stateMachine; - - #endregion - - // Unity events - - #region Unity events - - private void Awake() - { - _playerData = Addressables.LoadAssetAsync("RestaurantPlayerDataSo").WaitForCompletion(); - _playerView = GetComponent(); - } - - private void Start() - { - _moveAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Move)); - _dashAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Dash)); - - _moveAction.performed += OnMove; - _moveAction.canceled += OnMove; - _dashAction.performed += OnDash; - - _stateMachine = new PlayerStateMachine(); - ChangeState(new IdleState(this, _playerView)); - } - - //public CellManager cellManager; - private void Update() - { - _stateMachine.Update(); - - FlipVisualLook(); - - //UpdateCell - //cellManager.SetupCell(transform.position); - } - - private void FixedUpdate() - { - if (!CanMove()) return; - - Move(); - } - - private void OnDestroy() - { - _moveAction.performed -= OnMove; - _moveAction.canceled -= OnMove; - _dashAction.performed -= OnDash; - } - - #endregion - - // Methods - #region Methods - - public void SetCurrentDirection(Vector3 normalDirection) - { - if (normalDirection == Vector3.zero) return; - - _currentDirection = normalDirection; - } - - private void FlipVisualLook() - { - Vector3 localScale = _playerView.GetLocalScale(); - localScale.x = _currentDirection.x switch - { - > 0.01f => -Mathf.Abs(localScale.x), - < -0.01f => Mathf.Abs(localScale.x), - _ => localScale.x - }; - _playerView.SetLocalScale(localScale); - } - - public void OnMove(InputAction.CallbackContext context) - { - var movementInput = _moveAction.ReadValue(); - _inputDirection = new Vector3(movementInput.x, 0, movementInput.y).normalized; - } - - public bool CanMove() - { - return _playerData.IsMoveEnabled && !IsDashing; - } - - public void Move() - { - SetCurrentDirection(_inputDirection); - IsMoving = _inputDirection != Vector3.zero; - - var finalVelocity = _inputDirection * _playerData.MoveSpeed; - _playerView.SetVelocity(finalVelocity); - } - - public void OnDash(InputAction.CallbackContext context) - { - if (!CanDash()) return; - - Dash(); - } - - public bool CanDash() - { - return _playerData.IsDashEnabled && !IsDashing && !IsDashCoolDownActive; - } - - public void Dash() - { - Utils.StartUniqueCoroutine(this, ref _dashInstance, DashCoroutine()); - } - - private IEnumerator DashCoroutine() - { - IsDashing = true; - IsDashCoolDownActive = true; - _playerView.PlayDashParticle(); - - AudioManager.Instance.PlaySfx(_playerData.DashSfxName); - - var dashDirection = _inputDirection; - if (dashDirection == Vector3.zero) - { - dashDirection = _currentDirection; - } - - var elapsedTime = 0f; - while (elapsedTime <= _playerData.DashTime) - { - var finalVelocity = dashDirection * _playerData.DashSpeed; - _playerView.SetVelocity(finalVelocity); - - elapsedTime += Time.fixedDeltaTime; - yield return new WaitForFixedUpdate(); - } - - EndDash(_playerData.DashCooldown); - } - - public void EndDash(float dashCooldown = float.PositiveInfinity) - { - Utils.EndUniqueCoroutine(this, ref _dashInstance); - _playerView.SetVelocity(Vector3.zero); - IsDashing = false; - - if (float.IsPositiveInfinity(dashCooldown)) - { - dashCooldown = _playerData.DashCooldown; - } - - // TODO : ui 연동 - StartCoroutine(Utils.CoolDownCoroutine(dashCooldown, () => IsDashCoolDownActive = false)); - } - - public void ChangeState(IStateMachine stateMachine) - { - _stateMachine.ChangeState(stateMachine); - } - - #endregion - } -} \ No newline at end of file +// using System.Collections; +// using UnityEngine; +// using UnityEngine.AddressableAssets; +// using UnityEngine.InputSystem; +// using UnityEngine.Serialization; +// +// namespace DDD +// { +// public class RestaurantPlayer : MonoBehaviour +// { +// #region Variables +// +// private RestaurantPlayerDataSo _playerData; +// private RestaurantPlayerView _playerView; +// +// private InputAction _moveAction; +// private InputAction _dashAction; +// private Coroutine _dashInstance; +// +// private Vector3 _inputDirection; +// private Vector3 _currentDirection = Vector3.back; +// +// public bool IsMoving; +// public bool IsDashing; +// public bool IsDashCoolDownActive; +// +// private float _finalSpeed; +// +// private PlayerStateMachine _stateMachine; +// +// #endregion +// +// // Unity events +// +// #region Unity events +// +// private void Awake() +// { +// _playerData = Addressables.LoadAssetAsync("RestaurantPlayerDataSo").WaitForCompletion(); +// _playerView = GetComponent(); +// } +// +// private void Start() +// { +// _moveAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Move)); +// _dashAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Dash)); +// +// _moveAction.performed += OnMove; +// _moveAction.canceled += OnMove; +// _dashAction.performed += OnDash; +// +// _stateMachine = new PlayerStateMachine(); +// ChangeState(new IdleState(this, _playerView)); +// } +// +// //public CellManager cellManager; +// private void Update() +// { +// _stateMachine.Update(); +// +// FlipVisualLook(); +// +// //UpdateCell +// //cellManager.SetupCell(transform.position); +// } +// +// private void FixedUpdate() +// { +// if (!CanMove()) return; +// +// Move(); +// } +// +// private void OnDestroy() +// { +// _moveAction.performed -= OnMove; +// _moveAction.canceled -= OnMove; +// _dashAction.performed -= OnDash; +// } +// +// #endregion +// +// // Methods +// #region Methods +// +// public void SetCurrentDirection(Vector3 normalDirection) +// { +// if (normalDirection == Vector3.zero) return; +// +// _currentDirection = normalDirection; +// } +// +// private void FlipVisualLook() +// { +// Vector3 localScale = _playerView.GetLocalScale(); +// localScale.x = _currentDirection.x switch +// { +// > 0.01f => -Mathf.Abs(localScale.x), +// < -0.01f => Mathf.Abs(localScale.x), +// _ => localScale.x +// }; +// _playerView.SetLocalScale(localScale); +// } +// +// public void OnMove(InputAction.CallbackContext context) +// { +// var movementInput = _moveAction.ReadValue(); +// _inputDirection = new Vector3(movementInput.x, 0, movementInput.y).normalized; +// } +// +// public bool CanMove() +// { +// return _playerData.IsMoveEnabled && !IsDashing; +// } +// +// public void Move() +// { +// SetCurrentDirection(_inputDirection); +// IsMoving = _inputDirection != Vector3.zero; +// +// var finalVelocity = _inputDirection * _playerData.MoveSpeed; +// _playerView.SetVelocity(finalVelocity); +// } +// +// public void OnDash(InputAction.CallbackContext context) +// { +// if (!CanDash()) return; +// +// Dash(); +// } +// +// public bool CanDash() +// { +// return _playerData.IsDashEnabled && !IsDashing && !IsDashCoolDownActive; +// } +// +// public void Dash() +// { +// Utils.StartUniqueCoroutine(this, ref _dashInstance, DashCoroutine()); +// } +// +// private IEnumerator DashCoroutine() +// { +// IsDashing = true; +// IsDashCoolDownActive = true; +// _playerView.PlayDashParticle(); +// +// AudioManager.Instance.PlaySfx(_playerData.DashSfxName); +// +// var dashDirection = _inputDirection; +// if (dashDirection == Vector3.zero) +// { +// dashDirection = _currentDirection; +// } +// +// var elapsedTime = 0f; +// while (elapsedTime <= _playerData.DashTime) +// { +// var finalVelocity = dashDirection * _playerData.DashSpeed; +// _playerView.SetVelocity(finalVelocity); +// +// elapsedTime += Time.fixedDeltaTime; +// yield return new WaitForFixedUpdate(); +// } +// +// EndDash(_playerData.DashCooldown); +// } +// +// public void EndDash(float dashCooldown = float.PositiveInfinity) +// { +// Utils.EndUniqueCoroutine(this, ref _dashInstance); +// _playerView.SetVelocity(Vector3.zero); +// IsDashing = false; +// +// if (float.IsPositiveInfinity(dashCooldown)) +// { +// dashCooldown = _playerData.DashCooldown; +// } +// +// // TODO : ui 연동 +// StartCoroutine(Utils.CoolDownCoroutine(dashCooldown, () => IsDashCoolDownActive = false)); +// } +// +// public void ChangeState(IStateMachine stateMachine) +// { +// _stateMachine.ChangeState(stateMachine); +// } +// +// #endregion +// } +// } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerData.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerData.cs index 7e701bdb2..7a9e804d7 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerData.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerData.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.InputSystem; using UnityEngine.Serialization; namespace DDD @@ -12,9 +13,12 @@ public class RestaurantPlayerDataSo : ScriptableObject public bool IsDashEnabled = true; public float DashSpeed = 20f; public float DashTime = 0.2f; - public float DashCooldown = 0.5f; + public float DashCooldown = 2f; public string WalkingSfxName; public string DashSfxName; + + public InputActionReference MoveActionReference; + public InputActionReference DashActionReference; } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerView.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerView.cs index 4763694ef..def822db5 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerView.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/RestaurantPlayerView.cs @@ -1,57 +1,57 @@ -using Spine; -using UnityEngine; - -namespace DDD -{ - public static class RestaurantSpineAnimation - { - public const string Idle = "Idle"; - public const string Walking = "RunFast"; - public const string ServingIdle = "Serving/ServingIdle"; - public const string Serving = "Serving/ServingFast"; - public const string Dash = "Dash"; - public const string CleaningFloor = "Cleaning/CleaningFloor"; - public const string CleaningTable = "Cleaning/CleaningTable"; - public const string MakingCocktail = "BeerMaker"; - public const string Pumping = "Attack/AttackWhip"; - public const string AttackSlime = "Attack/AttackSlime"; - public const string AttackLimeTree = "Attack/AttackBat"; - public const string CookingFried = "Cooking/CookingFried"; - public const string CookingStew = "Cooking/CookingStew"; - } - - public class RestaurantPlayerView : MonoBehaviour - { - private Rigidbody _rigidbody; - private Transform _visualLook; - private SpineController _spineController; - - private ParticleSystem _dashParticle; - - private void Awake() - { - _rigidbody = GetComponent(); - _visualLook = transform.Find("VisualLook"); - _spineController = GetComponent(); - } - - public void SetVelocity(Vector3 velocity) => _rigidbody.linearVelocity = velocity; - public Vector3 GetLocalScale() => _visualLook.localScale; - public void SetLocalScale(Vector3 localScale) => _visualLook.localScale = localScale; - - public void PlayDashParticle() - { - if (_dashParticle) - { - _dashParticle.Play(); - } - } - - public TrackEntry PlayAnimation(string animationName, bool isLoopActive, float speed = 1f, bool isReverse = false, int trackIndex = 0) - => _spineController.PlayAnimation(animationName, isLoopActive, speed, isReverse, trackIndex); - public TrackEntry PlayAnimationDuration(string animationName, bool isLoopActive, float duration, bool isReverse = false, int trackIndex = 0) => - _spineController.PlayAnimationDuration(animationName, isLoopActive, duration, isReverse, trackIndex); - public TrackEntry AddAnimation(string animationName, bool isLoopActive, int trackIndex = 0) - => _spineController.AddAnimation(animationName, isLoopActive, trackIndex); - } -} \ No newline at end of file +// using Spine; +// using UnityEngine; +// +// namespace DDD +// { +// public static class RestaurantSpineAnimation +// { +// public const string Idle = "Idle"; +// public const string Walking = "RunFast"; +// public const string ServingIdle = "Serving/ServingIdle"; +// public const string Serving = "Serving/ServingFast"; +// public const string Dash = "Dash"; +// public const string CleaningFloor = "Cleaning/CleaningFloor"; +// public const string CleaningTable = "Cleaning/CleaningTable"; +// public const string MakingCocktail = "BeerMaker"; +// public const string Pumping = "Attack/AttackWhip"; +// public const string AttackSlime = "Attack/AttackSlime"; +// public const string AttackLimeTree = "Attack/AttackBat"; +// public const string CookingFried = "Cooking/CookingFried"; +// public const string CookingStew = "Cooking/CookingStew"; +// } +// +// public class RestaurantPlayerView : MonoBehaviour +// { +// private Rigidbody _rigidbody; +// private Transform _visualLook; +// private SpineController _spineController; +// +// private ParticleSystem _dashParticle; +// +// private void Awake() +// { +// _rigidbody = GetComponent(); +// _visualLook = transform.Find("VisualLook"); +// _spineController = GetComponent(); +// } +// +// public void SetVelocity(Vector3 velocity) => _rigidbody.linearVelocity = velocity; +// public Vector3 GetLocalScale() => _visualLook.localScale; +// public void SetLocalScale(Vector3 localScale) => _visualLook.localScale = localScale; +// +// public void PlayDashParticle() +// { +// if (_dashParticle) +// { +// _dashParticle.Play(); +// } +// } +// +// public TrackEntry PlayAnimation(string animationName, bool isLoopActive, float speed = 1f, bool isReverse = false, int trackIndex = 0) +// => _spineController.PlayAnimation(animationName, isLoopActive, speed, isReverse, trackIndex); +// public TrackEntry PlayAnimationDuration(string animationName, bool isLoopActive, float duration, bool isReverse = false, int trackIndex = 0) => +// _spineController.PlayAnimationDuration(animationName, isLoopActive, duration, isReverse, trackIndex); +// public TrackEntry AddAnimation(string animationName, bool isLoopActive, int trackIndex = 0) +// => _spineController.AddAnimation(animationName, isLoopActive, trackIndex); +// } +// } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs deleted file mode 100644 index 76053badf..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace DDD -{ - public class IdleState : IStateMachine - { - private RestaurantPlayer _player; - private RestaurantPlayerView _view; - - public IdleState(RestaurantPlayer player, RestaurantPlayerView view) - { - _player = player; - _view = view; - } - - public void Enter() - { - _view.PlayAnimation(RestaurantSpineAnimation.Idle, true); - } - - public void Update() - { - if (_player.IsMoving) - { - _player.ChangeState(new WalkingState(_player, _view)); - } - } - - public void Exit() - { - - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs.meta deleted file mode 100644 index 4877fd7c5..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/IdleState.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 8dd7a1f24d102af41848ae82fb8f8ca5 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs deleted file mode 100644 index 67beef702..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace DDD -{ - public class WalkingState : IStateMachine - { - private RestaurantPlayer _player; - private RestaurantPlayerView _view; - - public WalkingState(RestaurantPlayer player, RestaurantPlayerView view) - { - _player = player; - _view = view; - } - - public void Enter() - { - _view.PlayAnimation(RestaurantSpineAnimation.Walking, true); - } - - public void Update() - { - if (!_player.IsMoving) - { - _player.ChangeState(new IdleState(_player, _view)); - } - } - - public void Exit() - { - - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs.meta deleted file mode 100644 index 63ca6ff02..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Players/RestaurantPlayer/States/WalkingState.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 08926e2ade87cab459e625851316b00c diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterAnimation.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterAnimation.cs index 30f1645b9..b32361fa0 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterAnimation.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterAnimation.cs @@ -1,9 +1,264 @@ +using System.Collections.Generic; +using Sirenix.OdinInspector; +using Spine; +using Spine.Unity; using UnityEngine; +using AnimationState = Spine.AnimationState; namespace DDD { public class RestaurantCharacterAnimation : MonoBehaviour { + // Variables + #region Variables + private SkeletonAnimation _skeletonAnimation; + + [SerializeField, ReadOnly] + private Material _originalMaterial; + + [SerializeField] + private Material _replacementMaterial; + + private AnimationState _animationState; + + // Variables + [SerializeField] + private bool _isSkinSet = true; + + [SerializeField, ShowIf("@_isSkinSet && !_isRandomSkin")] + private string _initialSkinName = "default"; + + [SerializeField, ShowIf("@_isSkinSet")] + private bool _isRandomSkin; + + [SerializeField, ShowIf("@_isSkinSet && _isRandomSkin")] + private bool _isRandomRange; + + [SerializeField, ShowIf("@_isSkinSet && _isRandomSkin && _isRandomRange"), Tooltip("x <= 값 < y")] + private Vector2 _randomRange; + + [SerializeField, ShowIf("@_isSkinSet && _isRandomSkin && !_isRandomRange")] + private List _randomStrings; + + private bool _customMaterialEnabled; + + #endregion + + // Unity events + #region Unity events + + private void Reset() + { + InitializeComponents(); + } + + private void Awake() + { + InitializeComponents(); + + if (!_isSkinSet) return; + + if (_isRandomSkin) + { + if (_isRandomRange) + { + SetRandomSkin(); + } + else + { + SetRandomStringListSkin(); + } + } + else + { + SetSkin(_initialSkinName); + } + } + + #endregion + + // Initialize methods + #region Initialize methods + + private void InitializeComponents() + { + _skeletonAnimation = transform.GetComponentInChildren(); + if (!_originalMaterial) + { + _originalMaterial = _skeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial; + } + + _animationState = _skeletonAnimation.AnimationState; + } + + #endregion + + // Methods + #region Methods + + /// 스파인 애니메이션 이름 + /// 반복 여부 + /// 애니메이션 속도 양수값 + /// true인 경우 자동으로 speed에 음수값(-1)을 넣음 + /// + /// + public TrackEntry PlayAnimation(string animationName, bool isLoopActive, float speed = 1f, bool isReverse = false, int trackIndex = 0) + { + if (!_skeletonAnimation || _animationState == null) return null; + + if (string.IsNullOrEmpty(animationName)) + { + Debug.LogError($"{animationName}의 애니메이션은 존재하지 않습니다."); + return null; + } + + // 중복 체크 + var currentTrackEntry = _animationState.GetCurrent(trackIndex); + if (currentTrackEntry != null && currentTrackEntry.Animation.Name == animationName) + { + return currentTrackEntry; + } + + _animationState.TimeScale = isReverse ? -Mathf.Abs(speed) : Mathf.Abs(speed); + var trackEntry = _animationState.SetAnimation(trackIndex, animationName, isLoopActive); + + if (isReverse) + { + trackEntry.TrackTime = trackEntry.AnimationEnd; + } + + return trackEntry; + } + + public TrackEntry PlayAnimationDuration(string animationName, bool isLoopActive, float duration, bool isReverse = false, int trackIndex = 0) + { + if (!_skeletonAnimation || _animationState == null) return null; + + if (string.IsNullOrEmpty(animationName)) + { + Debug.LogError($"{animationName}의 애니메이션은 존재하지 않습니다."); + return null; + } + + // 중복 체크 + var currentTrackEntry = _animationState.GetCurrent(trackIndex); + if (currentTrackEntry != null && currentTrackEntry.Animation.Name == animationName) + { + return currentTrackEntry; + } + + var findAnimation = _skeletonAnimation.Skeleton.Data.FindAnimation(animationName); + if (findAnimation == null) + { + Debug.LogError($"{animationName} 애니메이션을 찾을 수 없습니다."); + return null; + } + + var speed = findAnimation.Duration / duration; + _animationState.TimeScale = isReverse ? -Mathf.Abs(speed) : Mathf.Abs(speed); + var trackEntry = _animationState.SetAnimation(trackIndex, animationName, isLoopActive); + + if (isReverse) + { + trackEntry.TrackTime = trackEntry.AnimationEnd; + } + + return trackEntry; + } + + public TrackEntry AddAnimation(string animationName, bool isLoopActive, int trackIndex = 0) + { + if (!_skeletonAnimation || _animationState == null) return null; + + if (string.IsNullOrEmpty(animationName)) + { + Debug.LogError($"{animationName} 애니메이션은 존재하지 않습니다."); + return null; + } + + var trackEntry = _animationState.AddAnimation(trackIndex, animationName, isLoopActive, 0); + + return trackEntry; + } + + public string GetCurrentSkin() + { + if (_skeletonAnimation == null) return null; + + return _skeletonAnimation.Skeleton.Skin.ToString(); + } + + public void SetSkin(string skinName) + { + if (_skeletonAnimation == null && _animationState == null) return; + + if (string.IsNullOrEmpty(skinName)) + { + Debug.LogError($"{skinName}의 스킨 이름은 존재하지 않습니다."); + return; + } + + _skeletonAnimation.Skeleton.SetSkin(skinName); + _skeletonAnimation.Skeleton.SetSlotsToSetupPose(); + _animationState.Apply(_skeletonAnimation.Skeleton); + } + + public void SetRandomSkin() + { + if (_skeletonAnimation == null || _skeletonAnimation.Skeleton == null) return; + + var skins = _skeletonAnimation.skeleton.Data.Skins; + var randomSkin = Random.Range((int)_randomRange.x, (int)_randomRange.y); + var randomSkinName = skins.Items[randomSkin].Name; + SetSkin(randomSkinName); + } + + public void SetRandomStringListSkin() + { + if (_skeletonAnimation == null || _skeletonAnimation.Skeleton == null) return; + + if (_randomStrings == null || _randomStrings.Count <= 0) + { + Debug.LogError("_randomStrings 설정 오류"); + return; + } + + var randomSkin = Random.Range(0, _randomStrings.Count); + var randomSkinName = _randomStrings[randomSkin]; + SetSkin(randomSkinName); + } + + public void EnableCustomMaterial() + { + if (_customMaterialEnabled) return; + + _skeletonAnimation.CustomMaterialOverride[_originalMaterial] = _replacementMaterial; + _customMaterialEnabled = true; + } + + public void DisableCustomMaterial() + { + if (!_customMaterialEnabled) return; + + _skeletonAnimation.CustomMaterialOverride.Remove(_originalMaterial); + _customMaterialEnabled = false; + } + + public bool IsAnimationComplete(int trackIndex = 0) + { + if (!_skeletonAnimation || _animationState == null) return false; + + var currentTrackEntry = _animationState.GetCurrent(trackIndex); + if (currentTrackEntry == null) + { + Debug.LogWarning($"트랙 {trackIndex}에서 재생 중인 애니메이션이 없습니다."); + return false; + } + + return currentTrackEntry.IsComplete; + } + + #endregion } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs index 9d4df4ba4..d51695151 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs @@ -1,11 +1,150 @@ +using System; +using System.Collections; using UnityEngine; +using UnityEngine.InputSystem; namespace DDD { public class RestaurantPlayerMovement : RestaurantCharacterMovement { - // TODO : TryMove // 인풋에 등록할 함수 - // TODO : CanMove // Check IMovementConstraint - // TODO : Move // 실제 트랜스레이션, 슬라이딩, 충돌 + private Rigidbody _rigidbody; + private RestaurantCharacterAnimation _animation; + private Transform _visualLook; + + private RestaurantPlayerDataSo _playerData; + + private Vector3 _inputDirection; + private Vector3 _currentDirection; + private bool _isMoving; + private bool _isDashing; + private bool _isDashCooldown; + private bool _isInitialized; + + private void Awake() + { + _rigidbody = GetComponent(); + _animation = GetComponent(); + _visualLook = transform.Find("VisualLook"); + } + + private async void Start() + { + try + { + _playerData = await AssetManager.LoadAsset("RestaurantPlayerDataSo"); + + _playerData.MoveActionReference.action.performed += OnMove; + _playerData.MoveActionReference.action.canceled += OnMove; + _playerData.DashActionReference.action.performed += OnDash; + + _isInitialized = true; + } + catch (Exception e) + { + Debug.LogError($"_playerData load failed\n{e}"); + } + } + + private void Update() + { + if (_isInitialized == false) return; + + FlipVisualLook(); + } + + private void FixedUpdate() + { + if (_isInitialized == false) return; + + if (CanMove()) + { + Move(); + } + } + + private void OnDestroy() + { + if (_playerData) + { + _playerData.MoveActionReference.action.performed -= OnMove; + _playerData.MoveActionReference.action.canceled -= OnMove; + _playerData.DashActionReference.action.performed -= OnDash; + } + } + + public void SetCurrentDirection(Vector3 normalDirection) + { + if (_inputDirection == Vector3.zero) return; + + _currentDirection = normalDirection; + } + + private void FlipVisualLook() + { + Vector3 localScale = _visualLook.localScale; + localScale.x = _currentDirection.x switch + { + > 0.01f => -Mathf.Abs(localScale.x), + < -0.01f => Mathf.Abs(localScale.x), + _ => localScale.x + }; + _visualLook.localScale = localScale; + } + + private void OnMove(InputAction.CallbackContext context) + { + Vector2 movementInput = context.ReadValue(); + _inputDirection = new Vector3(movementInput.x, 0f, movementInput.y); + } + + private bool CanMove() + { + return _playerData.IsMoveEnabled && _isDashing == false; + } + + private void Move() + { + SetCurrentDirection(_inputDirection); + + _isMoving = _inputDirection != Vector3.zero; + string animationName = _isMoving ? "RunFast" : "Idle"; + _animation.PlayAnimation(animationName, true); + + Vector3 finalVelocity = _inputDirection * _playerData.MoveSpeed; + _rigidbody.linearVelocity = finalVelocity; + } + + private void OnDash(InputAction.CallbackContext context) + { + if (CanDash()) + { + StartCoroutine(DashCoroutine()); + } + } + + private bool CanDash() + { + return _playerData.IsDashEnabled && _isDashing == false && _isDashCooldown == false; + } + + private IEnumerator DashCoroutine() + { + // TODO : ui생기면 연동 + + _isDashing = true; + _isDashCooldown = true; + + _animation.PlayAnimationDuration("Dash", false, _playerData.DashTime); + + Vector3 dashVelocity = _currentDirection.normalized * _playerData.DashSpeed; + _rigidbody.linearVelocity = dashVelocity; + + yield return new WaitForSeconds(_playerData.DashTime); + + _isDashing = false; + + yield return new WaitForSeconds(_playerData.DashCooldown); + _isDashCooldown = false; + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs deleted file mode 100644 index a2266389c..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs +++ /dev/null @@ -1,265 +0,0 @@ -using System.Collections.Generic; -using Sirenix.OdinInspector; -using Spine; -using Spine.Unity; -using UnityEngine; -using AnimationState = Spine.AnimationState; -using Random = UnityEngine.Random; - -namespace DDD -{ - public class SpineController : MonoBehaviour - { - // Variables - #region Variables - - private SkeletonAnimation _skeletonAnimation; - - [SerializeField, ReadOnly] - private Material _originalMaterial; - - [SerializeField] - private Material _replacementMaterial; - - private AnimationState _animationState; - - // Variables - [SerializeField] - private bool _isSkinSet = true; - - [SerializeField, ShowIf("@_isSkinSet && !_isRandomSkin")] - private string _initialSkinName = "default"; - - [SerializeField, ShowIf("@_isSkinSet")] - private bool _isRandomSkin; - - [SerializeField, ShowIf("@_isSkinSet && _isRandomSkin")] - private bool _isRandomRange; - - [SerializeField, ShowIf("@_isSkinSet && _isRandomSkin && _isRandomRange"), Tooltip("x <= 값 < y")] - private Vector2 _randomRange; - - [SerializeField, ShowIf("@_isSkinSet && _isRandomSkin && !_isRandomRange")] - private List _randomStrings; - - private bool _customMaterialEnabled; - - #endregion - - // Unity events - #region Unity events - - private void Reset() - { - InitializeComponents(); - } - - private void Awake() - { - InitializeComponents(); - - if (!_isSkinSet) return; - - if (_isRandomSkin) - { - if (_isRandomRange) - { - SetRandomSkin(); - } - else - { - SetRandomStringListSkin(); - } - } - else - { - SetSkin(_initialSkinName); - } - } - - #endregion - - // Initialize methods - #region Initialize methods - - private void InitializeComponents() - { - _skeletonAnimation = transform.GetComponentInChildren(); - if (!_originalMaterial) - { - _originalMaterial = _skeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial; - } - - _animationState = _skeletonAnimation.AnimationState; - } - - #endregion - - // Methods - #region Methods - - /// 스파인 애니메이션 이름 - /// 반복 여부 - /// 애니메이션 속도 양수값 - /// true인 경우 자동으로 speed에 음수값(-1)을 넣음 - /// - /// - public TrackEntry PlayAnimation(string animationName, bool isLoopActive, float speed = 1f, bool isReverse = false, int trackIndex = 0) - { - if (!_skeletonAnimation || _animationState == null) return null; - - if (string.IsNullOrEmpty(animationName)) - { - Debug.LogError($"{animationName}의 애니메이션은 존재하지 않습니다."); - return null; - } - - // 중복 체크 - var currentTrackEntry = _animationState.GetCurrent(trackIndex); - if (currentTrackEntry != null && currentTrackEntry.Animation.Name == animationName) - { - return currentTrackEntry; - } - - _animationState.TimeScale = isReverse ? -Mathf.Abs(speed) : Mathf.Abs(speed); - var trackEntry = _animationState.SetAnimation(trackIndex, animationName, isLoopActive); - - if (isReverse) - { - trackEntry.TrackTime = trackEntry.AnimationEnd; - } - - return trackEntry; - } - - public TrackEntry PlayAnimationDuration(string animationName, bool isLoopActive, float duration, bool isReverse = false, int trackIndex = 0) - { - if (!_skeletonAnimation || _animationState == null) return null; - - if (string.IsNullOrEmpty(animationName)) - { - Debug.LogError($"{animationName}의 애니메이션은 존재하지 않습니다."); - return null; - } - - // 중복 체크 - var currentTrackEntry = _animationState.GetCurrent(trackIndex); - if (currentTrackEntry != null && currentTrackEntry.Animation.Name == animationName) - { - return currentTrackEntry; - } - - var findAnimation = _skeletonAnimation.Skeleton.Data.FindAnimation(animationName); - if (findAnimation == null) - { - Debug.LogError($"{animationName} 애니메이션을 찾을 수 없습니다."); - return null; - } - - var speed = findAnimation.Duration / duration; - _animationState.TimeScale = isReverse ? -Mathf.Abs(speed) : Mathf.Abs(speed); - var trackEntry = _animationState.SetAnimation(trackIndex, animationName, isLoopActive); - - if (isReverse) - { - trackEntry.TrackTime = trackEntry.AnimationEnd; - } - - return trackEntry; - } - - public TrackEntry AddAnimation(string animationName, bool isLoopActive, int trackIndex = 0) - { - if (!_skeletonAnimation || _animationState == null) return null; - - if (string.IsNullOrEmpty(animationName)) - { - Debug.LogError($"{animationName} 애니메이션은 존재하지 않습니다."); - return null; - } - - var trackEntry = _animationState.AddAnimation(trackIndex, animationName, isLoopActive, 0); - - return trackEntry; - } - - public string GetCurrentSkin() - { - if (_skeletonAnimation == null) return null; - - return _skeletonAnimation.Skeleton.Skin.ToString(); - } - - public void SetSkin(string skinName) - { - if (_skeletonAnimation == null && _animationState == null) return; - - if (string.IsNullOrEmpty(skinName)) - { - Debug.LogError($"{skinName}의 스킨 이름은 존재하지 않습니다."); - return; - } - - _skeletonAnimation.Skeleton.SetSkin(skinName); - _skeletonAnimation.Skeleton.SetSlotsToSetupPose(); - _animationState.Apply(_skeletonAnimation.Skeleton); - } - - public void SetRandomSkin() - { - if (_skeletonAnimation == null || _skeletonAnimation.Skeleton == null) return; - - var skins = _skeletonAnimation.skeleton.Data.Skins; - var randomSkin = Random.Range((int)_randomRange.x, (int)_randomRange.y); - var randomSkinName = skins.Items[randomSkin].Name; - SetSkin(randomSkinName); - } - - public void SetRandomStringListSkin() - { - if (_skeletonAnimation == null || _skeletonAnimation.Skeleton == null) return; - - if (_randomStrings == null || _randomStrings.Count <= 0) - { - Debug.LogError("_randomStrings 설정 오류"); - return; - } - - var randomSkin = Random.Range(0, _randomStrings.Count); - var randomSkinName = _randomStrings[randomSkin]; - SetSkin(randomSkinName); - } - - public void EnableCustomMaterial() - { - if (_customMaterialEnabled) return; - - _skeletonAnimation.CustomMaterialOverride[_originalMaterial] = _replacementMaterial; - _customMaterialEnabled = true; - } - - public void DisableCustomMaterial() - { - if (!_customMaterialEnabled) return; - - _skeletonAnimation.CustomMaterialOverride.Remove(_originalMaterial); - _customMaterialEnabled = false; - } - - public bool IsAnimationComplete(int trackIndex = 0) - { - if (!_skeletonAnimation || _animationState == null) return false; - - var currentTrackEntry = _animationState.GetCurrent(trackIndex); - if (currentTrackEntry == null) - { - Debug.LogWarning($"트랙 {trackIndex}에서 재생 중인 애니메이션이 없습니다."); - return false; - } - - return currentTrackEntry.IsComplete; - } - - #endregion - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs.meta deleted file mode 100644 index 5243159ce..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/SpineController.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 06e836de83eb924449235839869a147c \ No newline at end of file