Ejemplo n.º 1
0
    public void setPos(float[] pos)
    {
        Vector3 newPos = Vector3.zero;

        switch (boardScript.GetCoordSys())
        {
        case BBoard.ECord.XY:
            newPos = new Vector3(pos[0], pos[1], transform.position.z);
            break;

        case BBoard.ECord.XZ:
            newPos = new Vector3(pos[0], transform.position.y, pos[1]);
            break;

        case BBoard.ECord.YZ:
            newPos = new Vector3(transform.position.x, pos[0], pos[1]);
            break;
        }
        //transform.position = newPos;
        //TODO actualizar casillas
    }
Ejemplo n.º 2
0
    public void SetupCamera(BGameManager manager, DCameraInfo cameraInfo)
    {
        // Inicializamos los valores en funcion de los datos
        rotateLeft         = cameraInfo.rotateLeft;
        rotateRight        = cameraInfo.rotateRight;
        moveUp             = cameraInfo.moveUp;
        moveDown           = cameraInfo.moveDown;
        moveLeft           = cameraInfo.moveLeft;
        moveRight          = cameraInfo.moveRight;
        cameraMoveSpeed    = cameraInfo.cameraSpeed;
        cameraRotationTime = cameraInfo.rotationTime;
        cameraOrtoMax      = cameraInfo.farZoomClamp;

        // Guardamos el target
        parentT = transform.parent;

        // Hacemos que la camara se centre en el target
        transform.LookAt(parentT);

        // Obtenemos el tablero
        BBoard board = manager.GetActiveBoard();

        // Obtenemos los limites del tablero
        Vector4 aux = board.GetBoardLimits();

        min1 = aux.x;
        max1 = aux.y;
        min2 = aux.z;
        max2 = aux.w;

        // Colocamos la camara con la posicion inicial
        parentT.position = board.GetPlayerSpawnPos(0f);
        parentT.rotation = board.GetPlayerSpawnRot();

        // Obtenemos el sistema de coordenadas
        coordSys = board.GetCoordSys();
    }