Scriptable Objects
This page presents functionalities provided by Grail Unity Plugin’s scriptable objects.
Internal Scriptable Objects
Those scriptable objects do not need to be overridden. User can create instances of those objects by right-clicking on project view and selecting Create → Grail → <name_of_scriptable_object>.
Grail Configuration Loader
Scriptable object responsible for loading Grail config file and storing its data.
The user chooses which file this object should be responsible for and then provides it with ReasonerFactories
and/or behavior and consideration repositories so it will be able to instantiate default factory producing UtilityReasoners
.

Behavior Repository
Set of all available BehaviorProviders
associated with at least one configuration file.
User can use one monolithic BehaviorRepository
for all behaviors from multiple configuration files or use one repository per file.
Nevertheless, each BehaviorRepository
must contain all BehaviorProviders
defined in given file.

Consideration Repository
Set of all available ConsiderationProviders
associated with at least one configuration file.
User can use one monolithic ConsiderationRepository
for all considerations from multiple configuration files or user one repository per file.
Nevertheless, each ConsiderationRepository
must contain all ConsiderationProviders
defined in the given file.

User-defined Scriptable Objects
Those scriptable objects need to be overridden by the user. The user should also give their derived classes an attribute CreateAssetMenu so it will be later possible to create instance of those scriptable objects.
BehaviorProvider
This scriptable object is an abstract class from which the user should inherit when making use of Grail’s internal Utility System.
The user needs to override the InstantiateBlueprint
method, which should return a Blueprint
able to provide instance of the desired type of Behavior.
When constructing Blueprint , remember to pass it a name identical to the one defined in Grail config file you intend to use. It is advised to use parent class member variable behaviorName and fill it in this scriptable object inspector view.
|

Consideration Provider
This scriptable object is an abstract class from which the user should inherit when making use of Grail’s internal Utility System.
User needs to override the InstantiateConsideration
method, which should return a Consideration
defining subset of the current game state.
Remember to set ConsiderationProvider’s name to be identical with the one defined in Grail config file you intend to use.
|
