-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
71 lines (62 loc) · 1.62 KB
/
Copy pathPlugin.cs
File metadata and controls
71 lines (62 loc) · 1.62 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using BepInEx;
using UnityEngine;
using TMPro;
using System.Threading.Tasks;
using System.Collections;
namespace PolandTrackerMod
{
[BepInPlugin(PluginInfo.GUID, PluginInfo.Name, PluginInfo.Version)]
public class Plugin : BaseUnityPlugin
{
async void Start()
{
//StartCoroutine(CoRutinneStart());
//LocalButton.StartButtons();
await Task.Delay(3000);
board.Init();
board.SetLoading();
await Task.Delay(2000);
_ = Task.Run(() =>
{
initialized = true;
_ = parsing.EventSource();
});
}
public static bool initialized = false;
/*IEnumerator CoRutinneStart()
{
yield return new WaitForSeconds(5f);
board.Init();
board.SetLoading();
yield return new WaitForSeconds(2f);
Task.Run(() => parsing.EventSource());
}*/
void Update()
{
lock (parsing._queue)
{
while (parsing._queue.Count > 0)
{
string data = parsing._queue.Dequeue();
board.SetCOCText(parsing.JsonToBoards(data));
}
}
}
async void Awake()
{
await Task.Delay(2000);
if (initialized) board.Init();
}
void OnGUI()
{
if (GUI.Button(new Rect (Screen.width - 100,Screen.height - 50,100,50), "PolandTrackerMod"))
{
board.COCText = GameObject.Find("Environment Objects/LocalObjects_Prefab/TreeRoom/COCBodyText_TitleData").GetComponent<TextMeshPro>();
board.CodeOfConductText = GameObject.Find("Environment Objects/LocalObjects_Prefab/TreeRoom/CodeOfConductHeadingText").GetComponent<TextMeshPro>();
board.Init();
_ = Task.Run(() => parsing.EventSource());
}
}
}
}