Skip to content

Commit

Permalink
Remove counter panel for replays
Browse files Browse the repository at this point in the history
Fix a bug where PlayerBoard try to create an existing variable
Add Graphic Raycaster to UserCanvas
  • Loading branch information
M6stafa committed Sep 19, 2019
1 parent 2e28a13 commit a970590
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Assets/Koala/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class GameManager : MonoBehaviour

public void Awake()
{
if (Helper.ReplayMode)
m_startGamePanel.SetActive(false);

// Setup timeline
Timeline.Instance.Reset();

Expand Down Expand Up @@ -370,6 +373,13 @@ private void CreateDetailCell(string text, TextAlignmentOptions alignment, Trans

private IEnumerator StartGameCounter(int startTime)
{
if (Helper.ReplayMode)
{
Helper.GameStarted = true;
Destroy(m_startGamePanel);
yield break;
}

yield return null;

TextMeshProUGUI text = m_startGamePanel.GetComponentInChildren<TextMeshProUGUI>();
Expand Down
3 changes: 2 additions & 1 deletion Assets/Koala/Scripts/PlayersBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public void Init(Dictionary<string, List<string>> sides, Dictionary<string, stri
contrastColors[side] = bgColor.ContrastColor();

string varName = $"{side}NamesTeam";
Helper.GlobalBlackboard.AddVariable(varName, typeof(Dictionary<string, string>));
if (Helper.GlobalBlackboard[varName] == null)
Helper.GlobalBlackboard.AddVariable(varName, typeof(Dictionary<string, string>));
Helper.GlobalBlackboard[varName] = new Dictionary<string, string>();
foreach (var name in sides[side])
(Helper.GlobalBlackboard[varName] as IDictionary)[name] = "-";
Expand Down
18 changes: 18 additions & 0 deletions Assets/Koala/_Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,7 @@ GameObject:
- component: {fileID: 1100095216}
- component: {fileID: 1100095215}
- component: {fileID: 1100095214}
- component: {fileID: 1100095217}
m_Layer: 5
m_Name: UserCanvas
m_TagString: Untagged
Expand Down Expand Up @@ -2603,6 +2604,23 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1100095217
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1100095213}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1001 &1180810041
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down

0 comments on commit a970590

Please sign in to comment.