Exemplo n.º 1
0
 public Group
 (
     int windowID,
     int groupID,
     GUI_Group_type groupType,
     List <GUI_content> itemsContent,
     string groupLabel   = "",
     int columns         = 1,
     GUI_Layout layout   = GUI_Layout.RightAndDown,
     int horizontalSpace = 5,
     int verticalSpace   = 5,
     int itemHeight      = 24,
     int maxShowItems    = 1
 )
 {
     this.windowID        = windowID;
     this.groupID         = groupID;
     this.groupType       = groupType;
     this.itemsContent    = itemsContent;
     this.groupLabel      = groupLabel;
     this.columns         = columns;
     this.layout          = layout;
     this.horizontalSpace = horizontalSpace;
     this.verticalSpace   = verticalSpace;
     this.itemHeight      = itemHeight;
     this.maxShowItems    = maxShowItems;
 }
Exemplo n.º 2
0
    public void Awake()
    {
        S          = this;
        this.texto = this.niveles[levelLoad.level - 1];

        GUIText gt = this.LevelTxt.GetComponent <GUIText>();

        gt.text = "Nivel: " + levelLoad.level;
    }
Exemplo n.º 3
0
    /*
     * public void updatePosition(int newx, int newz, int origx, int origz){
     *      this.original_x = origx;
     *      this.original_z = origz;
     *
     *      this.transform.parent = GUI_Layout.S.board[this.original_x, this.original_z].transform;
     *      this.transform.localPosition = new Vector3(0, this.transform.position.y, 0);
     * }
     */

    /* Devuelve las coordenadas de una casilla que en el siguiente movimiento va a estar en la posición
     * pasada por parámetro.
     */
    private PairInt getCasillaPosibleDestino(int x1, int z1)
    {
        float eps = 0.7f;
        float x   = this.transform.position.x / 2.0f + _x;
        float z   = this.transform.position.z / 2.0f + _z;

        GUI_Layout S   = GUI_Layout.S;
        PairInt    aux = null;

        //centro
        aux = S.current_board[x1, z1];
        if (aux != null &&
            Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().x - x) < eps &&
            Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().z - z) < eps)
        {
            return(aux);
        }
        //norte
        if (x1 > 0)
        {
            aux = S.current_board[x1 - 1, z1];
            if (aux != null &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().x - x) < eps &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().z - z) < eps)
            {
                return(aux);
            }
        }
        //sur
        if (x1 + 1 < GUI_Layout.S.MAX_SIZE)
        {
            aux = S.current_board[x1 + 1, z1];
            if (aux != null &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().x - x) < eps &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().z - z) < eps)
            {
                return(aux);
            }
        }
        //este
        if (z1 > 0)
        {
            aux = S.current_board[x1, z1 - 1];
            if (aux != null &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().x - x) < eps &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().z - z) < eps)
            {
                return(aux);
            }
        }
        //oeste
        if (z1 + 1 < GUI_Layout.S.MAX_SIZE)
        {
            aux = S.current_board[x1, z1 + 1];
            if (aux != null &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().x - x) < 0.4f &&
                Mathf.Abs(S.board_def[aux.x, aux.y].getNextPosition().z - z) < 0.4f)
            {
                return(aux);
            }
        }


        return(null);
    }