public override void Enable() { borderColorTop = element.style.BorderColorTop; borderColorRight = element.style.BorderColorRight; borderColorBottom = element.style.BorderColorBottom; borderColorLeft = element.style.BorderColorLeft; backgroundColor = element.style.BackgroundColor; backgroundTint = element.style.BackgroundTint; backgroundImage = element.style.BackgroundImage; borderRadiusTopLeft = element.style.BorderRadiusTopLeft; borderRadiusTopRight = element.style.BorderRadiusTopRight; borderRadiusBottomLeft = element.style.BorderRadiusBottomLeft; borderRadiusBottomRight = element.style.BorderRadiusBottomRight; cornerBevelTopLeft = element.style.CornerBevelTopLeft; cornerBevelTopRight = element.style.CornerBevelTopRight; cornerBevelBottomRight = element.style.CornerBevelBottomRight; cornerBevelBottomLeft = element.style.CornerBevelBottomLeft; shadowColor = element.style.ShadowColor; materialId = element.style.Material; opacity = element.style.Opacity; meshType = element.style.MeshType; meshFillAmount = element.style.MeshFillAmount; meshFillDirection = element.style.MeshFillDirection; meshFillOrigin = element.style.MeshFillOrigin; }
public override void OnStylePropertyChanged(StructList <StyleProperty> propertyList) { StyleProperty[] properties = propertyList.array; int count = propertyList.size; base.OnStylePropertyChanged(propertyList); for (int i = 0; i < count; i++) { ref StyleProperty property = ref properties[i]; switch (property.propertyId) { case StylePropertyId.MeshFillAmount: meshFillAmount = property.AsFloat; geometryNeedsUpdate = true; break; case StylePropertyId.MeshType: meshType = property.AsMeshType; geometryNeedsUpdate = true; break; case StylePropertyId.MeshFillDirection: meshFillDirection = property.AsMeshFillDirection; geometryNeedsUpdate = true; break; case StylePropertyId.MeshFillOrigin: meshFillOrigin = property.AsMeshFillOrigin; geometryNeedsUpdate = true; break; case StylePropertyId.Material: materialId = property.AsMaterialId; break; case StylePropertyId.BackgroundTint: backgroundTint = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BackgroundColor: backgroundColor = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorTop: borderColorTop = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorRight: borderColorRight = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorBottom: borderColorBottom = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorLeft: borderColorLeft = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BackgroundImage: backgroundImage = property.AsTexture; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusBottomLeft: borderRadiusBottomLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusBottomRight: borderRadiusBottomRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusTopLeft: borderRadiusTopLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusTopRight: borderRadiusTopRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.Opacity: opacity = property.AsFloat; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelTopLeft: cornerBevelTopLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelTopRight: cornerBevelTopRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelBottomRight: cornerBevelBottomRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelBottomLeft: cornerBevelBottomLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.ShadowColor: shadowColor = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BackgroundFit: case StylePropertyId.BackgroundImageScaleX: case StylePropertyId.BackgroundImageScaleY: case StylePropertyId.BackgroundImageRotation: case StylePropertyId.BackgroundImageTileX: case StylePropertyId.BackgroundImageTileY: case StylePropertyId.BackgroundImageOffsetX: case StylePropertyId.BackgroundImageOffsetY: case StylePropertyId.ShadowTint: case StylePropertyId.ShadowOffsetX: case StylePropertyId.ShadowOffsetY: case StylePropertyId.ShadowSizeX: case StylePropertyId.ShadowSizeY: case StylePropertyId.ShadowIntensity: dataNeedsUpdate = true; break; // shadowNeedsUpdate = true; // break; } }