Skip to content

Commit 8244b99

Browse files
committed
Hide test
1 parent 2082fd8 commit 8244b99

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:026cc16090895fccf6986872589ab0129472754d2336647da1d6b17d0a5771e0
3-
size 19736
2+
oid sha256:9af454d928daae25e64d1f1592ad353a6ec85de9caf74f067322a0c065d31554
3+
size 19742

Assets/_Project/Scripts/Players/Player.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,38 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44

5-
public class Player : MonoBehaviour
6-
{
5+
public class Player : MonoBehaviour {
76

87

98
public string username;
109
public string avatarPath;
1110

1211

13-
public void Init(string username, string avatarPath)
12+
private void Awake ()
1413
{
14+
StartCoroutine (StartChecks ());
15+
}
16+
17+
public void Init (string username, string avatarPath)
18+
{
19+
Debug.Log ("Player.Init() username = " + username);
20+
1521
this.username = username;
1622
this.avatarPath = avatarPath;
1723
}
1824

25+
/**
26+
* Hide if no username
27+
*/
28+
IEnumerator StartChecks ()
29+
{
30+
yield return new WaitForSeconds (1f);
31+
32+
// you left your toys out
33+
if (username == null || username == "")
34+
gameObject.SetActive (false);
35+
}
36+
37+
1938

2039
}

0 commit comments

Comments
 (0)