示例#1
0
        // Inicializa con el tablero de bloques y el texto (siempre que haya hijo con componente TextMesh), sólo si todavía no tiene puesto ningún tablero de bloques
        // El tablero de bloques recibido no puede ser nulo, pero el texto sí (representa un bloque no visible)
        public void Initialize(BlockBoard board, string text)
        {
            if (board == null)
            {
                throw new ArgumentNullException(nameof(board));
            }

            this.board = board;
            this.gameObject.SetActive(text != null); // Se pondrá activo o no según el texto (esto lo hacemos para reactivar bloques que hubieran sido agujeros antes (en un reinicio)

            if (text != null && GetComponentInChildren <TextMesh>() != null)
            {
                this.GetComponentInChildren <TextMesh>().text = text;
            }

            Debug.Log(ToString() + " initialized.");
        }
示例#2
0
        // Inicializa con el tablero de bloques y el texto (siempre que haya hijo con componente TextMesh), sólo si todavía no tiene puesto ningún tablero de bloques
        // El tablero de bloques recibido no puede ser nulo, pero el texto sí (representa un bloque no visible)
        public void Initialize(BlockBoard board, uint value)
        {
            if (board == null)
            {
                throw new ArgumentNullException(nameof(board));
            }

            this.board = board;
            this.gameObject.SetActive(value != null); // Se pondrá activo o no según el texto (esto lo hacemos para reactivar bloques que hubieran sido agujeros antes (en un reinicio)


            type = (TipoCasilla)value;
            if (value == 5)
            {
                print("HOLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
            }
            valor = valores [value];

            changeText();

            changeColor();

            //Debug.Log(ToString() + " initialized.");
        }