コード例 #1
0
 public void InvokeMoveCompleteEvent()
 {
     //updates the player node assigned to the customer
     clickable.UpdateChildNode();
     positionNode = GameManager.Instance.RefreshNodeParent(customer);
     OnMoveComplete?.Invoke(positionNode);
 }
コード例 #2
0
ファイル: Move.cs プロジェクト: saurabhs/salad-chef
 private void OnEnable()
 {
     onMoveComplete = new OnMoveComplete();
     _state         = GetComponent <State>();
     if (_state == null)
     {
         throw new Exception("Cannot find State component...");
     }
 }
コード例 #3
0
ファイル: ObjectMover.cs プロジェクト: neilogd/LD28
 // 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;
 }
コード例 #4
0
    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);
    }
コード例 #5
0
    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;
        }
    }
コード例 #6
0
ファイル: Move.cs プロジェクト: saurabhs/salad-chef
 private void OnDisable() => onMoveComplete = null;
コード例 #7
0
 public void InvokeSpecialMoveCompleteEvent(MNode positionNode)
 {
     OnMoveComplete?.Invoke(positionNode);
 }