Browse Source

better round intro

A
Josh 2 years ago
parent
commit
7f3de517a4
  1. 209
      namedropper/Assets/Scenes/Game.unity
  2. 38
      namedropper/Assets/Scripts/Game.cs
  3. 2
      namedropper/Assets/Scripts/Player.cs

209
namedropper/Assets/Scenes/Game.unity

@ -219,6 +219,11 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 23665174} m_GameObject: {fileID: 23665174}
m_CullTransparentMesh: 1 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 --- !u!1 &64627487
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -236,7 +241,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &64627488 --- !u!224 &64627488
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -475,7 +480,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 483.03 value: 602.48
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
@ -530,6 +535,8 @@ RectTransform:
- {fileID: 64627488} - {fileID: 64627488}
- {fileID: 1559740738} - {fileID: 1559740738}
- {fileID: 1393666120} - {fileID: 1393666120}
- {fileID: 924483019}
- {fileID: 1415156231}
m_Father: {fileID: 1666960088} m_Father: {fileID: 1666960088}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -555,7 +562,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &119717090 --- !u!224 &119717090
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1025,6 +1032,11 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 9049015332794659158} m_PrefabInstance: {fileID: 9049015332794659158}
m_PrefabAsset: {fileID: 0} 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 --- !u!1001 &714773755
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1332,7 +1344,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 483.03 value: 602.48
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
@ -1435,6 +1447,85 @@ SpriteRenderer:
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0 m_MaskInteraction: 0
m_SpriteSortPoint: 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 --- !u!1 &974885548
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1656,7 +1747,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &1042264264 --- !u!224 &1042264264
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2518,7 +2609,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} 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_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
@ -2526,7 +2617,7 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: b46f1d3bdf627d645a08de1c3a257a10, type: 3} m_Font: {fileID: 12800000, guid: aceb68b22a47f0f4dbf70163ea752dad, type: 3}
m_FontSize: 115 m_FontSize: 115
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 0 m_BestFit: 0
@ -2974,6 +3065,85 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3}
m_PrefabInstance: {fileID: 1414236332} m_PrefabInstance: {fileID: 1414236332}
m_PrefabAsset: {fileID: 0} 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 --- !u!1 &1439945299
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3411,11 +3581,16 @@ MonoBehaviour:
Score3: {fileID: 119717092} Score3: {fileID: 119717092}
Score4: {fileID: 64627489} Score4: {fileID: 64627489}
Timer: {fileID: 1225785573} Timer: {fileID: 1225785573}
RoundNumber: {fileID: 924483020}
Topic: {fileID: 1415156232}
CategoriesRound1: {fileID: 554321082} CategoriesRound1: {fileID: 554321082}
CategoriesRound2: {fileID: 1146299634} CategoriesRound2: {fileID: 1146299634}
CategoriesRound3: {fileID: 1391939818} CategoriesRound3: {fileID: 1391939818}
_blueScoreStack: {fileID: 0} _players:
_redScoreStack: {fileID: 0} - {fileID: 1791992020}
- {fileID: 23812149}
- {fileID: 707823885}
- {fileID: 1777639902}
--- !u!4 &1641253473 --- !u!4 &1641253473
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3915,6 +4090,16 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3}
m_PrefabInstance: {fileID: 1747069998} m_PrefabInstance: {fileID: 1747069998}
m_PrefabAsset: {fileID: 0} 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 --- !u!1001 &1801753663
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4093,7 +4278,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &1957998282 --- !u!224 &1957998282
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4496,7 +4681,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 483.03 value: 602.48
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
@ -4925,7 +5110,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 483.03 value: 602.48
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x

38
namedropper/Assets/Scripts/Game.cs

@ -1,5 +1,6 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
@ -12,11 +13,15 @@ public class Game : MonoBehaviour
[SerializeField] Text Score3; [SerializeField] Text Score3;
[SerializeField] Text Score4; [SerializeField] Text Score4;
[SerializeField] Text Timer; [SerializeField] Text Timer;
[SerializeField] Text RoundNumber;
[SerializeField] Text Topic;
[SerializeField] GameObject CategoriesRound1; [SerializeField] GameObject CategoriesRound1;
[SerializeField] GameObject CategoriesRound2; [SerializeField] GameObject CategoriesRound2;
[SerializeField] GameObject CategoriesRound3; [SerializeField] GameObject CategoriesRound3;
[SerializeField] List<GameObject> _players;
ScoreStack _blueScoreStack; ScoreStack _blueScoreStack;
ScoreStack _redScoreStack; ScoreStack _redScoreStack;
@ -106,8 +111,41 @@ public class Game : MonoBehaviour
Score4.gameObject.SetActive(false); 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() IEnumerator Countdown()
{ {
while (_seconds > 0) while (_seconds > 0)

2
namedropper/Assets/Scripts/Player.cs

@ -205,7 +205,7 @@ public class Player : MonoBehaviour
if (topicBox != null) if (topicBox != null)
{ {
GameDataManager.Instance.CurrentTopic = topicBox.TopicData; GameDataManager.Instance.CurrentTopic = topicBox.TopicData;
SceneManager.LoadScene("RoundIntro"); SceneManager.LoadScene("Game");
} }
} }

Loading…
Cancel
Save