14 lines
556 B
Plaintext
14 lines
556 B
Plaintext
URL: https://wiki.studiominus.nl/snippets/activation.html
|
|
Title: People Playground Modding - Activation action
|
|
==================================================
|
|
|
|
Activation action
|
|
This code snippet shows how to execute code when the player activates the object.
|
|
//add a built-in component that invokes a delegate when the item receives an activation signal
|
|
Instance.AddComponent<UseEventTrigger>().Action = () =>
|
|
{
|
|
//everything inside this delegate will be executed
|
|
|
|
//show a notification to the player
|
|
ModAPI.Notify("I'VE BEEN USED!");
|
|
}; |