Class TMPSceneCommand
- Namespace
- TMPEffects.TMPCommands
Base class to derive from to create scene commands.
public abstract class TMPSceneCommand : MonoBehaviour, ITMPCommand, ITMPParameterValidator, INotifyObjectChanged
- Inheritance
-
TMPSceneCommand
- Implements
Properties
ExecuteInstantly
Whether the command is executed the moment the TMPWriter begins writing.
Otherwise, it is executed when the TMPWriter shows the character at the corresponding index.
public abstract bool ExecuteInstantly { get; }
Property Value
ExecuteOnSkip
Whether the command should be executed by the TMPWriter if its text position is skipped over.
public abstract bool ExecuteOnSkip { get; }
Property Value
ExecuteRepeatable
Whether the command may be executed multiple times if, for example, the TMPWriter is reset to an earlier text position after the command has been executed.
An example for a command that should not be repeatable is one that triggers a quest, or adds an item to the player's inventory.
public abstract bool ExecuteRepeatable { get; }
Property Value
TagType
The type of command this is.
public abstract TagType TagType { get; }
Property Value
Remarks
Index: This type of command is executed when the TMPWriter shows the character at the corresponding index. It does not need to be closed.
Example: This is <!delay=0.01> my text
Block: This type of command is executed when the TMPWriter shows the character at the first corresponding index. It needs to be closed, and will operate on the enclosed text.
Example: This <!show>is my</!show> text
Either: Both applications are valid.
Methods
ExecuteCommand(ICommandContext)
Execute the command.
public abstract void ExecuteCommand(ICommandContext context)
Parameters
context
ICommandContext
GetNewCustomData()
Get a new custom data object for this command.
public abstract object GetNewCustomData()
Returns
- object
The custom data object for this command.
OnDestroy()
protected virtual void OnDestroy()
OnValidate()
protected virtual void OnValidate()
RaiseObjectChanged()
protected void RaiseObjectChanged()
SetParameters(object, IDictionary<string, string>, ITMPKeywordDatabase)
Set the parameters for the command.
public abstract void SetParameters(object customData, IDictionary<string, string> parameters, ITMPKeywordDatabase keywordDatabase)
Parameters
customData
objectThe custom data for this command.
parameters
IDictionary<string, string>Parameters as key-value-pairs.
keywordDatabase
ITMPKeywordDatabaseThe keyword database used for parsing the parameter values.
ValidateParameters(IDictionary<string, string>, ITMPKeywordDatabase)
Validate the given parameters.
public abstract bool ValidateParameters(IDictionary<string, string> parameters, ITMPKeywordDatabase keywordDatabase)
Parameters
parameters
IDictionary<string, string>The parameters as key-value pairs
keywordDatabase
ITMPKeywordDatabaseThe keyword database used for parsing the parameter values
Returns
- bool
true if the parameters were successfully validated; false otherwise.
Events
ObjectChanged
Raised when the object is changed.
public event ObjectChangedEventHandler ObjectChanged