/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { var aa = Random.Range(0, this._spawned.Count); foreach (var bb in this._spawned) { var xy = this.xy_space2.Sample(); var z = this._camera.nearClipPlane + this.depth_space1.Sample() * this._camera.farClipPlane; var a = new Vector3(xy.x, xy.y, z); var c = this._camera.ViewportToWorldPoint(a); var rot = this.rot_space.Sample(); var b = new Quaternion(rot.x, rot.y, rot.z, rot.w); bb.transform.localScale = this.size_space.Sample(); bb.transform.position = c; bb.transform.rotation = b; } #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { //TODO: Denormalize configuration if space is marked as normalised #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif var local_scale = this.transform.localScale; if (configuration.ConfigurableName == this._x) { local_scale.x = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._y) { local_scale.y = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._z) { local_scale.z = configuration.ConfigurableValue; } this.transform.localScale = local_scale; }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif foreach (var mat in this._renderer.materials) { var c = mat.color; if (configuration.ConfigurableName == this._r) { c.r = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._texture) { c.g = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._reflection) { c.b = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._smoothness) { c.a = configuration.ConfigurableValue; } mat.color = c; } }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif if (configuration.ConfigurableName == this._fov_str) { this._camera.fieldOfView = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._focal_str) { this._camera.focalLength = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._sensor_width_str) { var a = this._camera.sensorSize; a.x = configuration.ConfigurableValue; this._camera.sensorSize = a; } else if (configuration.ConfigurableName == this._sensor_height_str) { var a = this._camera.sensorSize; a.y = configuration.ConfigurableValue; this._camera.sensorSize = a; } else if (configuration.ConfigurableName == this._lens_shift_x_str) { var a = this._camera.lensShift; a.x = configuration.ConfigurableValue; this._camera.lensShift = a; } else if (configuration.ConfigurableName == this._lens_shift_y_str) { var a = this._camera.lensShift; a.y = configuration.ConfigurableValue; this._camera.lensShift = a; } else if (configuration.ConfigurableName == this._gate_fit_str) { Enum.TryParse(((int)configuration.ConfigurableValue).ToString(), out Camera.GateFitMode gate_fit_mode); this._camera.gateFit = gate_fit_mode; } if (this._syncer) { this._syncer.Sync_Cameras(); } }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif this._texture = this._textures[(int)configuration.ConfigurableValue]; this._mat.SetTexture(_main_tex, this._texture); }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); #endif if (configuration.ConfigurableName == this._mesh_str) { if (this._texture) { this._texture.anisoLevel = (int)configuration.ConfigurableValue; } } }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { var cv = this._configurable_value_space.Space.Reproject(configuration.ConfigurableValue); #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif var pos = this.transform.position; var rot = this.transform.rotation; if (configuration.ConfigurableName == this._x) { pos.x = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._y) { pos.y = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._z) { pos.z = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._rx) { rot.x = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._ry) { rot.y = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._rz) { rot.z = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._rw) { rot.w = configuration.ConfigurableValue; } this.transform.position = pos; this.transform.rotation = rot; }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); #endif if (configuration.ConfigurableName == this._mesh_str) { if (this._displace_mesh) { if (this._deforming_mesh) { var time_x = Time.time * this._speed + 0.1365143f; var time_y = Time.time * this._speed + 1.21688f; var time_z = Time.time * this._speed + 2.5564f; for (var i = 0; i < this._displaced_vertices.Length; i++) { var orig = this._original_vertices[i]; //orig.y = orig.y * (1+(float)Math.Cos(Time.deltaTime))*(configuration.ConfigurableValue); //orig.x = orig.x * (1+(float)Math.Sin(Time.deltaTime))*(configuration.ConfigurableValue); orig.x += this._noise.Noise(time_x + orig.x, time_x + orig.y, time_x + orig.z) * configuration.ConfigurableValue; orig.y += this._noise.Noise(time_y + orig.x, time_y + orig.y, time_y + orig.z) * configuration.ConfigurableValue; orig.z += this._noise.Noise(time_z + orig.x, time_z + orig.y, time_z + orig.z) * configuration.ConfigurableValue; this._displaced_vertices[i] = orig; } this._deforming_mesh.vertices = this._displaced_vertices; this._deforming_mesh.RecalculateNormals(); } } else if (this._meshes.Length > 0) { var idx = (int)(configuration.ConfigurableValue * this._meshes.Length); this._mesh_filter.mesh = this._meshes[idx]; } } }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif if (configuration.ConfigurableName == this._shadow_strength) { this._light.shadowStrength = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._color_r) { var c = this._light.color; c.r = configuration.ConfigurableValue; this._light.color = c; } else if (configuration.ConfigurableName == this._color_g) { var c = this._light.color; c.g = configuration.ConfigurableValue; this._light.color = c; } else if (configuration.ConfigurableName == this._color_b) { var c = this._light.color; c.b = configuration.ConfigurableValue; this._light.color = c; } else if (configuration.ConfigurableName == this._intensity) { this._light.intensity = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._indirect_multiplier) { this._light.bounceIntensity = configuration.ConfigurableValue; } }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif var c = RenderSettings.ambientLight; if (configuration.ConfigurableName == this._color_r) { c.r = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._color_g) { c.g = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._color_b) { c.b = configuration.ConfigurableValue; } else if (configuration.ConfigurableName == this._intensity) { //c.a = configuration.ConfigurableValue; RenderSettings.ambientIntensity = configuration.ConfigurableValue; RenderSettings.reflectionIntensity = Mathf.Clamp01(configuration.ConfigurableValue); //RenderSettings.skybox.SetFloat("_Exposure", configuration.ConfigurableValue); } else if (configuration.ConfigurableName == this._reflection_intensity) { //c.a = configuration.ConfigurableValue; // RenderSettings.reflectionIntensity = configuration.ConfigurableValue; //RenderSettings.skybox.SetFloat("_Exposure", configuration.ConfigurableValue); } RenderSettings.ambientLight = c; DynamicGI.UpdateEnvironment(); }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif if (!this._use_shared) { foreach (var mat in this._renderer.materials) { var c = mat.color; if (configuration.ConfigurableName.Equals(this._r, StringComparison.Ordinal)) { c.r = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._g, StringComparison.Ordinal)) { c.g = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._b, StringComparison.Ordinal)) { c.b = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._a, StringComparison.Ordinal)) { c.a = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._smoothness, StringComparison.Ordinal)) { mat.SetFloat(_glossiness, configuration.ConfigurableValue); } else if (string.Equals(configuration.ConfigurableName, this._reflection, StringComparison.Ordinal)) { mat.SetFloat(_glossy_reflections, configuration.ConfigurableValue); } else if (string.Equals(configuration.ConfigurableName, this._offset_x, StringComparison.Ordinal)) { var a = mat.GetTextureOffset(_main_tex); a.x = configuration.ConfigurableValue; mat.SetTextureOffset(_main_tex, a); } else if (string.Equals(configuration.ConfigurableName, this._offset_y, StringComparison.Ordinal)) { var a = mat.GetTextureOffset(_main_tex); a.y = configuration.ConfigurableValue; mat.SetTextureOffset(_main_tex, a); } else if (string.Equals(configuration.ConfigurableName, this._tiling_x, StringComparison.Ordinal)) { var a = mat.GetTextureScale(_main_tex); a.x = configuration.ConfigurableValue; mat.SetTextureScale(_main_tex, a); } else if (string.Equals(configuration.ConfigurableName, this._tiling_y, StringComparison.Ordinal)) { var a = mat.GetTextureScale(_main_tex); a.y = configuration.ConfigurableValue; mat.SetTextureScale(_main_tex, a); } mat.color = c; } } else { foreach (var mat in this._renderer.sharedMaterials) { var c = mat.color; if (string.Equals(configuration.ConfigurableName, this._r, StringComparison.Ordinal)) { c.r = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._g, StringComparison.Ordinal)) { c.g = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._b, StringComparison.Ordinal)) { c.b = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._a, StringComparison.Ordinal)) { c.a = configuration.ConfigurableValue; } else if (string.Equals(configuration.ConfigurableName, this._smoothness, StringComparison.Ordinal)) { mat.SetFloat(_glossiness, configuration.ConfigurableValue); } else if (string.Equals(configuration.ConfigurableName, this._reflection, StringComparison.Ordinal)) { mat.SetFloat(_glossy_reflections, configuration.ConfigurableValue); } else if (string.Equals(configuration.ConfigurableName, this._offset_x, StringComparison.Ordinal)) { var a = mat.GetTextureOffset(_main_tex); a.x = configuration.ConfigurableValue; mat.SetTextureOffset(_main_tex, a); } else if (string.Equals(configuration.ConfigurableName, this._offset_y, StringComparison.Ordinal)) { var a = mat.GetTextureOffset(_main_tex); a.y = configuration.ConfigurableValue; mat.SetTextureOffset(_main_tex, a); } else if (string.Equals(configuration.ConfigurableName, this._tiling_x, StringComparison.Ordinal)) { var a = mat.GetTextureScale(_main_tex); a.x = configuration.ConfigurableValue; mat.SetTextureScale(_main_tex, a); } else if (string.Equals(configuration.ConfigurableName, this._tiling_y, StringComparison.Ordinal)) { var a = mat.GetTextureScale(_main_tex); a.y = configuration.ConfigurableValue; mat.SetTextureScale(_main_tex, a); } mat.color = c; } } }
/// <summary> /// </summary> /// <param name="configuration"></param> public override void ApplyConfiguration(IConfigurableConfiguration configuration) { #if NEODROID_DEBUG if (this.Debugging) { DebugPrinting.ApplyPrint(this.Debugging, configuration, this.Identifier); } #endif if (this.use_shared) { foreach (var mat in this._renderer.sharedMaterials) { var c = mat.color; switch (configuration.ConfigurableName[configuration.ConfigurableName.Length - 1]) { case _r: c.r = configuration.ConfigurableValue; break; case _g: c.g = configuration.ConfigurableValue; break; case _b: c.b = configuration.ConfigurableValue; break; case _a: c.a = configuration.ConfigurableValue; break; } mat.color = c; } } else { foreach (var mat in this._renderer.materials) { var c = mat.color; switch (configuration.ConfigurableName[configuration.ConfigurableName.Length - 1]) { case _r: c.r = configuration.ConfigurableValue; break; case _g: c.g = configuration.ConfigurableValue; break; case _b: c.b = configuration.ConfigurableValue; break; case _a: c.a = configuration.ConfigurableValue; break; } mat.color = c; } } }