-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugCheats.cs
More file actions
31 lines (28 loc) · 907 Bytes
/
DebugCheats.cs
File metadata and controls
31 lines (28 loc) · 907 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
30
31
using Il2CppNPC;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using UnityEngine;
namespace StreamSideResearch
{
internal class DebugCheats(MelonLogger.Instance logger)
{
public void Spawn(NPCType npcType)
{
var npcManager = Object.FindObjectOfType<NPCManager>();
if (npcManager != null)
{
var preSpawnedList = new List<StateMachine>();
var networkObject = npcManager.PreSpawnNPC(preSpawnedList, npcType, NPCBodyType.Random);
if (networkObject != null)
{
npcManager.SpawnNPC(preSpawnedList);
logger.Msg($"Spawned {npcType} in the world!");
}
else
{
logger.Warning($"PreSpawnNPC returned null for {npcType}");
}
}
}
}
}