feat: add initial People Playground mod development kit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
URL: https://wiki.studiominus.nl/snippets/spawnParticle.html
|
||||
Title: People Playground Modding - Spawn particles on activation
|
||||
==================================================
|
||||
|
||||
Spawn particles on activation
|
||||
This code snippet shows how to spawn the built-in particle effects when the object is activated.
|
||||
ModAPI.Register(new Modification()
|
||||
{
|
||||
//set item details
|
||||
OriginalItem = ModAPI.FindSpawnable("Knife"),
|
||||
NameOverride = "Epic knife that sparks when you use it",
|
||||
DescriptionOverride = "not a single soul knows why this exists",
|
||||
ThumbnailOverride = ModAPI.LoadSprite("sparkknife_view.png"),
|
||||
|
||||
AfterSpawn = (Instance) =>
|
||||
{
|
||||
//add a UseEventTrigger and set its action
|
||||
Instance.AddComponent<UseEventTrigger>().Action = () => {
|
||||
//spawn an effect by the name of "Spark" at the transform position
|
||||
ModAPI.CreateParticleEffect("Spark", Instance.transform.position);
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user