Example #1
0
        public void CopyFrom(SerializableCell _cell)
        {
            cellStatus = (ECellStatus)_cell.cellStatus;
            cellType   = (ECellType)_cell.cellType;

            if (cellType == CellScript.ECellType.Number)
            {
                intCellContent = int.Parse(_cell.cellContent);
                m_currentColor = LevelEditor.instance.colorConfiguration.numberBlockColor;
            }
            else if (cellType == CellScript.ECellType.Operation)
            {
                charCellContent = _cell.cellContent.ToCharArray()[0];
                CurrentColor    = LevelEditor.instance.colorConfiguration.operationBlockColor;
            }
            else
            {
                CurrentColor = LevelEditor.instance.colorConfiguration.unusedBlockColor;
            }

            if (cellStatus == CellScript.ECellStatus.Hidden)
            {
                PreviousColor = CurrentColor;
                CurrentColor  = LevelEditor.instance.colorConfiguration.hiddenBlockColor;
            }
        }
Example #2
0
    public void Assign(LevelEditor.SerializableCell _cell, LevelEditor.ColorConfiguration _colorConfiguration)
    {
        if (_cell.cellType == (int)LevelEditor.CellScript.ECellType.Number)
        {
            m_imageReference.color = _colorConfiguration.numberBlockColor;
        }
        else if (_cell.cellType == (int)LevelEditor.CellScript.ECellType.Operation)
        {
            m_imageReference.color = _colorConfiguration.operationBlockColor;
        }
        else
        {
            m_imageReference.color = _colorConfiguration.unusedBlockColor;
        }

        m_textReference.text = _cell.cellContent;
    }