From 9e2fd793c08d29af92e5f4609239b729fe2066c5 Mon Sep 17 00:00:00 2001 From: Jimmy Tremblay-Bernier Date: Mon, 13 Nov 2023 22:39:23 -0500 Subject: [PATCH] Actual main menu --- .../ConjureArcadeMetadata.asset | 21 +- Assets/InputActions/CommonInput.inputactions | 2 +- .../GameMovementsPlayer.inputactions | 6 +- Assets/InputActions/MenuAction.inputactions | 4 +- ...tom Attribute Processors.unitypackage.meta | 7 + .../Demos/Custom Drawers.unitypackage.meta | 7 + .../Demos/Editor Windows.unitypackage.meta | 7 + .../Sample - RPG Editor.unitypackage.meta | 7 + Assets/Scenes/MainMenu.unity | 785 +++++++++++++++++- .../Events/onUpdateAmountPlayer.asset | 16 + .../Events/onUpdateAmountPlayer.asset.meta | 8 + Assets/Scripts/Conjure/Input/GameJoiner.cs | 4 + Assets/Scripts/Conjure/JoinUi.cs | 27 +- 13 files changed, 876 insertions(+), 25 deletions(-) create mode 100644 Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta create mode 100644 Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset create mode 100644 Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset.meta diff --git a/Assets/ConjureOS/Scripts/MetadataWindow/ConjureArcadeMetadata.asset b/Assets/ConjureOS/Scripts/MetadataWindow/ConjureArcadeMetadata.asset index 4395db33..a7d492e9 100644 --- a/Assets/ConjureOS/Scripts/MetadataWindow/ConjureArcadeMetadata.asset +++ b/Assets/ConjureOS/Scripts/MetadataWindow/ConjureArcadeMetadata.asset @@ -12,19 +12,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6977c269ceb8edc4298ee30193e8a838, type: 3} m_Name: ConjureArcadeMetadata m_EditorClassIdentifier: - gameTitle: Overmelted - version: 0.1.0 - description: An overcooked inspired game where you gotta work in team to smith - weapons, tools and armors for you clients. The levels are quick and packed with - action for up to two players + gameTitle: + version: + description: minNumPlayer: 1 - maxNumPlayer: 2 + maxNumPlayer: 1 useLeaderboard: 0 - thumbnail: {fileID: 2800000, guid: 4082b7995fb3a974fb4b5853d98e37fb, type: 3} - gameplayImage: {fileID: 2800000, guid: f77d9fb0ed4f7ad459db7c688a37d2f9, type: 3} - developers: - - Jimmy Tremblay-Bernier - genres: - - selectedGenre: 14 - - selectedGenre: 28 + thumbnail: {fileID: 0} + gameplayImage: {fileID: 0} + developers: [] + genres: [] id: diff --git a/Assets/InputActions/CommonInput.inputactions b/Assets/InputActions/CommonInput.inputactions index 90c68dd3..d55956d4 100644 --- a/Assets/InputActions/CommonInput.inputactions +++ b/Assets/InputActions/CommonInput.inputactions @@ -83,7 +83,7 @@ { "name": "", "id": "9cea3501-b3f2-45a9-a359-5ae29f83da77", - "path": "/button2", + "path": "/buttonB", "interactions": "", "processors": "", "groups": "", diff --git a/Assets/InputActions/GameMovementsPlayer.inputactions b/Assets/InputActions/GameMovementsPlayer.inputactions index 0ea7f9a7..b0568cfb 100644 --- a/Assets/InputActions/GameMovementsPlayer.inputactions +++ b/Assets/InputActions/GameMovementsPlayer.inputactions @@ -154,7 +154,7 @@ { "name": "", "id": "9d8d83a4-3c84-43f8-9803-b7b08077dbd4", - "path": "/button2", + "path": "/buttonB", "interactions": "", "processors": "", "groups": "", @@ -187,7 +187,7 @@ { "name": "", "id": "ac1c47b6-b41f-4497-a860-f9f9a9b77211", - "path": "/button1", + "path": "/buttonA", "interactions": "", "processors": "", "groups": "", @@ -253,7 +253,7 @@ { "name": "", "id": "9bbb6b94-304e-42b1-aa57-b4c8eadf99f9", - "path": "/buttonA", + "path": "/button1", "interactions": "", "processors": "", "groups": "", diff --git a/Assets/InputActions/MenuAction.inputactions b/Assets/InputActions/MenuAction.inputactions index f411f58d..b5666c05 100644 --- a/Assets/InputActions/MenuAction.inputactions +++ b/Assets/InputActions/MenuAction.inputactions @@ -342,7 +342,7 @@ { "name": "", "id": "f5a82c0f-021d-42d6-981e-316cf08c637f", - "path": "/button1", + "path": "/buttonA", "interactions": "", "processors": "", "groups": "", @@ -364,7 +364,7 @@ { "name": "", "id": "e4c84fc6-a05a-4d3b-891b-184add45ce56", - "path": "/button2", + "path": "/buttonB", "interactions": "", "processors": "", "groups": "", diff --git a/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta new file mode 100644 index 00000000..1eadf09a --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f597f19f656ba56eae4f6a3a7cc528f4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta new file mode 100644 index 00000000..f073d2ab --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 48e08dc33330d11e9d4a1b246c52e4f6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta new file mode 100644 index 00000000..130722af --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed09910c0094cb27be8f3ca264680da3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta new file mode 100644 index 00000000..f9b8ed82 --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc355dd4cf1e6173beaeb22c2858cbe1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index 76df49fb..ba414cea 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18382604, g: 0.22910279, b: 0.30390263, a: 1} + m_IndirectSpecularColor: {r: 0.1838259, g: 0.22910246, b: 0.30390218, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -1655,6 +1655,185 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 608319656} m_CullTransparentMesh: 1 +--- !u!1 &617175618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 617175619} + - component: {fileID: 617175621} + - component: {fileID: 617175620} + m_Layer: 5 + m_Name: Player 1 Joined + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &617175619 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617175618} + 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: 2016024506} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 250, y: -16} + m_SizeDelta: {x: 468, y: 76} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &617175620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617175618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Player 1 joined ! + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 6fd3fce24d136ae4797f32262ec8302f, type: 2} + m_sharedMaterial: {fileID: -2873484290195517144, guid: 6fd3fce24d136ae4797f32262ec8302f, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &617175621 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617175618} + m_CullTransparentMesh: 1 +--- !u!1 &653034372 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 653034374} + - component: {fileID: 653034373} + m_Layer: 0 + m_Name: ConjureGlobalObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &653034373 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 653034372} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 42abcca807f2495aa5d59ff8d0570ed6, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &653034374 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 653034372} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &703061944 PrefabInstance: m_ObjectHideFlags: 0 @@ -2492,6 +2671,7 @@ RectTransform: m_Children: - {fileID: 2059570993} - {fileID: 1639107555} + - {fileID: 2016024506} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -2697,6 +2877,276 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1264080388} m_PrefabAsset: {fileID: 0} +--- !u!1 &1278083584 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1278083585} + - component: {fileID: 1278083587} + - component: {fileID: 1278083586} + m_Layer: 5 + m_Name: Press start to join player 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1278083585 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1278083584} + 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: 2016024506} + 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.5, y: 1} +--- !u!114 &1278083586 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1278083584} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Press start to join + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 6fd3fce24d136ae4797f32262ec8302f, type: 2} + m_sharedMaterial: {fileID: -2873484290195517144, guid: 6fd3fce24d136ae4797f32262ec8302f, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1278083587 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1278083584} + m_CullTransparentMesh: 1 +--- !u!1 &1450148596 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1450148597} + - component: {fileID: 1450148599} + - component: {fileID: 1450148598} + m_Layer: 5 + m_Name: Player 2 Joined + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1450148597 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1450148596} + 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: 2016024506} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 250, y: -108} + m_SizeDelta: {x: 468, y: 76} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1450148598 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1450148596} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Player 2 joined ! + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 6fd3fce24d136ae4797f32262ec8302f, type: 2} + m_sharedMaterial: {fileID: -2873484290195517144, guid: 6fd3fce24d136ae4797f32262ec8302f, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1450148599 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1450148596} + m_CullTransparentMesh: 1 --- !u!1001 &1494503020 PrefabInstance: m_ObjectHideFlags: 0 @@ -2760,6 +3210,141 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1494503020} m_PrefabAsset: {fileID: 0} +--- !u!1 &1570887053 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1570887054} + - component: {fileID: 1570887056} + - component: {fileID: 1570887055} + m_Layer: 5 + m_Name: Press start to join player 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1570887054 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570887053} + 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: 2016024506} + 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.5, y: 1} +--- !u!114 &1570887055 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570887053} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Press start to join + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 6fd3fce24d136ae4797f32262ec8302f, type: 2} + m_sharedMaterial: {fileID: -2873484290195517144, guid: 6fd3fce24d136ae4797f32262ec8302f, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1570887056 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1570887053} + m_CullTransparentMesh: 1 --- !u!1 &1577695597 GameObject: m_ObjectHideFlags: 0 @@ -3125,6 +3710,197 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1848745370} m_PrefabAsset: {fileID: 0} +--- !u!1 &2016024505 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2016024506} + - component: {fileID: 2016024508} + - component: {fileID: 2016024507} + - component: {fileID: 2016024509} + - component: {fileID: 2016024511} + - component: {fileID: 2016024510} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2016024506 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2016024505} + 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: 617175619} + - {fileID: 1278083585} + - {fileID: 1450148597} + - {fileID: 1570887054} + m_Father: {fileID: 1027846844} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -16, y: -16} + m_SizeDelta: {x: 500, y: 200} + m_Pivot: {x: 1, y: 1} +--- !u!114 &2016024507 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2016024505} + 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: 0d6731c5aad4f4e03bea1c341e977c59, 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!222 &2016024508 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2016024505} + m_CullTransparentMesh: 1 +--- !u!114 &2016024509 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2016024505} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 16 + m_Right: 16 + m_Top: 16 + m_Bottom: 16 + m_ChildAlignment: 4 + m_Spacing: 16 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &2016024510 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2016024505} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f30bb439e6d7dc94489cd1be18593b0e, type: 3} + m_Name: + m_EditorClassIdentifier: + _binding: 0 + _disableAfterSubscribing: 0 + _eventResponses: + - _scriptableEvent: {fileID: 11400000, guid: 775e6442f86602642a56e8402cb9b5d9, type: 2} + _response: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2016024511} + m_TargetAssemblyTypeName: Conjure.JoinUi, Assembly-CSharp + m_MethodName: UpdateVisual + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &2016024511 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2016024505} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6cfeb73d1adc480bb87433ceaa1b5387, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: + - {fileID: 1278083584} + - {fileID: 617175618} + - {fileID: 1570887053} + - {fileID: 1450148596} + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: playerOneMenuLine + Entry: 7 + Data: Conjure.MenuLines, Assembly-CSharp + - Name: PlayerIsntJoined + Entry: 10 + Data: 0 + - Name: PlayerIsJoined + Entry: 10 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: playerTwoMenuLine + Entry: 7 + Data: Conjure.MenuLines, Assembly-CSharp + - Name: PlayerIsntJoined + Entry: 10 + Data: 2 + - Name: PlayerIsJoined + Entry: 10 + Data: 3 + - Name: + Entry: 8 + Data: + inputManagerServer: {fileID: 0} + inputManagerGameobjectReference: {fileID: 11400000, guid: 91b2b266283927a4c9955d2323f2f4f0, + type: 2} --- !u!1 &2059570992 GameObject: m_ObjectHideFlags: 0 @@ -3524,6 +4300,12 @@ PrefabInstance: value: objectReference: {fileID: 11400000, guid: 61292351fb9916c42bef4160a8a1370a, type: 2} + - target: {fileID: 1218421579596097871, guid: 887957dbf60490241a44f5d79130e883, + type: 3} + propertyPath: onUpdateAmountPlayer + value: + objectReference: {fileID: 11400000, guid: 775e6442f86602642a56e8402cb9b5d9, + type: 2} - target: {fileID: 1218421579596097871, guid: 887957dbf60490241a44f5d79130e883, type: 3} propertyPath: serializationData.Prefab @@ -3708,3 +4490,4 @@ SceneRoots: - {fileID: 522795076} - {fileID: 4449723} - {fileID: 8389972841784398942} + - {fileID: 653034374} diff --git a/Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset b/Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset new file mode 100644 index 00000000..07953841 --- /dev/null +++ b/Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ed2a53a13d3e4066b3ccfe94e017a207, type: 3} + m_Name: onUpdateAmountPlayer + m_EditorClassIdentifier: + _debugLogEnabled: 0 + _debugValue: 0 diff --git a/Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset.meta b/Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset.meta new file mode 100644 index 00000000..09e0bec0 --- /dev/null +++ b/Assets/ScriptableObjects/Events/onUpdateAmountPlayer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 775e6442f86602642a56e8402cb9b5d9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Conjure/Input/GameJoiner.cs b/Assets/Scripts/Conjure/Input/GameJoiner.cs index 27de91aa..b570d704 100644 --- a/Assets/Scripts/Conjure/Input/GameJoiner.cs +++ b/Assets/Scripts/Conjure/Input/GameJoiner.cs @@ -12,6 +12,8 @@ namespace Conjure.Input private ScriptableEventInt onJoinEvent; [Required, SerializeField] private ScriptableEventInt onLeaveEvent; + [Required, SerializeField] + private ScriptableEventInt onUpdateAmountPlayer; [SerializeField, Required] private InputServerReference inputManagerGameobjectReference; @@ -51,6 +53,7 @@ namespace Conjure.Input onJoinEvent.Raise((int)player); + onUpdateAmountPlayer.Raise(_inputManagerServer.GetNumberPlayers()); } public void Leave(InputAction.CallbackContext context) @@ -65,6 +68,7 @@ namespace Conjure.Input _inputManagerServer.UnregisterDevice(device.deviceId); onLeaveEvent.Raise((int)player); + onUpdateAmountPlayer.Raise(_inputManagerServer.GetNumberPlayers()); } } } diff --git a/Assets/Scripts/Conjure/JoinUi.cs b/Assets/Scripts/Conjure/JoinUi.cs index b9f9cc0d..c88bb5cb 100644 --- a/Assets/Scripts/Conjure/JoinUi.cs +++ b/Assets/Scripts/Conjure/JoinUi.cs @@ -6,11 +6,18 @@ using UnityEngine; namespace Conjure { + public struct MenuLines + { + public GameObject PlayerIsntJoined; + public GameObject PlayerIsJoined; + } + public class JoinUi : SerializedMonoBehaviour { [SerializeField, ReadOnly] private InputManagerServer inputManagerServer; [SerializeField, Required] private InputServerReference inputManagerGameobjectReference; - [SerializeField, Required] private EventListenerNoParam OnUpdateEvent; + [SerializeField, Required] private MenuLines playerOneMenuLine; + [SerializeField, Required] private MenuLines playerTwoMenuLine; private void Awake() { @@ -23,13 +30,23 @@ namespace Conjure throw new NullReferenceException($"inputManagerGameobjectReference shouldn't be null on {inputManagerGameobjectReference.name}"); } inputManagerServer = inputManagerGameobjectReference.Value.GetComponent(); - - //OnUpdateEvent.OnEventRaised(); } - private void UpdateVisual() + public void UpdateVisual(int numberPlayer) { - + SetElementAOrBVisible(playerOneMenuLine, numberPlayer >= 1); + SetElementAOrBVisible(playerTwoMenuLine, numberPlayer >= 2); + } + + /// + /// if true, A is visible and B hidden. If false, A is hidden and B visible + /// + /// + /// + private void SetElementAOrBVisible(MenuLines menuLines, bool isVisible) + { + menuLines.PlayerIsJoined.SetActive(isVisible); + menuLines.PlayerIsntJoined.SetActive(!isVisible); } } } \ No newline at end of file