//Constructor public MoveCommand(MoveReceiver reciever, MoveDirection direction, float distance, GameObject gameObjectToMove) { this._receiver = reciever; this._direction = direction; this._distance = distance; this._gameObject = gameObjectToMove; }
public bool ExecuteCommand() { if (mover == null) { mover = Object.FindObjectOfType <MoveReceiver>(); } return(mover.Move()); }
void Start() { moveReceiver = new MoveReceiver(); changeColorReceiver = new ChangeColorReceiver(); if (objectTarget == null) { Debug.LogError("objectTarget must be assigned via inspector"); this.enabled = false; } }