Skip to main content

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​

object→LookCommand

Implements​

ICommand

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​

NameTypeDescription
commandInvokerLookCommandInvokerThe invoker responsible for executing and canceling the command.
targetLocationVector3The target location to look at.
durationfloat
OnKillAction

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​

NameTypeDescription
commandInvokerLookCommandInvokerThe invoker responsible for executing and canceling the command.
targetTransformTransformThe target transform to look at.
durationfloat
OnKillAction

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()
  • Constructors
    • LookCommand(LookCommandInvoker, Vector3, float, Action)
    • LookCommand(LookCommandInvoker, Transform, float, Action)
  • Methods
    • Execute()
    • Kill()