8 namespace droid.Runtime.Prototyping.Configurables {
12 [AddComponentMenu(ConfigurableComponentMenuPath._ComponentMenuPath
13 +
"EnvironmentalLight" 14 + ConfigurableComponentMenuPath._Postfix)]
15 [DisallowMultipleComponent]
21 string _reflection_intensity;
25 _decimal_granularity = 2,
26 _Min_Values = Vector3.one * 0.0f,
27 _Max_Values = Vector3.one * 1f,
36 Space3 _color_space =
new Space3 {_Min_Values = Vector3.one * 0.6f, _Max_Values = Vector3.one * 1f};
42 this._color_r = this.Identifier +
"ColorR";
43 this._color_g = this.Identifier +
"ColorG";
44 this._color_b = this.Identifier +
"ColorB";
45 this._intensity = this.Identifier +
"Intensity";
46 this._reflection_intensity = this.Identifier +
"ReflectionIntensity";
53 this.ParentEnvironment =
54 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._color_r);
55 this.ParentEnvironment =
56 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._color_b);
57 this.ParentEnvironment =
58 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._color_g);
59 this.ParentEnvironment =
60 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._intensity);
61 this.ParentEnvironment =
62 NeodroidUtilities.RegisterComponent(this.ParentEnvironment,
64 this._reflection_intensity);
71 if (this.ParentEnvironment == null) {
75 this.ParentEnvironment.UnRegister(
this, this._color_r);
76 this.ParentEnvironment.UnRegister(
this, this._color_g);
77 this.ParentEnvironment.UnRegister(
this, this._color_b);
78 this.ParentEnvironment.UnRegister(
this, this._intensity);
79 this.ParentEnvironment.UnRegister(
this, this._reflection_intensity);
82 public override ISpace ConfigurableValueSpace {
get; }
90 DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier);
93 var c = RenderSettings.ambientLight;
103 RenderSettings.reflectionIntensity = Mathf.Clamp01(configuration.
ConfigurableValue);
111 RenderSettings.ambientLight = c;
112 DynamicGI.UpdateEnvironment();
120 var o = this._intensity_space.
Sample();
121 var v = this._color_space.
Sample();
override Configuration [] SampleConfigurations()
override void ApplyConfiguration(IConfigurableConfiguration configuration)
override void RegisterComponent()
override void UnRegisterComponent()