public void InvokeMoveCompleteEvent() { //updates the player node assigned to the customer clickable.UpdateChildNode(); positionNode = GameManager.Instance.RefreshNodeParent(customer); OnMoveComplete?.Invoke(positionNode); }
private void OnEnable() { onMoveComplete = new OnMoveComplete(); _state = GetComponent <State>(); if (_state == null) { throw new Exception("Cannot find State component..."); } }
// Move object to target. public void Move( Vector3 targetPosition, Quaternion targetRotation, float peakHeight, OnMoveComplete onMoveComplete ) { this.enabled = true; _moveDelta = 0.0f; _originalPosition = transform.position; _originalRotation = transform.rotation; _targetPosition = targetPosition; _targetRotation = targetRotation; _peakHeight = peakHeight; _onMoveComplete = onMoveComplete; }
public void InvokeMoveCompleteEvent() { positionNode = GameManager.Instance.RefreshNodeParent(player); OnMoveComplete?.Invoke(positionNode); //at the front of the queue is the destination where the player is currently in //DequeuePath(); temorarily commented out //if there is no more destination queued, return if (path.Count == 0) { return; } //if there is still destination queued, peek at the destination which is now at the front Transform nextDestination = DequeuePath(); //go to the next path in the queue if there is a destination queued TransportPlayer(nextDestination); }
private void Update() { switch (mobState) { case State.Idle: break; case State.Running: smoothedPosition = Vector3.Lerp(transform.position, targetPosition, speed * Time.deltaTime); transform.position = smoothedPosition; if (Vector3.Distance(transform.position, targetPosition) < reachedDistance) { transform.position = targetPosition; OnMoveComplete?.Invoke(); } break; } }
private void OnDisable() => onMoveComplete = null;
public void InvokeSpecialMoveCompleteEvent(MNode positionNode) { OnMoveComplete?.Invoke(positionNode); }