Exemplo n.º 1
0
    public void MoveToNode(Vector3 targetPos)
    {
        aiLerp.ResetToDefault();
        mapSCR.RemoveCharacterPosition(gameObject, isAlly);
        //mapSCR.RemoveCharacterPosition(gameObject, isAlly, tempCellPos);
        charMng.playerCell = null;
        tempCellPos        = targetPos;
        ShipCell cellToGo = mapSCR.SetCharacterPosition(gameObject, isAlly, tempCellPos);

        charMng.playerCell = cellToGo;
        StopAllCoroutines();
        if (cellToGo == null)
        {
            moveCoroutine = Move(targetPos);
        }
        else
        {
            moveCoroutine = Move(cellToGo.position);
        }
        StartCoroutine(moveCoroutine);
    }