action | R Documentation |
unifir_script
Build and execute a unifir_script
action(script, write = TRUE, exec = TRUE, quit = TRUE)
script |
The |
write |
Boolean: Write the generated script to a file? |
exec |
Boolean: Execute the script inside of the Unity project? Note
that if |
quit |
Boolean: Quit Unity after execution? |
If exec = FALSE
, the original unifir_script
object passed to
script
. If exec = TRUE
, the same unifir_script
object with its
props replaced by the C# they generate.
# 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() ) # Then add any number of props to it: script <- add_light(script) # Then call `action` to execute the script! if (interactive()) { action(script) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.