Class LookCommand
Represents a command to make an entity look/gaze at a specific target location or transform using a specified look transform as the pivot.
public class LookCommand : ICommand
Inheritance
Implements
Constructors
LookCommand(LookCommandInvoker, Vector3, float, Action)
Initializes a new instance of the LookCommand class with a target location.
public LookCommand(LookCommandInvoker commandInvoker, Vector3 targetLocation, float duration = -1, Action OnKill = null)
Parameters
| Name | Type | Description |
|---|---|---|
commandInvoker | LookCommandInvoker | The invoker responsible for executing and canceling the command. |
targetLocation | Vector3 | The target location to look at. |
duration | float | |
OnKill | Action |
LookCommand(LookCommandInvoker, Transform, float, Action)
Initializes a new instance of the LookCommand class with a target transform.
public LookCommand(LookCommandInvoker commandInvoker, Transform targetTransform, float duration = -1, Action OnKill = null)
Parameters
| Name | Type | Description |
|---|---|---|
commandInvoker | LookCommandInvoker | The invoker responsible for executing and canceling the command. |
targetTransform | Transform | The target transform to look at. |
duration | float | |
OnKill | Action |
Methods
Execute()
Executes the look command by instructing the invoker to make the entity look at the target.
public void Execute()
Kill()
Kill the look command by instructing the invoker to stop the ongoing look operation.
public void Kill()