From 7f3de517a43dd2a2fda85db60082e88953412611 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 24 Feb 2023 12:24:17 -0500 Subject: [PATCH] better round intro --- namedropper/Assets/Scenes/Game.unity | 209 +++++++++++++++++++++++++-- namedropper/Assets/Scripts/Game.cs | 38 +++++ namedropper/Assets/Scripts/Player.cs | 2 +- 3 files changed, 236 insertions(+), 13 deletions(-) diff --git a/namedropper/Assets/Scenes/Game.unity b/namedropper/Assets/Scenes/Game.unity index 468fc19..b075bca 100644 --- a/namedropper/Assets/Scenes/Game.unity +++ b/namedropper/Assets/Scenes/Game.unity @@ -219,6 +219,11 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 23665174} m_CullTransparentMesh: 1 +--- !u!1 &23812149 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + m_PrefabInstance: {fileID: 76032778} + m_PrefabAsset: {fileID: 0} --- !u!1 &64627487 GameObject: m_ObjectHideFlags: 0 @@ -236,7 +241,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &64627488 RectTransform: m_ObjectHideFlags: 0 @@ -475,7 +480,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 483.03 + value: 602.48 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -530,6 +535,8 @@ RectTransform: - {fileID: 64627488} - {fileID: 1559740738} - {fileID: 1393666120} + - {fileID: 924483019} + - {fileID: 1415156231} m_Father: {fileID: 1666960088} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -555,7 +562,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &119717090 RectTransform: m_ObjectHideFlags: 0 @@ -1025,6 +1032,11 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} m_PrefabInstance: {fileID: 9049015332794659158} m_PrefabAsset: {fileID: 0} +--- !u!1 &707823885 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + m_PrefabInstance: {fileID: 2050475643} + m_PrefabAsset: {fileID: 0} --- !u!1001 &714773755 PrefabInstance: m_ObjectHideFlags: 0 @@ -1332,7 +1344,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 483.03 + value: 602.48 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1435,6 +1447,85 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1 &924483018 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 924483019} + - component: {fileID: 924483021} + - component: {fileID: 924483020} + m_Layer: 5 + m_Name: Round # + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &924483019 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924483018} + 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_Children: [] + m_Father: {fileID: 107001399} + m_RootOrder: 7 + 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: -4.3, y: 109.68} + m_SizeDelta: {x: 167.5, y: 231.1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &924483020 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924483018} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: aceb68b22a47f0f4dbf70163ea752dad, type: 3} + m_FontSize: 95 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 300 + m_Alignment: 1 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 'Round 1:' +--- !u!222 &924483021 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924483018} + m_CullTransparentMesh: 1 --- !u!1 &974885548 GameObject: m_ObjectHideFlags: 0 @@ -1656,7 +1747,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1042264264 RectTransform: m_ObjectHideFlags: 0 @@ -2518,7 +2609,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0.4462726, b: 1, a: 1} + m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -2526,7 +2617,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 12800000, guid: b46f1d3bdf627d645a08de1c3a257a10, type: 3} + m_Font: {fileID: 12800000, guid: aceb68b22a47f0f4dbf70163ea752dad, type: 3} m_FontSize: 115 m_FontStyle: 0 m_BestFit: 0 @@ -2974,6 +3065,85 @@ Transform: m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} m_PrefabInstance: {fileID: 1414236332} m_PrefabAsset: {fileID: 0} +--- !u!1 &1415156230 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1415156231} + - component: {fileID: 1415156233} + - component: {fileID: 1415156232} + m_Layer: 5 + m_Name: Topic + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1415156231 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1415156230} + 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_Children: [] + m_Father: {fileID: 107001399} + m_RootOrder: 8 + 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: -4.3, y: 22} + m_SizeDelta: {x: 167.5, y: 231.1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1415156232 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1415156230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: aceb68b22a47f0f4dbf70163ea752dad, type: 3} + m_FontSize: 115 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 300 + m_Alignment: 1 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: D&D Monsters +--- !u!222 &1415156233 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1415156230} + m_CullTransparentMesh: 1 --- !u!1 &1439945299 GameObject: m_ObjectHideFlags: 0 @@ -3411,11 +3581,16 @@ MonoBehaviour: Score3: {fileID: 119717092} Score4: {fileID: 64627489} Timer: {fileID: 1225785573} + RoundNumber: {fileID: 924483020} + Topic: {fileID: 1415156232} CategoriesRound1: {fileID: 554321082} CategoriesRound2: {fileID: 1146299634} CategoriesRound3: {fileID: 1391939818} - _blueScoreStack: {fileID: 0} - _redScoreStack: {fileID: 0} + _players: + - {fileID: 1791992020} + - {fileID: 23812149} + - {fileID: 707823885} + - {fileID: 1777639902} --- !u!4 &1641253473 Transform: m_ObjectHideFlags: 0 @@ -3915,6 +4090,16 @@ Transform: m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} m_PrefabInstance: {fileID: 1747069998} m_PrefabAsset: {fileID: 0} +--- !u!1 &1777639902 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + m_PrefabInstance: {fileID: 881809258} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1791992020 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + m_PrefabInstance: {fileID: 9049015332794659158} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1801753663 PrefabInstance: m_ObjectHideFlags: 0 @@ -4093,7 +4278,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1957998282 RectTransform: m_ObjectHideFlags: 0 @@ -4496,7 +4681,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 483.03 + value: 602.48 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -4925,7 +5110,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 483.03 + value: 602.48 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/namedropper/Assets/Scripts/Game.cs b/namedropper/Assets/Scripts/Game.cs index f1080fb..edbcf8a 100644 --- a/namedropper/Assets/Scripts/Game.cs +++ b/namedropper/Assets/Scripts/Game.cs @@ -1,5 +1,6 @@ using UnityEngine; using System.Collections; +using System.Collections.Generic; using UnityEngine.UI; using UnityEngine.SceneManagement; @@ -12,11 +13,15 @@ public class Game : MonoBehaviour [SerializeField] Text Score3; [SerializeField] Text Score4; [SerializeField] Text Timer; + [SerializeField] Text RoundNumber; + [SerializeField] Text Topic; [SerializeField] GameObject CategoriesRound1; [SerializeField] GameObject CategoriesRound2; [SerializeField] GameObject CategoriesRound3; + [SerializeField] List _players; + ScoreStack _blueScoreStack; ScoreStack _redScoreStack; @@ -106,8 +111,41 @@ public class Game : MonoBehaviour Score4.gameObject.SetActive(false); } } + + RoundNumber.text = "Round " + GameManager.Instance.Round.ToString(); + Topic.text = GameDataManager.Instance.CurrentTopic.Topic; + + ActivatePlayers(false); + StartCoroutine("StartupProcess"); } + IEnumerator StartupProcess() + { + Topic.gameObject.SetActive(false); + yield return new WaitForSeconds(1f); + Topic.gameObject.SetActive(true); + yield return new WaitForSeconds(2f); + RoundNumber.text = ""; + Topic.text = "GO!"; + ActivatePlayers(true); + yield return new WaitForSeconds(1f); + Topic.gameObject.SetActive(false); + } + + void StartGame() + { + ActivatePlayers(true); + RoundNumber.gameObject.SetActive(false); + Topic.gameObject.SetActive(false); + } + + void ActivatePlayers(bool value) + { + foreach (GameObject player in _players) + { + player.SetActive(value); + } + } IEnumerator Countdown() { while (_seconds > 0) diff --git a/namedropper/Assets/Scripts/Player.cs b/namedropper/Assets/Scripts/Player.cs index 3d2fb47..31988f6 100644 --- a/namedropper/Assets/Scripts/Player.cs +++ b/namedropper/Assets/Scripts/Player.cs @@ -205,7 +205,7 @@ public class Player : MonoBehaviour if (topicBox != null) { GameDataManager.Instance.CurrentTopic = topicBox.TopicData; - SceneManager.LoadScene("RoundIntro"); + SceneManager.LoadScene("Game"); } }