The Core is the root class for most of the SILVIA API classes and methods outlined below, and also has some of its own methods under the dot (“.”) syntax. In order to get to the other API sections, you must first reference the Core.
Example Usage (C#)
//Example use of Core reference to get into ApiApp()
_core.ApiApp().ConsoleOut("Core is called _core in internal SILVIA scripts.");
In SILVIA’s internal scripts, the Core reference is always spelled “_core”. In external scripts, you can define a public SilviaCore and store or pass a reference to it. SilviaCore references are not visible in the Unity Inspector, but they do exist and their presence can be confirmed in C# scripts. Core commands coming from outside can use whatever public reference name you choose.
Our team has found it useful to keep any external reference to the SilviaCore as “Core” with a capital C, although generally in Unity you want to start any public variables with lowercase letters to avoid confusion with other Types. This helps keep a distinction between code written for SILVIA to be used internally versus externally.
Sets the “created” bool for the referenced SILVIA Core.
Sets a declared Variable name in the SILVIA Core.
Returns the string value of a given Variable in the SILVIA Core. Can be parsed to other types thereafter.
Parses and returns an int value from a given Variable in the SILVIA Core, if any.
Parses and returns a float value from a given Variable in the SILVIA Core, if any.
Adds a Timed Function to the Core using a Method in SILVIA Brain File Scripts.
Adds a Variable Timed Function to the Core using a Method in SILVIA Brain File Scripts.
Removes a Timed Function from the Core by name, canceling it. Core.SetActiveTimedFunctionEndTime Sets a new End Time for the named Timed Function.
Sets a new Period length for the named Timed Function. The Function must be set to Periodic
Sets a new Minimum Period length for the named Time Function. Minimum Periods only apply to Variable Timed Functions.
Sets whether the named Timed Function is Periodic or recurring.
Sets whether the named Timed Function is Variable. Variable Timed