-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
73 lines (59 loc) · 2.05 KB
/
Plugin.cs
File metadata and controls
73 lines (59 loc) · 2.05 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
72
73
using BepInEx;
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace OnwardForeverMod
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
public bool DisableSplashController = false;
private void Awake()
{
// Plugin startup logic
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
//// Setup an object to load the new APIs
new GameObject().AddComponent<SetupNewAPIs>();
//// Destroy the splash screen loader so DPI doesn't get credit
//var splashController = GameObject.FindObjectOfType<SplashController>();
//if(DisableSplashController && splashController != null)
// GameObject.DestroyImmediate(splashController);
//// Add a skip splash screen game object
//new GameObject().AddComponent<SkipSplashScreen>();
GameObject.DontDestroyOnLoad(this);
}
}
//public class SkipSplashScreen : MonoBehaviour
//{
// private AsyncOperation asyncOp;
// private IEnumerator Start()
// {
// LoadNewScene.LoadRandomMenu(out this.asyncOp);
// this.asyncOp.allowSceneActivation = true;
// yield return new WaitForEndOfFrame();
// yield return new WaitForSeconds(0.01f);
// GameObject.Destroy(this.gameObject);
// yield break;
// }
//}
public class SetupNewAPIs : MonoBehaviour
{
private static string pluginPath = "BepInEx/plugins/";
private void Awake()
{
GameObject.DontDestroyOnLoad(this);
}
private void Update()
{
if(PhotonNetwork.PhotonServerSettings != null)
{
string newAppId = System.IO.File.ReadAllText(pluginPath + "photon_app_id.txt");
string newVoiceAppId = System.IO.File.ReadAllText(pluginPath + "photon_app_id.txt");
PhotonNetwork.PhotonServerSettings.AppID = newAppId;
PhotonNetwork.PhotonServerSettings.VoiceAppID = newVoiceAppId;
Debug.Log("Success -> We have modded the photon server settings to the our photon server");
this.gameObject.SetActive(false);
}
}
}
}