-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup.cs
More file actions
29 lines (28 loc) · 802 Bytes
/
Setup.cs
File metadata and controls
29 lines (28 loc) · 802 Bytes
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
using BepInEx;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace RandomizerMod
{
[BepInPlugin("ru.Mxyfell.Randomizer", "Randomizer", "1.0.0")]
public class Setup : BaseUnityPlugin
{
public static Setup Instance;
public AudioSource audS;
void Start()
{
Instance = this;
SceneManager.sceneLoaded += OnSceneLoaded;
}
void OnDestroy()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
}
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
GameObject System = new GameObject("System");
System.AddComponent<Generate>();
System.AddComponent<EventSystem>();
audS = System.AddComponent<AudioSource>();
}
}
}