예제 #1
0
			public DyeEffectModifier(DyeEffectDelegate effect = null, DyeModifier<Color> primaryColor = null, DyeModifier<Color> secondaryColor = null, DyeModifier<float> opacity = null, DyeModifier<float> saturation = null) {
				this.opacity = opacity ?? new DyeModifier<float>(1.0f);
				this.saturation = saturation ?? new DyeModifier<float>(1.0f);
				this.primaryColor = primaryColor ?? new DyeModifier<Color>((Color)default);
				this.secondaryColor = secondaryColor ?? new DyeModifier<Color>((Color)default);

				this.GetEffect = effect ?? ((instance, data, shader, entity, drawData) => {
					shader.UseColor(primaryColor.GetValue(data, shader, entity, drawData));
					shader.UseSecondaryColor(secondaryColor.GetValue(data, shader, entity, drawData));
					shader.UseOpacity(opacity.GetValue(data, shader, entity, drawData));
					shader.UseSaturation(saturation.GetValue(data, shader, entity, drawData));
				});
			}
예제 #2
0
			public ColorParameterColor(DyeModifier<Color> value = null) {
				_value = value ?? new DyeModifier<Color>((Color)default);
			}
예제 #3
0
			public ColorParameterFloat(DyeModifier<float> valueR = null, DyeModifier<float> valueG = null, DyeModifier<float> valueB = null) {
				_valueR = valueR ?? new DyeModifier<float>((float)default);
				_valueG = valueG ?? new DyeModifier<float>((float)default);
				_valueB = valueB ?? new DyeModifier<float>((float)default);
			}