feat: add initial People Playground mod development kit

This commit is contained in:
2026-01-06 06:35:51 +03:00
parent b89c805060
commit 27da387c5a
1095 changed files with 40267 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
URL: https://wiki.studiominus.nl/snippets/backgroundScriptCreation.html
Title: People Playground Modding - Creating a background script
==================================================
Creating a background script
This code snippet shows how to create a background script.
using UnityEngine;
namespace Mod
{
public class Mod
{
public static void Main()
{
//tell the game that a component of this type should be created in the background
ModAPI.Register<CoolBackgroundScriptTime>();
}
}
//define a behaviour that will run in the background
//it will be attached to an otherwise empty gameobject floating in the scene, created when the catalog is first populated
public class CoolBackgroundScriptTime : MonoBehaviour
{
//treat it like any other component
void Update()
{
if (Input.GetKey(KeyCode.P))
ModAPI.Notify("gamer is holding the P key");
}
}
}