Browse Source

loser picks topic

A
Josh 2 years ago
parent
commit
8a212338e3
  1. 111
      namedropper/Assets/Scenes/TopicSelect.unity
  2. 58
      namedropper/Assets/Scripts/TopicSelect.cs

111
namedropper/Assets/Scenes/TopicSelect.unity

@ -167,6 +167,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1225785572} - {fileID: 1225785572}
- {fileID: 277092717}
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}
@ -333,6 +334,90 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 261236785} m_PrefabInstance: {fileID: 261236785}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &261236787 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 261236785}
m_PrefabAsset: {fileID: 0}
--- !u!1 &277092716
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 277092717}
- component: {fileID: 277092719}
- component: {fileID: 277092718}
m_Layer: 5
m_Name: Subtitle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &277092717
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277092716}
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: 1
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: 80.1}
m_SizeDelta: {x: 167.5, y: 231.1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &277092718
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277092716}
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.4462726, 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_FontData:
m_Font: {fileID: 12800000, guid: aceb68b22a47f0f4dbf70163ea752dad, type: 3}
m_FontSize: 56
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: 1
m_LineSpacing: 1
m_Text: Pick a Topic
--- !u!222 &277092719
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277092716}
m_CullTransparentMesh: 1
--- !u!1 &868125098 --- !u!1 &868125098
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -546,6 +631,11 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 1003872900} m_PrefabInstance: {fileID: 1003872900}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1003872902 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 1003872900}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1192266242 --- !u!1001 &1192266242
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -716,6 +806,11 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 1192266242} m_PrefabInstance: {fileID: 1192266242}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1192266244 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 1192266242}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1225785571 --- !u!1 &1225785571
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -774,7 +869,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
@ -786,9 +881,7 @@ MonoBehaviour:
m_HorizontalOverflow: 1 m_HorizontalOverflow: 1
m_VerticalOverflow: 1 m_VerticalOverflow: 1
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: 'Round 1 m_Text: Round 1
Pick a Topic'
--- !u!222 &1225785574 --- !u!222 &1225785574
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1033,6 +1126,11 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} m_CorrespondingSourceObject: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 1272407093} m_PrefabInstance: {fileID: 1272407093}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1272407095 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
m_PrefabInstance: {fileID: 1272407093}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1439945299 --- !u!1 &1439945299
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1166,6 +1264,11 @@ MonoBehaviour:
_topic2Box: {fileID: 1500576227} _topic2Box: {fileID: 1500576227}
_topic3Box: {fileID: 18155122} _topic3Box: {fileID: 18155122}
_title: {fileID: 1225785573} _title: {fileID: 1225785573}
_subTitle: {fileID: 277092718}
_player1: {fileID: 261236787}
_player2: {fileID: 1272407095}
_player3: {fileID: 1192266244}
_player4: {fileID: 1003872902}
--- !u!4 &1641253473 --- !u!4 &1641253473
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

58
namedropper/Assets/Scripts/TopicSelect.cs

@ -9,7 +9,15 @@ public class TopicSelect : MonoBehaviour
[SerializeField] TopicBox _topic2Box; [SerializeField] TopicBox _topic2Box;
[SerializeField] TopicBox _topic3Box; [SerializeField] TopicBox _topic3Box;
[SerializeField] Text _title; [SerializeField] Text _title;
[SerializeField] Text _subTitle;
[SerializeField] GameObject _player1;
[SerializeField] GameObject _player2;
[SerializeField] GameObject _player3;
[SerializeField] GameObject _player4;
const bool WORST_PLAYER_PICKS = true;
// Start is called before the first frame update // Start is called before the first frame update
void Awake() void Awake()
{ {
@ -18,7 +26,55 @@ public class TopicSelect : MonoBehaviour
void InitRound() void InitRound()
{ {
_title.text = "Round " + GameManager.Instance.Round + "\nPick a Topic!"; _title.text = "Round " + GameManager.Instance.Round;
if (WORST_PLAYER_PICKS)
{
string worstPlayerName = "";
int worstScore = int.MaxValue;
int worstPlayerNumber = 0;
if (GameManager.Instance.Score1 < worstScore)
{
worstScore = GameManager.Instance.Score1;
worstPlayerName = "light blue";
worstPlayerNumber = 1;
}
if (GameManager.Instance.Score2 < worstScore)
{
worstScore = GameManager.Instance.Score2;
worstPlayerName = "dark blue";
worstPlayerNumber = 2;
}
if (GameManager.Instance.Score3 < worstScore)
{
worstScore = GameManager.Instance.Score3;
worstPlayerName = "dark red";
worstPlayerNumber = 3;
}
if (GameManager.Instance.Score4 < worstScore)
{
worstScore = GameManager.Instance.Score4;
worstPlayerName = "light red";
worstPlayerNumber = 4;
}
if (worstPlayerNumber != 1)
GameObject.Destroy(_player1);
if (worstPlayerNumber != 2)
GameObject.Destroy(_player2);
if (worstPlayerNumber != 3)
GameObject.Destroy(_player3);
if (worstPlayerNumber != 4)
GameObject.Destroy(_player4);
_subTitle.text = worstPlayerName + "\nmay pick the topic";
}
else
{
_subTitle.text = "Pick a topic!";
}
_topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData();

Loading…
Cancel
Save