コード例 #1
0
 public Cell(StaticCellType staticCellType, DynamicCellType dynamicCellType, int x, int y)
 {
     StaticCellType  = staticCellType;
     DynamicCellType = dynamicCellType;
     X = x;
     Y = y;
 }
コード例 #2
0
    public Color GetColorForCell(StaticCellType staticCellType)
    {
        if (!_staticCellColors.TryGetValue(staticCellType, out var cellColor))
        {
            Debug.LogError($"Can't find color for {staticCellType}");
            return(Color.white);
        }

        return(cellColor);
    }
コード例 #3
0
    private void TryChangeColor()
    {
        if (_cell.StaticCellType == _prevCellType)
        {
            return;
        }

        _prevCellType = _cell.StaticCellType;
        var cellTypeColor = _colorDatabase.GetColorForCell(_prevCellType);

        _image.color = cellTypeColor;
    }
コード例 #4
0
    private void TryInjectData()
    {
        if (_cell != null)
        {
            return;
        }

        _cell          = target as UICellView;
        _prevCellType  = _cell.StaticCellType;
        _image         = _cell.GetComponent <Image>();
        _colorDatabase = ColorDatabaseLoader.LoadDatabase();
    }