-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatchManagerFinder.cs
42 lines (36 loc) · 1.32 KB
/
MatchManagerFinder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class MatchManagerFinder : MonoBehaviour
{
public GameObject MyMatchManager;
public GameObject LoadingPanel;
public bool isErrorText = false;
// Script is used to find MatchManager object in the scene
// It also contains some common functions used by objects looking for MatchManager
void Update ()
{
if (MyMatchManager == null)
{
MyMatchManager = GameObject.FindGameObjectWithTag("MatchManager");
if (isErrorText)
MyMatchManager.GetComponent<RoomHandlerCode>().ErrorText = this.gameObject.GetComponent<TextMeshProUGUI>();
}
}
public void RemoteButtonDoScript()
{
MyMatchManager.GetComponent<RoomHandlerCode>().LoadingPanel = LoadingPanel;
MyMatchManager.GetComponent<RoomHandlerCode>().ButtonDoScript();
}
public void RemoteButtonQuickPlay()
{
MyMatchManager.GetComponent<RoomHandlerCode>().LoadingPanel = LoadingPanel;
MyMatchManager.GetComponent<RoomHandlerCode>().ButtonQuickPlay();
}
public void RemoteButtonStartServer()
{
MyMatchManager.GetComponent<RoomHandlerCode>().LoadingPanel = LoadingPanel;
MyMatchManager.GetComponent<RoomHandlerCode>().ButtonStartServer();
}
}