feat: add initial People Playground mod development kit
This commit is contained in:
14
extracted_wiki_content/snippets/random_sprite_assignment.txt
Normal file
14
extracted_wiki_content/snippets/random_sprite_assignment.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
URL: https://wiki.studiominus.nl/snippets/assignTextures.html
|
||||
Title: People Playground Modding - Random sprite assignment
|
||||
==================================================
|
||||
|
||||
Random sprite assignment
|
||||
This code snippet shows how to set the sprites of an object that has a random sprite. Think of items like the Handcannon, Bowlingball, and Balloon🎈.
|
||||
//get the RandomSpriteBehaviour from the object (if it has one) and assign an array of your sprites to it
|
||||
Instance.GetComponent<RandomSpriteBehaviour>().sprites = new Sprite[]
|
||||
{
|
||||
ModAPI.LoadSprite("ball_1.png"),
|
||||
ModAPI.LoadSprite("ball_2.png"),
|
||||
ModAPI.LoadSprite("ball_3.png"),
|
||||
ModAPI.LoadSprite("ball_4.png"),
|
||||
};
|
||||
Reference in New Issue
Block a user