Decompiled source of MyCustomMod v1.0.1

BepInEx/plugins/MyCustomMod/MyCustomMod.dll

Decompiled 2 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("MyCustomMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MyCustomMod")]
[assembly: AssemblyTitle("MyCustomMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.yourname.mymod", "My Custom Mod", "1.0.0")]
public class MyCustomMod : BaseUnityPlugin
{
	private bool employeeCreated = false;

	private void Start()
	{
		((MonoBehaviour)this).StartCoroutine(WaitForGameToStart());
	}

	private IEnumerator WaitForGameToStart()
	{
		while ((Object)(object)GameData.Instance == (Object)null || !IsGameStarted())
		{
			yield return (object)new WaitForSeconds(5f);
		}
		if (!employeeCreated)
		{
			NPC_Manager instance = NPC_Manager.Instance;
			instance.maxEmployees++;
			NPC_Manager.Instance.UpdateEmployeesNumberInBlackboard();
			Debug.Log((object)("Employee created after game started! Total employees: " + NPC_Manager.Instance.maxEmployees));
			employeeCreated = true;
		}
	}

	private bool IsGameStarted()
	{
		return GameData.Instance.gameFunds > 0f;
	}
}