Skip to main content

Playground

Playground is a development environment in Warudo that allows you to load custom scripts without creating a plugin mod. C# scripts (.cs files) put in the Playground folder will be automatically compiled and loaded by Warudo, and any changes to the scripts will also be automatically reloaded.

tip

Check out our Creating Your First Script tutorial to get started with Playground!

You can put any C# scripts in Playground, but for Warudo to recognize them, at least one class must inherit one of the entity types, i.e., a Node, an Asset, or a Plugin.

Environment Setup

You do not need an IDE to use Playground, but it is recommended to use one for code completion and syntax highlighting. We recommend JetBrains Rider or Visual Studio Code.

Then, download the .csproj file here and put it into the Playground directory inside your Warudo data folder (Menu → Open Data Folder). Open the file with your IDE, and you are good to go!

Entity Hot-reloading

Hot-reloading works by serializing the entity data, unloading the old entity type, loading and instantiating the new entity type, and then deserializing the old entity data. This process usually takes only a few seconds.

When hot-reloading completes, you should see a toast message indicating how many assets, nodes, or plugins have been reloaded.

tip

If you see an error, you can click on the toast message to see the compilation error.

Limitations

Playground has the following limitations:

  • You cannot (easily) use third-party DLLs or NuGet packages. We will improve this in the future.
  • You cannot add or reference Unity assets (e.g., prefabs, materials, textures) in Playground scripts (use plugin mods instead).

Contributions

Edit on Github
Last updated on 2024.06.17