9 namespace droid.Runtime.Prototyping.Configurables {
13 [AddComponentMenu(ConfigurableComponentMenuPath._ComponentMenuPath
15 + ConfigurableComponentMenuPath._Postfix)]
21 string _quality_level;
22 string _target_frame_rate;
28 public override string PrototypingTypeName {
get {
return "SimulationConfigurable"; } }
33 this._quality_level = this.Identifier +
"QualityLevel";
34 this._target_frame_rate = this.Identifier +
"TargetFrameRate";
35 this._time_scale = this.Identifier +
"TimeScale";
36 this._width = this.Identifier +
"Width";
37 this._height = this.Identifier +
"Height";
38 this._fullscreen = this.Identifier +
"Fullscreen";
44 this.ParentEnvironment =
45 NeodroidUtilities.RegisterComponent(this.ParentEnvironment,
48 this.ParentEnvironment =
49 NeodroidUtilities.RegisterComponent(this.ParentEnvironment,
51 this._target_frame_rate);
52 this.ParentEnvironment =
53 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._width);
54 this.ParentEnvironment =
55 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._height);
56 this.ParentEnvironment =
57 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._fullscreen);
58 this.ParentEnvironment =
59 NeodroidUtilities.RegisterComponent(this.ParentEnvironment, (
Configurable)
this, this._time_scale);
65 if (this.ParentEnvironment == null) {
69 this.ParentEnvironment.UnRegister(
this, this._quality_level);
70 this.ParentEnvironment.UnRegister(
this, this._target_frame_rate);
71 this.ParentEnvironment.UnRegister(
this, this._time_scale);
72 this.ParentEnvironment.UnRegister(
this, this._width);
73 this.ParentEnvironment.UnRegister(
this, this._height);
74 this.ParentEnvironment.UnRegister(
this, this._fullscreen);
77 public override ISpace ConfigurableValueSpace {
get; }
85 Debug.Log(
"Applying " + simulator_configuration +
" To " + this.Identifier);
90 QualitySettings.SetQualityLevel((
int)simulator_configuration.
ConfigurableValue,
true);
91 }
else if (simulator_configuration.
ConfigurableName ==
this._target_frame_rate) {
94 Screen.SetResolution((
int)simulator_configuration.
ConfigurableValue, Screen.height,
false);
96 Screen.SetResolution(Screen.width, (
int)simulator_configuration.
ConfigurableValue,
false);
98 Screen.SetResolution(Screen.width,
override void ApplyConfiguration(IConfigurableConfiguration simulator_configuration)
override void RegisterComponent()
override void UnRegisterComponent()
override Configuration [] SampleConfigurations()