Commit 0c0a0da3 authored by Jonas's avatar Jonas

Updating UI

parent 9da3f4f2
using System;
using System.Collections;
using System.Collections.Generic;
using _Game.Scripts.GameManager;
using _Game.Scripts.Observer;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class UpdateIngameUI : MonoBehaviour
{
[SerializeField]
private GameData data;
public Text player1name;
public Text player2name;
public Text player1score;
public Text player2score;
public Text timeLeftText;
public Countdown countdownTimer;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
player1name.color = data.player1.color;
player2name.color = data.player2.color;
player1score.text = (int)(data.player1.score) + "";
player2score.text = (int)(data.player2.score) + "";
timeLeftText.text = ((int) (countdownTimer.Duration - countdownTimer.CurrentTime)) + "";
}
private void OnEnable()
{
player1name.text = data.player1.name;
player2name.text = data.player2.name;
player1name.color = data.player1.color;
player2name.color = data.player2.color;
}
}
fileFormatVersion: 2
guid: 8e5cfe4c460a12e41a17329d30d3597e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -120,6 +120,85 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &129052180
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 129052181}
- component: {fileID: 129052183}
- component: {fileID: 129052182}
m_Layer: 10
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &129052181
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 129052180}
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: 1257584868}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 423.7, y: -0.000022888184}
m_SizeDelta: {x: 361.3, y: 87.4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &129052182
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 129052180}
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.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 44
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 4
m_MaxSize: 44
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: NameP1
--- !u!222 &129052183
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 129052180}
m_CullTransparentMesh: 0
--- !u!1 &164625559
GameObject:
m_ObjectHideFlags: 0
......@@ -195,6 +274,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 164625559}
m_CullTransparentMesh: 0
--- !u!1 &197329780
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 197329783}
- component: {fileID: 197329782}
- component: {fileID: 197329781}
m_Layer: 10
m_Name: Score
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &197329781
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 197329780}
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.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 44
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 4
m_MaxSize: 44
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: ScoreP2
--- !u!222 &197329782
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 197329780}
m_CullTransparentMesh: 0
--- !u!224 &197329783
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 197329780}
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: 1473541693}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -398, y: -66}
m_SizeDelta: {x: 361.3, y: 87.4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &410364131
GameObject:
m_ObjectHideFlags: 0
......@@ -274,6 +432,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410364131}
m_CullTransparentMesh: 0
--- !u!1 &841114350
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 841114353}
- component: {fileID: 841114352}
- component: {fileID: 841114351}
m_Layer: 10
m_Name: Score
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &841114351
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 841114350}
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.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 44
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 4
m_MaxSize: 44
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: ScoreP1
--- !u!222 &841114352
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 841114350}
m_CullTransparentMesh: 0
--- !u!224 &841114353
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 841114350}
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: 1257584868}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 423.7, y: -56.299984}
m_SizeDelta: {x: 361.3, y: 87.4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &971690065
GameObject:
m_ObjectHideFlags: 0
......@@ -286,6 +523,7 @@ GameObject:
- component: {fileID: 971690068}
- component: {fileID: 971690067}
- component: {fileID: 971690066}
- component: {fileID: 971690070}
m_Layer: 10
m_Name: Canvas
m_TagString: Untagged
......@@ -375,6 +613,25 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &971690070
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 971690065}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8e5cfe4c460a12e41a17329d30d3597e, type: 3}
m_Name:
m_EditorClassIdentifier:
data: {fileID: 11400000, guid: 03dc90f28ad25934eb09d2c34b73da28, type: 2}
player1name: {fileID: 129052182}
player2name: {fileID: 1919600096}
player1score: {fileID: 841114351}
player2score: {fileID: 197329781}
timeLeftText: {fileID: 410364133}
countdownTimer: {fileID: 11400000, guid: 40639211e190f5048a0415173c0ece66, type: 2}
--- !u!1 &1065310977
GameObject:
m_ObjectHideFlags: 0
......@@ -481,6 +738,8 @@ RectTransform:
m_Children:
- {fileID: 1766359777}
- {fileID: 1065310978}
- {fileID: 129052181}
- {fileID: 841114353}
m_Father: {fileID: 971690069}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -562,6 +821,8 @@ RectTransform:
m_Children:
- {fileID: 164625560}
- {fileID: 2132883416}
- {fileID: 1919600095}
- {fileID: 197329783}
m_Father: {fileID: 971690069}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -687,6 +948,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1766359776}
m_CullTransparentMesh: 0
--- !u!1 &1919600094
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1919600095}
- component: {fileID: 1919600097}
- component: {fileID: 1919600096}
m_Layer: 10
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1919600095
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1919600094}
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: 1473541693}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -398, y: 0}
m_SizeDelta: {x: 361.3, y: 87.4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1919600096
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1919600094}
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.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 44
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 4
m_MaxSize: 44
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: NameP2
--- !u!222 &1919600097
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1919600094}
m_CullTransparentMesh: 0
--- !u!1 &2132883415
GameObject:
m_ObjectHideFlags: 0
......
......@@ -44,7 +44,9 @@ namespace _Game.Scripts.GameManager {
public int RoundsPlayed { get; set; }
public void Reset() {
public void Reset()
{
IsSwitched = false;
RoundsPlayed = 0;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment