Skip to content

Commit 2803c38

Browse files
committed
Adding instructions for RNSM
1 parent 260a6a9 commit 2803c38

File tree

11 files changed

+414
-248
lines changed

11 files changed

+414
-248
lines changed

Assets/BossRoom/Scenes/Startup.unity

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:8ee50ac1c26cea3b680be81ce2cd25f71cfb81d2aba573c79ed188e55f3b2518
3-
size 47284
2+
oid sha256:57ebb73c6fac9cb948a60578d22c0c76ac8980c78e51e261e867c06eeb10013e
3+
size 46492

Packages/com.unity.multiplayer.samples.coop/Utilities/Net/NetStatsMonitorCustomization.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

Packages/com.unity.multiplayer.samples.coop/Utilities/Net/NetStatsMonitorPrefab.prefab

Lines changed: 0 additions & 209 deletions
This file was deleted.

Packages/com.unity.multiplayer.samples.coop/Utilities/Net/RNSM.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections;
2+
using UnityEngine;
3+
4+
public class AutoHide : MonoBehaviour
5+
{
6+
[SerializeField]
7+
float m_TimeToHideSeconds = 5f;
8+
9+
// Start is called before the first frame update
10+
void Start()
11+
{
12+
StartCoroutine(HideAfterSeconds());
13+
}
14+
15+
IEnumerator HideAfterSeconds()
16+
{
17+
yield return new WaitForSeconds(m_TimeToHideSeconds);
18+
gameObject.SetActive(false);
19+
}
20+
}

Packages/com.unity.multiplayer.samples.coop/Utilities/Net/RNSM/AutoHide.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using Unity.Multiplayer.Tools.NetStatsMonitor;
2+
using UnityEngine;
3+
4+
namespace Unity.Multiplayer.Samples.Utilities.ClientAuthority
5+
{
6+
public class NetStatsMonitorCustomization : MonoBehaviour
7+
{
8+
[SerializeField]
9+
RuntimeNetStatsMonitor m_Monitor;
10+
11+
const int k_NbTouchesToOpenWindow = 3;
12+
13+
void Start()
14+
{
15+
m_Monitor.enabled = false;
16+
}
17+
18+
void Update()
19+
{
20+
if (Input.GetKeyUp(KeyCode.S) || Input.touchCount == k_NbTouchesToOpenWindow && AnyTouchDown())
21+
{
22+
m_Monitor.enabled = !m_Monitor.enabled; // toggle
23+
}
24+
}
25+
26+
static bool AnyTouchDown()
27+
{
28+
foreach (var touch in Input.touches)
29+
{
30+
if (touch.phase == TouchPhase.Began)
31+
{
32+
return true;
33+
}
34+
}
35+
36+
return false;
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)