示例#1
0
 public void ResetToken(PlayerPiece _p, PathPoints pathPoints)
 {
     print("Pathpoint " + pathPoints);
     pathPoints.RemovePlayerPiece(_p);
     _p.transform.localPosition = _p._base.localPosition;
     //_p.currentPathPoint.RemovePlayerPiece(_p);
     pathPoints.RemovePlayerPiece(_p);
     _p.isReady = false;
     _p.canMove = false;
     _p.numberOfStepsAlreadyMoved = 0;
     return;
 }
示例#2
0
    IEnumerator MoveSteps_Enum(PathPoints[] pathPointsToMoneOn_)
    {
        yield return(new WaitForSeconds(0.25f));

        int numOfStepsToMove = GameManager.gm.numOfStepsToMove;

        if (canMove)
        {
            previousPathPoint.RescaleAndReposAllPlayerPieces();
            for (int i = numberOfStepsAlreadyMoved; i < (numberOfStepsAlreadyMoved + numOfStepsToMove); i++)
            {
                if (isPathPointsAvailableToMove(numOfStepsToMove, numberOfStepsAlreadyMoved, pathPointsToMoneOn_))
                {
                    transform.position = pathPointsToMoneOn_[i].transform.position;
                    yield return(new WaitForSeconds(0.5f));
                }
            }
        }
        movementDone = true;

        GameManager.gm.State(this);
        if (isPathPointsAvailableToMove(numOfStepsToMove, numberOfStepsAlreadyMoved, pathPointsToMoneOn_))
        {
            numberOfStepsAlreadyMoved += numOfStepsToMove;

            GameManager.gm.RemovePathPoint(previousPathPoint);
            previousPathPoint.RemovePlayerPiece(this);
            currentPathPoint = pathPointsToMoneOn_[numberOfStepsAlreadyMoved - 1];
            currentPathPoint.AddPlayerPiece(this);
            GameManager.gm.AddPathPoint(currentPathPoint);
            previousPathPoint = currentPathPoint;
        }
        if (moveSteps_Coroutine != null)
        {
            StopCoroutine(moveSteps_Coroutine);
        }
    }