| add_texture {unifir} | R Documentation |
Add a Texture2D layer to a terrain tile object
Description
This function adds a helper method, AddTexture, to the
C# script. This function is typically used to add textures to
heightmaps in a Unity scene, for instance by functions
like create_terrain. It requires some arguments be provided
at the C# level, and so is almost always called with exec = FALSE.
Usage
add_texture(script, method_name = NULL, exec = FALSE)
Arguments
script |
A |
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? |
Value
The unifir_script object passed to script, with an AddTexture
method appended.
See Also
Other props:
add_default_player(),
add_light(),
add_prop(),
create_terrain(),
import_asset(),
instantiate_prefab(),
load_png(),
load_scene(),
new_scene(),
read_raw(),
save_scene(),
set_active_scene(),
validate_path()
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 <- add_texture(script)
# Lastly, execute the script via the `action` function