public void SetPieceType(PieceType type) { myImage = GetComponent <Image>(); myImage.color = type.HasFlag(PieceType.Blue) ? bluePieceColor : redPieceColor; }