Skip to contents

Load a scene in a Unity project.

Usage

load_scene(script, scene_name, method_name = NULL, exec = TRUE)

Arguments

script

A unifir_script object, created by make_script or returned by an add_prop_* function.

scene_name

The name of the scene to load.

method_name

The internal name to use for the C# method created. Will be randomly generated if not set.

exec

Logical: Should the C# method be included in the set executed by MainFunc?

Examples

# First, create a script object.
# CRAN doesn't have Unity installed, so pass
# a waiver object to skip the Unity-lookup stage:
script <- make_script("example_script", unity = waiver())

# Now add props:
script <- load_scene(script, scene_name = "some_scene")

# Lastly, execute the script via the `action` function