Esempio n. 1
0
 public Cell(StaticCellType staticCellType, DynamicCellType dynamicCellType, int x, int y)
 {
     StaticCellType  = staticCellType;
     DynamicCellType = dynamicCellType;
     X = x;
     Y = y;
 }
Esempio n. 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);
    }
    private void TryChangeColor()
    {
        if (_cell.StaticCellType == _prevCellType)
        {
            return;
        }

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

        _image.color = cellTypeColor;
    }
    private void TryInjectData()
    {
        if (_cell != null)
        {
            return;
        }

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