Skip to contents

unifir relies upon "script" objects, which collect "prop" objects (C# methods) which then may be executed within a Unity project via the action function.

Usage

make_script(
  project,
  script_name = NULL,
  scene_name = NULL,
  unity = find_unity(),
  initialize_project = NULL
)

Arguments

project

The directory path of the Unity project.

script_name

The file name to save the script at. The folder location and file extensions will be added automatically.

scene_name

The default scene to operate within. If a function requires a scene name and one is not provided, this field will be used.

unity

The location of the Unity executable to create projects with.

initialize_project

If TRUE, will call create_unity_project to create a Unity project at project. If FALSE, will not create a new project. If NULL, will create a new project if project does not exist.

Value

A unifir_script object.

Examples

# Create an empty script file
# In practice, you'll want to set `project` to the project path to create
# and `unity` to `NULL` (the default)
make_script(project = waiver(), unity = waiver())
#> <environment: 0x555a4aa70900>
#> attr(,"class")
#> [1] "unifir_script"