diff --git a/Assets/Fonts/Kenney Future Narrow SDF.asset b/Assets/Fonts/Kenney Future Narrow SDF.asset index 4f1a2f4b..ceff2abb 100644 --- a/Assets/Fonts/Kenney Future Narrow SDF.asset +++ b/Assets/Fonts/Kenney Future Narrow SDF.asset @@ -2588,7 +2588,7 @@ Material: - _OutlineSoftness: 0 - _OutlineUVSpeedX: 0 - _OutlineUVSpeedY: 0 - - _OutlineWidth: 0 + - _OutlineWidth: 0.369 - _PerspectiveFilter: 0.875 - _Reflectivity: 10 - _ScaleRatioA: 0.8333333 diff --git a/Assets/Fonts/Kenney Future SDF.asset b/Assets/Fonts/Kenney Future SDF.asset index 8491bef2..a89b18c3 100644 --- a/Assets/Fonts/Kenney Future SDF.asset +++ b/Assets/Fonts/Kenney Future SDF.asset @@ -2548,7 +2548,7 @@ Material: - _OutlineSoftness: 0 - _OutlineUVSpeedX: 0 - _OutlineUVSpeedY: 0 - - _OutlineWidth: 0 + - _OutlineWidth: 0.146 - _PerspectiveFilter: 0.875 - _Reflectivity: 10 - _ScaleRatioA: 0.8333333 diff --git a/Assets/Prefabs/UI/Canvas - UI Service.prefab b/Assets/Prefabs/UI/Canvas - UI Service.prefab index ab2bb5ce..80b20d41 100644 --- a/Assets/Prefabs/UI/Canvas - UI Service.prefab +++ b/Assets/Prefabs/UI/Canvas - UI Service.prefab @@ -170,19 +170,19 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 507616692} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 1284288943} + m_Father: {fileID: 5948548988649794740} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -200} - m_SizeDelta: {x: 1000, y: 100} - m_Pivot: {x: 0.5, y: 1} + 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 &507616695 CanvasRenderer: m_ObjectHideFlags: 0 @@ -220,8 +220,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4278229759 - m_fontColor: {r: 1, g: 0.6030545, b: 0, a: 1} + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -346,7 +346,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Play Again + m_text: REPLAY m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 3903a38b3d48bee4c92a7b8ca11adaf5, type: 2} m_sharedMaterial: {fileID: 6717880067552513708, guid: 3903a38b3d48bee4c92a7b8ca11adaf5, type: 2} @@ -355,8 +355,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4278238463 - m_fontColor: {r: 1, g: 0.7387329, b: 0, a: 1} + rgba: 4291608144 + m_fontColor: {r: 0.3137255, g: 0.74509805, b: 0.8000001, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -373,12 +373,12 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 32 - m_fontSizeBase: 32 + m_fontSize: 45 + m_fontSizeBase: 45 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_fontSizeMax: 37 m_fontStyle: 0 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 @@ -477,15 +477,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.4745098, g: 0.74509805, b: 0.46666667, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: d45b71806613f4b47a9d5bced162d2a7, type: 3} - m_Type: 0 + m_Sprite: {fileID: 21300000, guid: 2f18eb2179a049a49bf764c40b51412e, type: 3} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -768,8 +768,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4278238463 - m_fontColor: {r: 1, g: 0.7387329, b: 0, a: 1} + rgba: 4285229780 + m_fontColor: {r: 0.8313726, g: 0.4156863, b: 0.41960788, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -786,8 +786,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 32 - m_fontSizeBase: 32 + m_fontSize: 45 + m_fontSizeBase: 45 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 @@ -1011,18 +1011,18 @@ RectTransform: m_GameObject: {fileID: 1284288942} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.1, y: 1.02, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 507616693} + - {fileID: 5948548988649794740} - {fileID: 434065540} m_Father: {fileID: 7182248005041137934} m_RootOrder: 3 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: -7.5} - m_SizeDelta: {x: 0, y: 15} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1284288945 CanvasRenderer: @@ -1045,15 +1045,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 0.84313726} m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 9f3b6aba0594a1f438e7bdfd84acf5e1, type: 3} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: 15fb08eb20f79bc48b96201cbd063189, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1087,18 +1087,18 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1862223069} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 7182248005337839513} - m_RootOrder: 2 + m_Father: {fileID: 7058858354066364361} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: -400} - m_SizeDelta: {x: 500, y: 500} + m_AnchoredPosition: {x: 0, y: -3.6} + m_SizeDelta: {x: 500, y: 257.8717} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1862223072 CanvasRenderer: @@ -1200,15 +1200,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.4738374, g: 0.745283, b: 0.4668565, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: d45b71806613f4b47a9d5bced162d2a7, type: 3} - m_Type: 0 + m_Sprite: {fileID: 21300000, guid: 2f18eb2179a049a49bf764c40b51412e, type: 3} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1437,6 +1437,237 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!1 &2418902640580965587 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2297561176113410581} + - component: {fileID: 6562746803085089647} + - component: {fileID: 5171194936651740114} + m_Layer: 5 + m_Name: LevelSelectionHeading_BG + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2297561176113410581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2418902640580965587} + 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: 7182248003788654072} + m_Father: {fileID: 7182248005337839513} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -223.9} + m_SizeDelta: {x: 1062.22, y: 261.40002} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6562746803085089647 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2418902640580965587} + m_CullTransparentMesh: 1 +--- !u!114 &5171194936651740114 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2418902640580965587} + 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.454902, g: 0.7568628, b: 0.80392164, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 111a2ccd2dd3b3448be9e18e361d6e46, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5243198573702484934 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7058858354066364361} + - component: {fileID: 6760460094138225660} + - component: {fileID: 5486824956033145512} + m_Layer: 5 + m_Name: Logo_BG + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7058858354066364361 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5243198573702484934} + 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: 1862223070} + m_Father: {fileID: 7182248005337839513} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 124.6} + m_SizeDelta: {x: 425.7, y: 163.4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6760460094138225660 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5243198573702484934} + m_CullTransparentMesh: 1 +--- !u!114 &5486824956033145512 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5243198573702484934} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2f18eb2179a049a49bf764c40b51412e, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &6950249163086990532 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5948548988649794740} + - component: {fileID: 1457225362778919760} + - component: {fileID: 1439675136011108719} + m_Layer: 5 + m_Name: GameEnd_BG + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5948548988649794740 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6950249163086990532} + 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: 507616693} + m_Father: {fileID: 1284288943} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -213.01} + m_SizeDelta: {x: 947.9, y: 221.3} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1457225362778919760 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6950249163086990532} + m_CullTransparentMesh: 1 +--- !u!114 &1439675136011108719 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6950249163086990532} + 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.8867924, g: 0.6635922, b: 0.50614095, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 8770d6cbee9a5054ca3d79798a454b37, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &7182248003487203128 GameObject: m_ObjectHideFlags: 0 @@ -1517,7 +1748,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 300, y: 80} + m_SizeDelta: {x: 314.9, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7182248003563694490 CanvasRenderer: @@ -1540,15 +1771,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.4745098, g: 0.74509805, b: 0.46666667, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: d45b71806613f4b47a9d5bced162d2a7, type: 3} - m_Type: 0 + m_Sprite: {fileID: 21300000, guid: 206faee83741b244eb8ded4292b92c3d, type: 3} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1613,7 +1844,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5c8b6d1b17d3135448c7945570764f9b, type: 3} m_Name: m_EditorClassIdentifier: - eventService: {fileID: 0} MapId: 1 --- !u!1 &7182248003610753085 GameObject: @@ -1839,7 +2069,7 @@ GameObject: - component: {fileID: 7182248003788654078} - component: {fileID: 7182248003788654079} m_Layer: 5 - m_Name: LevelSelectionHeading + m_Name: LevelSelectionHeading_TEXT m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1852,19 +2082,19 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7182248003788654073} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 7182248005337839513} + m_Father: {fileID: 2297561176113410581} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -100} - m_SizeDelta: {x: 1000, y: 100} - m_Pivot: {x: 0.5, y: 1} + 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 &7182248003788654078 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1902,8 +2132,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4278253567 - m_fontColor: {r: 1, g: 0.97001815, b: 0, a: 1} + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -1920,12 +2150,12 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 100 + m_fontSize: 102 m_fontSizeBase: 100 m_fontWeight: 400 - m_enableAutoSizing: 0 + m_enableAutoSizing: 1 m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_fontSizeMax: 102 m_fontStyle: 0 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 @@ -3000,9 +3230,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 583d4a8aa295a574b9c754281cc7873e, type: 3} m_Name: m_EditorClassIdentifier: - eventService: {fileID: 0} - waveService: {fileID: 0} - playerService: {fileID: 0} gameplayPanel: {fileID: 7182248003487203128} healthText: {fileID: 7182248004712830878} moneyText: {fileID: 7182248004752353294} @@ -3010,12 +3237,15 @@ MonoBehaviour: currentMapText: {fileID: 996504644} nextWaveButton: {fileID: 7182248003977404941} levelSelectionPanel: {fileID: 7182248005337839508} - Map1Button: {fileID: 7182248003563694484} + mapButtons: + - {fileID: 7182248003563694489} MonkeySelectionPanel: {fileID: 7182248003610753085} cellContainer: {fileID: 7182248004710957794} monkeyCellPrefab: {fileID: -1759216286440700527, guid: ab95bb937fb867845968459d4a3784b0, type: 3} monkeyCellScriptableObjects: - {fileID: 11400000, guid: 32d68a98896142d4882e7130b750d952, type: 2} + - {fileID: 11400000, guid: 1a259eb6efab7ab43ac36552b0b32d4b, type: 2} + - {fileID: 11400000, guid: 7e59d2e4e596c4049bce2fe6e66638bf, type: 2} gameEndPanel: {fileID: 1284288942} gameEndText: {fileID: 507616694} playAgainButton: {fileID: 1921834386} @@ -3170,9 +3400,9 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 7182248003788654072} + - {fileID: 2297561176113410581} - {fileID: 7182248003563694485} - - {fileID: 1862223070} + - {fileID: 7058858354066364361} m_Father: {fileID: 7182248005041137934} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -3202,15 +3432,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 0.7019608} m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 8499c8c1a85a12243ad7d96ec11c931e, type: 3} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: d099ef53608f2fc42905cdd643c55819, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 diff --git a/Assets/Resources/Player/Monkeys/Monkey_2_SO.asset b/Assets/Resources/Player/Monkeys/Monkey_2_SO.asset new file mode 100644 index 00000000..f21e03ca --- /dev/null +++ b/Assets/Resources/Player/Monkeys/Monkey_2_SO.asset @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e9f78841389ef74295702b371ae6a27, type: 3} + m_Name: Monkey_2_SO + m_EditorClassIdentifier: + Type: 1 + Prefab: {fileID: 4153936676241517788, guid: eac174a2bed8bd64fbbfd2bb69b78b88, type: 3} + RotationSpeed: 75 + projectileType: 1 + Range: 3 + Cost: 150 + AttackableBloons: 0000000001000000 + AttackRate: 0.5 diff --git a/Assets/Resources/Player/Monkeys/Monkey_2_SO.asset.meta b/Assets/Resources/Player/Monkeys/Monkey_2_SO.asset.meta new file mode 100644 index 00000000..8caafd4c --- /dev/null +++ b/Assets/Resources/Player/Monkeys/Monkey_2_SO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e327ea4b5441c6d48b598fce1298119c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Player/Monkeys/Monkey_3_SO.asset b/Assets/Resources/Player/Monkeys/Monkey_3_SO.asset new file mode 100644 index 00000000..dcadc6dd --- /dev/null +++ b/Assets/Resources/Player/Monkeys/Monkey_3_SO.asset @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e9f78841389ef74295702b371ae6a27, type: 3} + m_Name: Monkey_3_SO + m_EditorClassIdentifier: + Type: 2 + Prefab: {fileID: 4096465855865953158, guid: 8fa90eccd09912242a2914c4b986a9f8, type: 3} + RotationSpeed: 50 + projectileType: 2 + Range: 3 + Cost: 300 + AttackableBloons: 00000000010000000200000004000000 + AttackRate: 0.25 diff --git a/Assets/Resources/Player/Monkeys/Monkey_3_SO.asset.meta b/Assets/Resources/Player/Monkeys/Monkey_3_SO.asset.meta new file mode 100644 index 00000000..a0031dd7 --- /dev/null +++ b/Assets/Resources/Player/Monkeys/Monkey_3_SO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c97363e095df2444682d7b29f8b59cc3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Player/PlayerScriptableObject.asset b/Assets/Resources/Player/PlayerScriptableObject.asset index 30825770..52c17954 100644 --- a/Assets/Resources/Player/PlayerScriptableObject.asset +++ b/Assets/Resources/Player/PlayerScriptableObject.asset @@ -13,11 +13,11 @@ MonoBehaviour: m_Name: PlayerScriptableObject m_EditorClassIdentifier: Health: 100 - Money: 300 + Money: 100000000 MonkeyScriptableObjects: - {fileID: 11400000, guid: f8fc1658394cf7748917d02dda45e571, type: 2} - - {fileID: 11400000, guid: a9370d00ef28c7c4d996a0a4e78ede0f, type: 2} - - {fileID: 11400000, guid: 4e36024359151174bb7ebcd801abd128, type: 2} + - {fileID: 11400000, guid: e327ea4b5441c6d48b598fce1298119c, type: 2} + - {fileID: 11400000, guid: c97363e095df2444682d7b29f8b59cc3, type: 2} ProjectileScriptableObjects: - {fileID: 11400000, guid: e340dda60fff3ef448ee486910a3234a, type: 2} - {fileID: 11400000, guid: ffbcdc01c3e2c6643b339f98c899c9b0, type: 2} diff --git a/Assets/Resources/Wave/Bloons/Bloon_1_SO.asset b/Assets/Resources/Wave/Bloons/Bloon_1_SO.asset index 2e65cdee..940e24a3 100644 --- a/Assets/Resources/Wave/Bloons/Bloon_1_SO.asset +++ b/Assets/Resources/Wave/Bloons/Bloon_1_SO.asset @@ -17,6 +17,7 @@ MonoBehaviour: Damage: 1 Reward: 10 Speed: 3 - Sprite: {fileID: 21300000, guid: ae1e98a057db6a94ca5429339a0216d8, type: 3} + FullHealthSprite: {fileID: 21300000, guid: ae1e98a057db6a94ca5429339a0216d8, type: 3} + LowHealthSprite: {fileID: 0} LayeredBloons: LayerBloonSpawnRate: 0.2 diff --git a/Assets/Resources/Wave/Bloons/Bloon_2_SO.asset b/Assets/Resources/Wave/Bloons/Bloon_2_SO.asset index a5751047..68d28d62 100644 --- a/Assets/Resources/Wave/Bloons/Bloon_2_SO.asset +++ b/Assets/Resources/Wave/Bloons/Bloon_2_SO.asset @@ -17,6 +17,7 @@ MonoBehaviour: Damage: 5 Reward: 10 Speed: 3 - Sprite: {fileID: 21300000, guid: 915f49b044ce260499e22574848f3397, type: 3} + FullHealthSprite: {fileID: 21300000, guid: 915f49b044ce260499e22574848f3397, type: 3} + LowHealthSprite: {fileID: 0} LayeredBloons: 0000000000000000000000000000000000000000 LayerBloonSpawnRate: 0.2 diff --git a/Assets/Resources/Wave/Bloons/Bloon_3_SO.asset b/Assets/Resources/Wave/Bloons/Bloon_3_SO.asset index b5c3be87..a004aac7 100644 --- a/Assets/Resources/Wave/Bloons/Bloon_3_SO.asset +++ b/Assets/Resources/Wave/Bloons/Bloon_3_SO.asset @@ -17,6 +17,7 @@ MonoBehaviour: Damage: 50 Reward: 50 Speed: 1 - Sprite: {fileID: 21300000, guid: d70bd1152404cdc48a4e118505c8a024, type: 3} - LayeredBloons: 0100000001000000010000000100000001000000 + FullHealthSprite: {fileID: 21300000, guid: d70bd1152404cdc48a4e118505c8a024, type: 3} + LowHealthSprite: {fileID: 0} + LayeredBloons: 010000000100000001000000 LayerBloonSpawnRate: 0.2 diff --git a/Assets/Resources/Wave/Bloons/Bloon_5_SO.asset b/Assets/Resources/Wave/Bloons/Bloon_5_SO.asset new file mode 100644 index 00000000..98d2638a --- /dev/null +++ b/Assets/Resources/Wave/Bloons/Bloon_5_SO.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b32fea2b81d77ab45b7095799571b00f, type: 3} + m_Name: Bloon_5_SO + m_EditorClassIdentifier: + Type: 4 + Health: 1000 + HealthRegenerationValue: 50 + HealthRegenerationAfter: 4 + Damage: 60 + Reward: 2000 + Speed: 0.5 + FullHealthSprite: {fileID: 21300000, guid: 1eea6667bbfc30d4382b57d10a3750c5, type: 3} + LowHealthSprite: {fileID: 21300000, guid: 56150d2e3c6457248bdbf858ecbcc70a, type: 3} + LayeredBloons: + LayerBloonSpawnRate: 0.2 diff --git a/Assets/Resources/Wave/Bloons/Bloon_5_SO.asset.meta b/Assets/Resources/Wave/Bloons/Bloon_5_SO.asset.meta new file mode 100644 index 00000000..035e2e0d --- /dev/null +++ b/Assets/Resources/Wave/Bloons/Bloon_5_SO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d30eee8401f785643b10724e53b5fc45 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Wave/WaveConfigurations/WaveConfiguration_1.asset b/Assets/Resources/Wave/WaveConfigurations/WaveConfiguration_1.asset index 90f7ff6c..bc17a194 100644 --- a/Assets/Resources/Wave/WaveConfigurations/WaveConfiguration_1.asset +++ b/Assets/Resources/Wave/WaveConfigurations/WaveConfiguration_1.asset @@ -32,3 +32,5 @@ MonoBehaviour: ListOfBloons: 02000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000 - WaveID: 9 ListOfBloons: 020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000020000000200000002000000 + - WaveID: 10 + ListOfBloons: 04000000 diff --git a/Assets/Resources/Wave/WaveScriptableObject.asset b/Assets/Resources/Wave/WaveScriptableObject.asset index c4f9c458..eb32a546 100644 --- a/Assets/Resources/Wave/WaveScriptableObject.asset +++ b/Assets/Resources/Wave/WaveScriptableObject.asset @@ -20,3 +20,4 @@ MonoBehaviour: - {fileID: 11400000, guid: 45005e1015669c241a23ada66cdd35d7, type: 2} - {fileID: 11400000, guid: ea94ed707f901674ab17fa92fb1e75fc, type: 2} - {fileID: 11400000, guid: 62dbe99bc77263640a7119cdf12fc398, type: 2} + - {fileID: 11400000, guid: d30eee8401f785643b10724e53b5fc45, type: 2} diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 465ea7fb..d966e4ea 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -123,99 +123,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &81048207 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 81048209} - - component: {fileID: 81048208} - m_Layer: 0 - m_Name: PlayerService - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &81048208 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 81048207} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2ecab4ab9556097469b1cdf5aeb9b5a3, type: 3} - m_Name: - m_EditorClassIdentifier: - uiService: {fileID: 1107832201} - mapService: {fileID: 1775323201} - soundService: {fileID: 1608414551} - playerService: {fileID: 81048208} - playerScriptableObject: {fileID: 11400000, guid: ba423c4fbfbefa248b49a627b9e607b6, type: 2} ---- !u!4 &81048209 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 81048207} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &338547894 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 338547896} - - component: {fileID: 338547895} - m_Layer: 0 - m_Name: EventService - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &338547895 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 338547894} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8156f45993b37db40a528c801bb7d2ee, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!4 &338547896 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 338547894} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &519420028 GameObject: m_ObjectHideFlags: 0 @@ -300,6 +207,51 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &840327706 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 840327708} + - component: {fileID: 840327707} + m_Layer: 0 + m_Name: PlayerService + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &840327707 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 840327706} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5726cb0ed8967f0479816a4ecd19fd49, type: 3} + m_Name: + m_EditorClassIdentifier: + playerScriptableObject: {fileID: 11400000, guid: ba423c4fbfbefa248b49a627b9e607b6, type: 2} +--- !u!4 &840327708 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 840327706} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 303, y: 189.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &898234723 GameObject: m_ObjectHideFlags: 0 @@ -366,20 +318,9 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1107832201 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 7182248005041137930, guid: 15430d56842a28843b57fd250730f142, type: 3} - m_PrefabInstance: {fileID: 7182248004000416899} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 583d4a8aa295a574b9c754281cc7873e, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1 &1241429277 +--- !u!1 &1099228529 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -387,48 +328,92 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1241429279} - - component: {fileID: 1241429278} + - component: {fileID: 1099228531} + - component: {fileID: 1099228530} m_Layer: 0 - m_Name: WaveService + m_Name: SoundService m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1241429278 +--- !u!114 &1099228530 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1241429277} + m_GameObject: {fileID: 1099228529} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 066c2c6d53ce8574c9c0b875b3386ce6, type: 3} + m_Script: {fileID: 11500000, guid: 06b5a763ab2ce1e419c2a80cdfacb737, type: 3} m_Name: m_EditorClassIdentifier: - eventService: {fileID: 338547895} - uiService: {fileID: 1107832201} - mapService: {fileID: 1775323201} - soundService: {fileID: 1608414551} - playerService: {fileID: 81048208} - waveScriptableObject: {fileID: 11400000, guid: 1a1805a3a12f21d4c9847d85958ab9ce, type: 2} ---- !u!4 &1241429279 +--- !u!4 &1099228531 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1099228529} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 303, y: 189.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1275803722 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1275803723} + - component: {fileID: 1275803724} + m_Layer: 0 + m_Name: GameService + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1275803723 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1241429277} + m_GameObject: {fileID: 1275803722} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1275803724 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1275803722} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b0948addf429374c8df97b23b26b237, type: 3} + m_Name: + m_EditorClassIdentifier: + mapScriptableObject: {fileID: 11400000, guid: 412d441209954ab47a08973a630f316a, type: 2} + waveScriptableObject: {fileID: 11400000, guid: 1a1805a3a12f21d4c9847d85958ab9ce, type: 2} + soundScriptableObject: {fileID: 11400000, guid: 1fe1d13385d932c4987f15e4b7d1cc49, type: 2} + playerScriptableObject: {fileID: 11400000, guid: ba423c4fbfbefa248b49a627b9e607b6, type: 2} + sfxSource: {fileID: 1495988717} + bgMusicSource: {fileID: 2019223321} --- !u!1 &1495988716 GameObject: m_ObjectHideFlags: 0 @@ -555,56 +540,9 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1608414550 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1608414552} - - component: {fileID: 1608414551} - m_Layer: 0 - m_Name: SoundService - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1608414551 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1608414550} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 06b5a763ab2ce1e419c2a80cdfacb737, type: 3} - m_Name: - m_EditorClassIdentifier: - soundScriptableObject: {fileID: 11400000, guid: 1fe1d13385d932c4987f15e4b7d1cc49, type: 2} - audioEffects: {fileID: 1495988717} - backgroundMusic: {fileID: 2019223321} ---- !u!4 &1608414552 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1608414550} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 241.32443, y: 1021.14453, z: 0.23853302} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1775323200 +--- !u!1 &1883994868 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -612,43 +550,41 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1775323202} - - component: {fileID: 1775323201} + - component: {fileID: 1883994870} + - component: {fileID: 1883994869} m_Layer: 0 - m_Name: MapService + m_Name: WaveService m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1775323201 +--- !u!114 &1883994869 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1775323200} + m_GameObject: {fileID: 1883994868} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d3fe4ed09c4de614794ae9d9ad4a2b60, type: 3} + m_Script: {fileID: 11500000, guid: 066c2c6d53ce8574c9c0b875b3386ce6, type: 3} m_Name: m_EditorClassIdentifier: - eventService: {fileID: 338547895} - mapScriptableObject: {fileID: 11400000, guid: 412d441209954ab47a08973a630f316a, type: 2} ---- !u!4 &1775323202 +--- !u!4 &1883994870 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1775323200} + m_GameObject: {fileID: 1883994868} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 303, y: 189.5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2019223320 GameObject: @@ -776,7 +712,51 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 9 + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2126453683 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2126453685} + - component: {fileID: 2126453684} + m_Layer: 0 + m_Name: MapService + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2126453684 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2126453683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d3fe4ed09c4de614794ae9d9ad4a2b60, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &2126453685 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2126453683} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 303, y: 189.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &7182248004000416899 PrefabInstance: @@ -785,22 +765,126 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 7182248003563694489, guid: 15430d56842a28843b57fd250730f142, type: 3} - propertyPath: eventService - value: - objectReference: {fileID: 338547895} - - target: {fileID: 7182248005041137930, guid: 15430d56842a28843b57fd250730f142, type: 3} - propertyPath: waveService - value: - objectReference: {fileID: 1241429278} - - target: {fileID: 7182248005041137930, guid: 15430d56842a28843b57fd250730f142, type: 3} - propertyPath: eventService - value: - objectReference: {fileID: 338547895} - - target: {fileID: 7182248005041137930, guid: 15430d56842a28843b57fd250730f142, type: 3} - propertyPath: playerService - value: - objectReference: {fileID: 81048208} + - target: {fileID: 434065540, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 939683039, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 939683039, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 939683039, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 939683039, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1277199674, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1277199674, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1277199674, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1277199674, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1284288942, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1921834384, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1921834384, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1921834384, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1921834384, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248003487203128, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7182248003610753085, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248003929906509, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248003929906509, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248003929906509, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248003929906509, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004575362321, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004712830872, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004712830872, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004712830872, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004712830872, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004752353289, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004752353289, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004752353289, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248004752353289, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 142.19 + objectReference: {fileID: 0} + - target: {fileID: 7182248004752353289, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7182248005041137931, guid: 15430d56842a28843b57fd250730f142, type: 3} propertyPath: m_Name value: Canvas - UI Service @@ -815,7 +899,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7182248005041137934, guid: 15430d56842a28843b57fd250730f142, type: 3} propertyPath: m_RootOrder - value: 2 + value: 3 objectReference: {fileID: 0} - target: {fileID: 7182248005041137934, guid: 15430d56842a28843b57fd250730f142, type: 3} propertyPath: m_AnchorMax.x @@ -889,5 +973,41 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 7182248005245360211, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248005337839508, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248005351911911, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248005351911911, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248005351911911, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7182248005351911911, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7669634307133948460, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7669634307133948460, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7669634307133948460, guid: 15430d56842a28843b57fd250730f142, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 15430d56842a28843b57fd250730f142, type: 3} diff --git a/Assets/Scripts/Events/EventController.cs b/Assets/Scripts/Events/EventController.cs index c35e1a9f..f2dc1812 100644 --- a/Assets/Scripts/Events/EventController.cs +++ b/Assets/Scripts/Events/EventController.cs @@ -1,10 +1,10 @@ using System; /** This script demonstrates implementation of the Observer Pattern. - * If you're interested in learning about Observer Pattern, - * you can find a dedicated course on Outscal's website. - * Link: https://outscal.com/courses - **/ + * If you're interested in learning about Observer Pattern, + * you can find a dedicated course on Outscal's website. + * Link: https://outscal.com/courses + **/ namespace ServiceLocator.Events { diff --git a/Assets/Scripts/Events/EventService.cs b/Assets/Scripts/Events/EventService.cs index ac6aa706..e9801d44 100644 --- a/Assets/Scripts/Events/EventService.cs +++ b/Assets/Scripts/Events/EventService.cs @@ -1,21 +1,19 @@ -using UnityEngine; - -/** This script demonstrates implementation of the Observer Pattern. - * If you're interested in learning about Observer Pattern, - * you can find a dedicated course on Outscal's website. - * Link: https://outscal.com/courses - **/ +/** + * This script demonstrates implementation of the Observer Pattern. + * If you're interested in learning about Observer Pattern, + * you can find a dedicated course on Outscal's website. + * Link: https://outscal.com/courses + **/ namespace ServiceLocator.Events { - public class EventService : MonoBehaviour + public class EventService { public GameEventController OnMapSelected { get; private set; } - private void Awake() + public EventService() { OnMapSelected = new GameEventController(); } - } } \ No newline at end of file diff --git a/Assets/Scripts/Generic Sin gleton.meta b/Assets/Scripts/Generic Sin gleton.meta new file mode 100644 index 00000000..0083a0e4 --- /dev/null +++ b/Assets/Scripts/Generic Sin gleton.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69651e5af5437e54abc4dc8b66fd9c41 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Generic Sin gleton/GenericMonoBehaviourSingleton.cs b/Assets/Scripts/Generic Sin gleton/GenericMonoBehaviourSingleton.cs new file mode 100644 index 00000000..bfa1cdf7 --- /dev/null +++ b/Assets/Scripts/Generic Sin gleton/GenericMonoBehaviourSingleton.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class GenericMonoBehaviourSingleton : MonoBehaviour where T : GenericMonoBehaviourSingleton +{ + + private static T instance; + public static T Instance { get { return instance; } } + + + private void Awake() + { + MakeInstance(); + } + + private void MakeInstance() + { + if (instance == null) + { + instance = (T)this; + } + else + { + Destroy(gameObject); + } + } +} diff --git a/Assets/Scripts/Wave/Bloons/BloonTypeDataMap.cs.meta b/Assets/Scripts/Generic Sin gleton/GenericMonoBehaviourSingleton.cs.meta similarity index 83% rename from Assets/Scripts/Wave/Bloons/BloonTypeDataMap.cs.meta rename to Assets/Scripts/Generic Sin gleton/GenericMonoBehaviourSingleton.cs.meta index e1548b97..9ea2a916 100644 --- a/Assets/Scripts/Wave/Bloons/BloonTypeDataMap.cs.meta +++ b/Assets/Scripts/Generic Sin gleton/GenericMonoBehaviourSingleton.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: db73e03820c7fa542bca17f19ce1f7e5 +guid: 332318b3df9301e48b60b23f7ec3d78c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Main.meta b/Assets/Scripts/Main.meta new file mode 100644 index 00000000..3c835533 --- /dev/null +++ b/Assets/Scripts/Main.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7c3c997584cba5744aedd64a4dad0cd3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Main/GameService.cs b/Assets/Scripts/Main/GameService.cs new file mode 100644 index 00000000..c05c0f88 --- /dev/null +++ b/Assets/Scripts/Main/GameService.cs @@ -0,0 +1,65 @@ +using UnityEngine; +using ServiceLocator.Events; +using ServiceLocator.Map; +using ServiceLocator.Wave; +using ServiceLocator.Sound; +using ServiceLocator.Player; +using ServiceLocator.UI; + +namespace ServiceLocator.Main +{ + public class GameService : GenericMonoBehaviourSingleton + { + // Services: + private EventService eventService; + + private WaveService waveService; + + + + + // Scriptable Objects: + [SerializeField] private MapScriptableObject mapScriptableObject; + [SerializeField] private WaveScriptableObject waveScriptableObject; + [SerializeField] private SoundScriptableObject soundScriptableObject; + [SerializeField] private PlayerScriptableObject playerScriptableObject; + + // Scene References: + [SerializeField] private AudioSource sfxSource; + [SerializeField] private AudioSource bgMusicSource; + + private void Start() + { + InitializeServices(); + InjectDependencies(); + } + + private void InitializeServices() + { + eventService = new EventService(); + + SoundService.Instance.Init(soundScriptableObject, sfxSource, bgMusicSource); + + MapService.Instance.InitFromGameSerive(mapScriptableObject); + + PlayerService.Instance.InitGameService(playerScriptableObject); + + + WaveService.Instance.InitWaveFromGameService(waveScriptableObject); + } + + private void InjectDependencies() + { + MapService.Instance.Init(eventService); + UIService.Instance.Init(eventService); + PlayerService.Instance.Init(); + WaveService.Instance.Init(eventService); + //UIService.Instance.Init( soundService, eventService); + } + + private void Update() + { + PlayerService.Instance.Update(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Main/GameService.cs.meta b/Assets/Scripts/Main/GameService.cs.meta new file mode 100644 index 00000000..82a39ed5 --- /dev/null +++ b/Assets/Scripts/Main/GameService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b0948addf429374c8df97b23b26b237 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Map/MapService.cs b/Assets/Scripts/Map/MapService.cs index b6582377..72e21cec 100644 --- a/Assets/Scripts/Map/MapService.cs +++ b/Assets/Scripts/Map/MapService.cs @@ -1,34 +1,55 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.Tilemaps; +using ServiceLocator.Main; using ServiceLocator.Player; using ServiceLocator.Events; namespace ServiceLocator.Map { - public class MapService : MonoBehaviour + public class MapService :MonoBehaviour { - [SerializeField] private EventService eventService; - [SerializeField] private MapScriptableObject mapScriptableObject; + // Dependencies: + private EventService eventService; + private MapScriptableObject mapScriptableObject; private Grid currentGrid; private Tilemap currentTileMap; private MapData currentMapData; private SpriteRenderer tileOverlay; - private void Start() + private static MapService instance; + public static MapService Instance { get { return instance; } } + private void Awake() { - SubscribeToEvents(); + MakeInstance(); + } + private void MakeInstance() + { + if (instance == null) instance = this; + else { Destroy(gameObject); } + } + + + public void InitFromGameSerive(MapScriptableObject mapScriptableObject) + { + this.mapScriptableObject = mapScriptableObject; tileOverlay = Object.Instantiate(mapScriptableObject.TileOverlay).GetComponent(); ResetTileOverlay(); } + public void Init(EventService eventService) + { + this.eventService = eventService; + SubscribeToEvents(); + } + private void SubscribeToEvents() => eventService.OnMapSelected.AddListener(LoadMap); private void LoadMap(int mapId) { currentMapData = mapScriptableObject.MapDatas.Find(mapData => mapData.MapID == mapId); - currentGrid = Instantiate(currentMapData.MapPrefab); + currentGrid = Object.Instantiate(currentMapData.MapPrefab); currentTileMap = currentGrid.GetComponentInChildren(); } @@ -40,7 +61,7 @@ private void LoadMap(int mapId) private void SetTileOverlayColor(TileOverlayColor colorToSet) { - switch (colorToSet) + switch(colorToSet) { case TileOverlayColor.TRANSPARENT: tileOverlay.color = mapScriptableObject.DefaultTileColor; @@ -60,7 +81,7 @@ public void ValidateSpawnPosition(Vector3 cursorPosition) Vector3Int cellPosition = GetCellPosition(mousePosition); Vector3 cellCenter = GetCenterOfCell(cellPosition); - if (CanSpawnOnPosition(cellCenter, cellPosition)) + if(CanSpawnOnPosition(cellCenter, cellPosition)) { tileOverlay.transform.position = cellCenter; SetTileOverlayColor(TileOverlayColor.SPAWNABLE); @@ -96,9 +117,9 @@ public bool TryGetMonkeySpawnPosition(Vector3 cursorPosition, out Vector3 spawnP private Vector3 GetCenterOfCell(Vector3Int cellPosition) => currentGrid.GetCellCenterWorld(cellPosition); - private bool CanSpawnOnPosition(Vector3 cellCenter, Vector3Int cellPosition) + private bool CanSpawnOnPosition(Vector3 centerCell, Vector3Int cellPosition) { - Collider2D[] colliders = Physics2D.OverlapCircleAll(cellCenter, 0.1f); + Collider2D[] colliders = Physics2D.OverlapCircleAll(centerCell, 0.1f); return InisdeTilemapBounds(cellPosition) && !HasClickedOnObstacle(colliders) && !IsOverLappingMonkey(colliders); } diff --git a/Assets/Scripts/Player/MonkeyController.cs b/Assets/Scripts/Player/MonkeyController.cs index 15790cb0..4f2e3ac4 100644 --- a/Assets/Scripts/Player/MonkeyController.cs +++ b/Assets/Scripts/Player/MonkeyController.cs @@ -8,19 +8,22 @@ namespace ServiceLocator.Player { public class MonkeyController { - private MonkeyView monkeyView; + // Dependencies: private MonkeyScriptableObject monkeyScriptableObject; private ProjectilePool projectilePool; - + private MonkeyView monkeyView; + + private List bloonsInRange; private float attackTimer; - public MonkeyController(MonkeyScriptableObject monkeyScriptableObject, ProjectilePool projectilePool) + public MonkeyController( MonkeyScriptableObject monkeyScriptableObject, ProjectilePool projectilePool) { + //this.soundService = soundService; this.monkeyScriptableObject = monkeyScriptableObject; this.projectilePool = projectilePool; CreateMonkeyView(); - ResetAttackTimer(); + InitializeVariables(); } private void CreateMonkeyView() @@ -30,10 +33,63 @@ private void CreateMonkeyView() monkeyView.SetTriggerRadius(monkeyScriptableObject.Range); } + private void InitializeVariables() + { + bloonsInRange = new List(); + ResetAttackTimer(); + } + public void SetPosition(Vector3 positionToSet) => monkeyView.transform.position = positionToSet; + public void BloonEnteredRange(BloonController bloon) + { + if (CanAttackBloon(bloon.GetBloonType())){ + bloonsInRange.Add(bloon); + } + } + + public void BloonExitedRange(BloonController bloon) + { + if (CanAttackBloon(bloon.GetBloonType())) + bloonsInRange.Remove(bloon); + } + public bool CanAttackBloon(BloonType bloonType) => monkeyScriptableObject.AttackableBloons.Contains(bloonType); + public void UpdateMonkey() + { + if (bloonsInRange.Count > 0) + { + RotateTowardsTarget(bloonsInRange[0]); + ShootAtTarget(bloonsInRange[0]); + } + } + + private void RotateTowardsTarget(BloonController targetBloon) + { + Vector3 direction = targetBloon.Position - monkeyView.transform.position; + float angle = (Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg) + 180; + monkeyView.transform.rotation = Quaternion.Euler(0f, 0f, angle); + } + + private void ShootAtTarget(BloonController targetBloon) + { + attackTimer -= Time.deltaTime; + if(attackTimer <= 0) + { + CreateProjectileForTarget(targetBloon); + SoundService.Instance.PlaySoundEffects(SoundType.MonkeyShoot); + ResetAttackTimer(); + } + } + + private void CreateProjectileForTarget(BloonController targetBloon) + { + ProjectileController projectile = projectilePool.GetProjectile(monkeyScriptableObject.projectileType); + projectile.SetPosition(monkeyView.transform.position); + projectile.SetTarget(targetBloon); + } + private void ResetAttackTimer() => attackTimer = monkeyScriptableObject.AttackRate; } } \ No newline at end of file diff --git a/Assets/Scripts/Player/MonkeyView.cs b/Assets/Scripts/Player/MonkeyView.cs index d2444132..187ae428 100644 --- a/Assets/Scripts/Player/MonkeyView.cs +++ b/Assets/Scripts/Player/MonkeyView.cs @@ -27,6 +27,21 @@ public void SetTriggerRadius(float radiusToSet) MakeRangeVisible(false); } + private void OnTriggerEnter2D(Collider2D collision) + { + if (collision.TryGetComponent(out BloonView bloonView)) + { + controller.BloonEnteredRange(bloonView.Controller); + } + } + + private void OnTriggerExit2D(Collider2D collision) + { + if(collision.TryGetComponent(out BloonView bloonView)) + { + controller.BloonExitedRange(bloonView.Controller); + } + } public void PlayAnimation(MonkeyAnimation animationToPlay) => monkeyAnimator.Play(animationToPlay.ToString(), 0); public void MakeRangeVisible(bool makeVisible) => RangeSpriteRenderer.color = makeVisible ? new Color(1, 1, 1, 0.25f) : new Color(1, 1, 1, 0); diff --git a/Assets/Scripts/Player/PlayerService.cs b/Assets/Scripts/Player/PlayerService.cs index c58646b9..ea79d7ad 100644 --- a/Assets/Scripts/Player/PlayerService.cs +++ b/Assets/Scripts/Player/PlayerService.cs @@ -1,21 +1,18 @@ using System.Collections.Generic; using UnityEngine; using ServiceLocator.Player.Projectile; -using ServiceLocator.UI; using ServiceLocator.Map; +using ServiceLocator.UI; using ServiceLocator.Sound; namespace ServiceLocator.Player { - public class PlayerService : MonoBehaviour + public class PlayerService : GenericMonoBehaviourSingleton { - [SerializeField] private UIService uiService; - [SerializeField] private MapService mapService; - [SerializeField] private SoundService soundService; - [SerializeField] private PlayerService playerService; - - [SerializeField] public PlayerScriptableObject playerScriptableObject; - + // Dependencies: + + + [SerializeField] private PlayerScriptableObject playerScriptableObject; private ProjectilePool projectilePool; private List activeMonkeys; @@ -23,23 +20,45 @@ public class PlayerService : MonoBehaviour private int health; public int Money { get; private set; } - private void Start() + + + + public void InitGameService(PlayerScriptableObject playerScriptableObject) { - projectilePool = new ProjectilePool(playerService, playerScriptableObject.ProjectilePrefab, playerScriptableObject.ProjectileScriptableObjects); + this.playerScriptableObject = playerScriptableObject; + projectilePool = new ProjectilePool(playerScriptableObject.ProjectilePrefab, playerScriptableObject.ProjectileScriptableObjects); + } + + public void Init( ) + { + + InitializeVariables(); } private void InitializeVariables() { + activeMonkeys = new List(); health = playerScriptableObject.Health; Money = playerScriptableObject.Money; - uiService.UpdateHealthUI(health); - uiService.UpdateMoneyUI(Money); - activeMonkeys = new List(); + UIService.Instance.UpdateHealthUI(health); + UIService.Instance.UpdateMoneyUI(Money); } public void Update() { + if (activeMonkeys.Count != 0) + { + foreach (MonkeyController controller in activeMonkeys) + { + controller.UpdateMonkey(); + } + } + foreach(MonkeyController monkey in activeMonkeys) + { + monkey?.UpdateMonkey(); + } + if(Input.GetMouseButtonDown(0)) { TrySelectingMonkey(); @@ -82,7 +101,7 @@ public void ValidateSpawnPosition(int monkeyCost, Vector3 dropPosition) if (monkeyCost > Money) return; - mapService.ValidateSpawnPosition(dropPosition); + MapService.Instance.ValidateSpawnPosition(dropPosition); } public void TrySpawningMonkey(MonkeyType monkeyType, int monkeyCost, Vector3 dropPosition) @@ -90,20 +109,20 @@ public void TrySpawningMonkey(MonkeyType monkeyType, int monkeyCost, Vector3 dro if (monkeyCost > Money) return; - if (mapService.TryGetMonkeySpawnPosition(dropPosition, out Vector3 spawnPosition)) + if (MapService.Instance.TryGetMonkeySpawnPosition(dropPosition, out Vector3 spawnPosition)) { SpawnMonkey(monkeyType, spawnPosition); - soundService.PlaySoundEffects(SoundType.SpawnMonkey); + SoundService.Instance.PlaySoundEffects(SoundType.SpawnMonkey); } } public void SpawnMonkey(MonkeyType monkeyType, Vector3 spawnPosition) { MonkeyScriptableObject monkeyScriptableObject = GetMonkeyScriptableObjectByType(monkeyType); - MonkeyController monkey = new MonkeyController(monkeyScriptableObject, projectilePool); + MonkeyController monkey = new MonkeyController( monkeyScriptableObject, projectilePool); + monkey.SetPosition(spawnPosition); activeMonkeys.Add(monkey); - DeductMoney(monkeyScriptableObject.Cost); } @@ -116,7 +135,7 @@ public void TakeDamage(int damageToTake) int reducedHealth = health - damageToTake; health = reducedHealth <= 0 ? 0 : health - damageToTake; - uiService.UpdateHealthUI(health); + UIService.Instance.UpdateHealthUI(health); if(health <= 0) PlayerDeath(); } @@ -124,15 +143,15 @@ public void TakeDamage(int damageToTake) private void DeductMoney(int moneyToDedecut) { Money -= moneyToDedecut; - uiService.UpdateMoneyUI(Money); + UIService.Instance.UpdateMoneyUI(Money); } public void GetReward(int reward) { Money += reward; - uiService.UpdateMoneyUI(Money); + UIService.Instance?.UpdateMoneyUI(Money); } - private void PlayerDeath() => uiService.UpdateGameEndUI(false); + private void PlayerDeath() => UIService.Instance.UpdateGameEndUI(false); } } \ No newline at end of file diff --git a/Assets/Scripts/Player/PlayerService.cs.meta b/Assets/Scripts/Player/PlayerService.cs.meta index 82c9645d..01d69320 100644 --- a/Assets/Scripts/Player/PlayerService.cs.meta +++ b/Assets/Scripts/Player/PlayerService.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2ecab4ab9556097469b1cdf5aeb9b5a3 +guid: 5726cb0ed8967f0479816a4ecd19fd49 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Player/Projectile/ProjectileController.cs b/Assets/Scripts/Player/Projectile/ProjectileController.cs index 5611d368..aebb12c2 100644 --- a/Assets/Scripts/Player/Projectile/ProjectileController.cs +++ b/Assets/Scripts/Player/Projectile/ProjectileController.cs @@ -1,20 +1,21 @@ using UnityEngine; using ServiceLocator.Wave.Bloon; +using ServiceLocator.Main; namespace ServiceLocator.Player.Projectile { public class ProjectileController { - private PlayerService playerService; + private ProjectileView projectileView; private ProjectileScriptableObject projectileScriptableObject; private BloonController target; private ProjectileState currentState; - public ProjectileController(PlayerService playerService, ProjectileView projectilePrefab, Transform projectileContainer) + public ProjectileController( ProjectileView projectilePrefab, Transform projectileContainer) { - this.playerService = playerService; + projectileView = Object.Instantiate(projectilePrefab, projectileContainer); projectileView.SetController(this); } @@ -51,7 +52,7 @@ public void UpdateProjectileMotion() public void OnHitBloon(BloonController bloonHit) { - if (currentState == ProjectileState.ACTIVE) + if(currentState == ProjectileState.ACTIVE) { bloonHit.TakeDamage(projectileScriptableObject.Damage); ResetProjectile(); @@ -63,15 +64,15 @@ public void ResetProjectile() { target = null; projectileView.gameObject.SetActive(false); - playerService.ReturnProjectileToPool(this); + PlayerService.Instance.ReturnProjectileToPool(this); } private void SetState(ProjectileState newState) => currentState = newState; + } - private enum ProjectileState - { - ACTIVE, - HIT_TARGET - } + public enum ProjectileState + { + ACTIVE, + HIT_TARGET } } \ No newline at end of file diff --git a/Assets/Scripts/Player/Projectile/ProjectilePool.cs b/Assets/Scripts/Player/Projectile/ProjectilePool.cs index 066b4bd4..e0c6fbe3 100644 --- a/Assets/Scripts/Player/Projectile/ProjectilePool.cs +++ b/Assets/Scripts/Player/Projectile/ProjectilePool.cs @@ -12,14 +12,13 @@ namespace ServiceLocator.Player.Projectile { public class ProjectilePool : GenericObjectPool { - private PlayerService playerService; + private ProjectileView projectilePrefab; private List projectileScriptableObjects; private Transform projectileContainer; - public ProjectilePool(PlayerService playerService, ProjectileView projectilePrefab, List projectileScriptableObjects) + public ProjectilePool( ProjectileView projectilePrefab, List projectileScriptableObjects) { - this.playerService = playerService; this.projectilePrefab = projectilePrefab; this.projectileScriptableObjects = projectileScriptableObjects; this.projectileContainer = new GameObject("Projectile Container").transform; @@ -33,6 +32,6 @@ public ProjectileController GetProjectile(ProjectileType projectileType) return projectile; } - protected override ProjectileController CreateItem() => new ProjectileController(playerService, projectilePrefab, projectileContainer); + protected override ProjectileController CreateItem() => new ProjectileController( projectilePrefab, projectileContainer); } } \ No newline at end of file diff --git a/Assets/Scripts/Player/Projectile/ProjectileView.cs b/Assets/Scripts/Player/Projectile/ProjectileView.cs index cca23502..68c5c3ed 100644 --- a/Assets/Scripts/Player/Projectile/ProjectileView.cs +++ b/Assets/Scripts/Player/Projectile/ProjectileView.cs @@ -16,6 +16,7 @@ private void Update() { if (ProjectileOutOfBounds()) controller.ResetProjectile(); + controller?.UpdateProjectileMotion(); } diff --git a/Assets/Scripts/Sound/SoundService.cs b/Assets/Scripts/Sound/SoundService.cs index f77a34d0..661db7f3 100644 --- a/Assets/Scripts/Sound/SoundService.cs +++ b/Assets/Scripts/Sound/SoundService.cs @@ -3,14 +3,31 @@ namespace ServiceLocator.Sound { - public class SoundService : MonoBehaviour + public class SoundService :GenericMonoBehaviourSingleton { - [SerializeField] private SoundScriptableObject soundScriptableObject; - [SerializeField] private AudioSource audioEffects; - [SerializeField] private AudioSource backgroundMusic; + private SoundScriptableObject soundScriptableObject; + private AudioSource audioEffects; + private AudioSource backgroundMusic; - private void Start() + + //private static SoundService instance; + //public static SoundService Instance { get { return instance; } } + + //private void Awake() + //{ + // MakeInstance(); + //} + //private void MakeInstance() + //{ + // if (instance == null) instance = this; + // else { Destroy(gameObject); } + //} + + public void Init(SoundScriptableObject soundScriptableObject, AudioSource audioEffectSource, AudioSource bgMusicSource) { + this.soundScriptableObject = soundScriptableObject; + audioEffects = audioEffectSource; + backgroundMusic = bgMusicSource; PlaybackgroundMusic(SoundType.BackgroundMusic, true); } @@ -25,6 +42,7 @@ public void PlaySoundEffects(SoundType soundType, bool loopSound = false) } else Debug.LogError("No Audio Clip selected."); + } private void PlaybackgroundMusic(SoundType soundType, bool loopSound = false) @@ -36,8 +54,6 @@ private void PlaybackgroundMusic(SoundType soundType, bool loopSound = false) backgroundMusic.clip = clip; backgroundMusic.Play(); } - else - Debug.LogError("No Audio Clip selected."); } private AudioClip GetSoundClip(SoundType soundType) @@ -48,4 +64,4 @@ private AudioClip GetSoundClip(SoundType soundType) return null; } } -} \ No newline at end of file +} diff --git a/Assets/Scripts/UI/MapButton.cs b/Assets/Scripts/UI/MapButton.cs index 2af74f67..7ef4be1b 100644 --- a/Assets/Scripts/UI/MapButton.cs +++ b/Assets/Scripts/UI/MapButton.cs @@ -1,17 +1,24 @@ -using ServiceLocator.Events; using UnityEngine; using UnityEngine.UI; +using ServiceLocator.Events; namespace ServiceLocator.UI { public class MapButton : MonoBehaviour { - [SerializeField] private EventService eventService; [SerializeField] private int MapId; + private EventService eventService; - private void Start() => GetComponent