-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.cs
94 lines (78 loc) · 3.09 KB
/
Plugin.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using BepInEx;
using System;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using UnityEngine.XR;
using Utilla;
namespace Gorilla_Info
{
/// <summary>
/// This is your mod's main class.
/// </summary>
/* This attribute tells Utilla to look for [ModdedGameJoin] and [ModdedGameLeave] */
[ModdedGamemode]
[BepInDependency("org.legoandmars.gorillatag.utilla", "1.5.0")]
[BepInPlugin(PluginInfo.GUID, PluginInfo.Name, PluginInfo.Version)]
public class Plugin : BaseUnityPlugin
{
bool inRoom;
public GUIStyle guiStyle = new GUIStyle();
bool Done = true;
void Start()
{
/* A lot of Gorilla Tag systems will not be set up when start is called /*
/* Put code in OnGameInitialized to avoid null references */
Utilla.Events.GameInitialized += OnGameInitialized;
}
void OnEnable()
{
/* Set up your mod here */
/* Code here runs at the start and whenever your mod is enabled*/
HarmonyPatches.ApplyHarmonyPatches();
}
void OnDisable()
{
/* Undo mod setup here */
/* This provides support for toggling mods with ComputerInterface, please implement it :) */
/* Code here runs whenever your mod is disabled (including if it disabled on startup)*/
HarmonyPatches.RemoveHarmonyPatches();
}
void OnGameInitialized(object sender, EventArgs e)
{
/* Code here runs after the game initializes (i.e. GorillaLocomotion.Player.Instance != null) */
}
void Update()
{
/* Code here runs every frame when the mod is enabled */
}
/* This attribute tells Utilla to call this method when a modded room is joined */
[ModdedGamemodeJoin]
public void OnJoin(string gamemode)
{
/* Activate your mod here */
/* This code will run regardless of if the mod is enabled*/
inRoom = true;
}
/* This attribute tells Utilla to call this method when a modded room is left */
[ModdedGamemodeLeave]
public void OnLeave(string gamemode)
{
/* Deactivate your mod here */
/* This code will run regardless of if the mod is enabled*/
inRoom = false;
}
private void OnGUI()
{
guiStyle.fontSize = 20;
guiStyle.normal.textColor = Color.white;
if (Done)
{
GUI.Label(new Rect(5f, 45f, 120f, 60f), "Max Speed: " + GorillaLocomotion.Player.Instance.maxJumpSpeed, guiStyle);
GUI.Label(new Rect(5f, 25f, 120f, 60f), "Speed Mult: " + GorillaLocomotion.Player.Instance.jumpMultiplier, guiStyle);
GUI.Label(new Rect(5f, 65f, 120f, 60f), "Status: " + GorillaTagger.Instance.currentStatus, guiStyle);
GUI.Label(new Rect(5f, 5f, 120f, 60f), "Created By Starry", guiStyle);
}
}
}
}