public override InteractableThemePropertyValue GetProperty(InteractableThemeProperty property) { if (Host == null) { return(new InteractableThemePropertyValue()); } InteractableThemePropertyValue start = new InteractableThemePropertyValue(); string propId = property.GetShaderPropId(); switch (property.Type) { case InteractableThemePropertyValueTypes.Color: start.Color = propertyBlock.GetVector(propId); break; case InteractableThemePropertyValueTypes.ShaderFloat: start.Float = propertyBlock.GetFloat(propId); break; case InteractableThemePropertyValueTypes.shaderRange: start.Float = propertyBlock.GetFloat(propId); break; default: break; } return(start); }
public override void SetValue(InteractableThemeProperty property, int index, float percentage) { if (Host == null) { return; } string propId = property.GetShaderPropId(); float newValue; switch (property.Type) { case InteractableThemePropertyValueTypes.Color: Color newColor = Color.Lerp(property.StartValue.Color, property.Values[index].Color, percentage); propertyBlock = SetColor(propertyBlock, newColor, propId); break; case InteractableThemePropertyValueTypes.ShaderFloat: newValue = LerpFloat(property.StartValue.Float, property.Values[index].Float, percentage); propertyBlock = SetFloat(propertyBlock, newValue, propId); break; case InteractableThemePropertyValueTypes.shaderRange: newValue = LerpFloat(property.StartValue.Float, property.Values[index].Float, percentage); propertyBlock = SetFloat(propertyBlock, newValue, propId); break; default: break; } SetPropertyBlock(Host, propertyBlock); }
public override void SetValue(InteractableThemeProperty property, int index, float percentage) { Color color = Color.Lerp(property.StartValue.Color, property.Values[index].Color, percentage); string propId = property.GetShaderPropId(); for (int i = 0; i < propertyBlocks.Count; i++) { BlocksAndRenderer bAndR = propertyBlocks[i]; bAndR.Block.SetColor(propId, color); bAndR.Renderer.SetPropertyBlock(bAndR.Block); propertyBlocks[i] = bAndR; } }
public override InteractableThemePropertyValue GetProperty(InteractableThemeProperty property) { InteractableThemePropertyValue color = new InteractableThemePropertyValue(); string propId = property.GetShaderPropId(); if (propertyBlocks.Count > 0) { BlocksAndRenderer bAndR = propertyBlocks[0]; color.Color = bAndR.Block.GetVector(propId); } return(color); }