public override void InitInternal() { m_spray = GetComponentsInChildren <Kvant.SprayMV>(); Parameters.Add(new GUIFloat("throttle", 0, 1, 1, delegate(float v) { Array.ForEach(m_spray, s => s.throttle = v); })); Parameters.Add(new GUIFloat("scale", 0, 1, 0.1f, delegate(float v) { Array.ForEach(m_spray, s => s.scale = v); })); Parameters.Add(new GUIFloat("drag", 0, 4, 1, delegate(float v) { Array.ForEach(m_spray, s => s.drag = v); })); Parameters.Add(new GUIFloat("amp", 0, 1, 0.5f, delegate(float v) { Array.ForEach(m_spray, s => s.noiseAmplitude = v); })); Parameters.Add(new GUIFloat("freq", 0, 1, 0.1f, delegate(float v) { Array.ForEach(m_spray, s => s.noiseFrequency = v); })); foreach (var p in Parameters) { var r = new GUIRow(); r.Items.Add(p); GUIRows.Add(r); } }
public override void InitInternal() { Parameters.Add(new GUIFloat("Width", 0, 0.5f, 0.1f, delegate(float v) { m_Width = v; })); Parameters.Add(new GUIFloat("type", 0, 5f, 0.1f, delegate(float v) { m_Type = v; })); Parameters.Add(new GUIFloat("rotate", 0, Mathf.PI * 2f, 0.1f, delegate(float v) { m_Rotate = v; })); Parameters.Add(new GUIFloat("scroll", 0, 0.1f, 0.1f, delegate(float v) { m_Scroll = v; })); Parameters.Add(new GUIFloat("Margin", 0, 0.1f, 0.1f, delegate(float v) { m_Margin = v; })); Parameters.Add(new GUIFloat("Repeat", 0, 100f, 1f, delegate(float v) { m_Repeat = v; })); Parameters.Add(new GUIFloat("Amount", 0, 1, 0f, delegate(float v) { m_Amount = v; })); foreach (var p in Parameters) { var r = new GUIRow(); r.Items.Add(p); GUIRows.Add(r); } }
public override void InitInternal() { m_effect = GetComponent <VisualEffect>(); m_name = "VFX." + m_effect.name; List <VFXExposedProperty> exposedProperties = new List <VFXExposedProperty>(); m_effect.visualEffectAsset.GetExposedProperties(exposedProperties); foreach (var prop in exposedProperties) { if (prop.type == typeof(float)) { var row = new GUIRow(); var p = new GUIFloat(prop.name, 0, 1, 0.5f, delegate(float v) { m_effect.SetFloat(prop.name, v); }); row.Items.Add(p); Parameters.Add(p); GUIRows.Add(row); } } }
public override void InitInternal() { Parameters.Add(new GUIFloat("displace", 0, 1, 0.1f, delegate(float v) { m_displace = v; })); Parameters.Add(new GUIFloat("Steps", 0, 16, 1, delegate(float v) { _stepsPerFrame = (int)v; })); Parameters.Add(new GUIFloat("m_dy", 0, 1, 0, delegate(float v) { m_dy = v; })); Parameters.Add(new GUIFloat("m_dx", 0, 1, 0, delegate(float v) { m_dx = v; })); Parameters.Add(new GUIFloat("rotation", 0, 1, 0.3f, delegate(float v) { m_RotationPower = v; })); Parameters.Add(new GUIFloat("amplification", 0, 1, 0.5f, delegate(float v) { m_Amplification = v; })); Parameters.Add(new GUIFloat("diagonal", 0, 1, 0.5f, delegate(float v) { m_Diagonal = v; })); Parameters.Add(new GUIFloat("inputWeight", -1, 1, 0.0f, delegate(float v) { m_InputWeight = v; })); foreach (var p in Parameters) { var r = new GUIRow(); r.Items.Add(p); GUIRows.Add(r); } }
public override void InitInternal() { RoutingServer.m_bass = m_bassLevel; RoutingServer.m_treble = m_trebleLevel; RoutingServer.m_bypass = m_level; RoutingServer.m_beat = m_beatDetect; m_beatTexture = new Texture2D(256, 64, UnityEngine.Experimental.Rendering.DefaultFormat.LDR, UnityEngine.Experimental.Rendering.TextureCreationFlags.None); m_levelTexture = new Texture2D(256, 64, UnityEngine.Experimental.Rendering.DefaultFormat.LDR, UnityEngine.Experimental.Rendering.TextureCreationFlags.None); var row = new GUIRow(); var rangeSlider = new GUIFloat("dynamic range", 1f, 50f, 25f, delegate(float v) { m_level.dynamicRange = v; m_analyzer.dynamicRange = v; }); Parameters.Add(rangeSlider); row.Items.Add(rangeSlider); GUIRows.Add(row); row = new GUIRow(); row.Items.Add(new GUITexture(m_beatTexture)); GUIRows.Add(row); row = new GUIRow(); row.Items.Add(new GUITexture(m_levelTexture)); GUIRows.Add(row); }
public override void InitInternal() { m_buttonMap.Clear(); m_macros.Clear(); m_modules.Clear(); foreach (var module in m_manager.m_modules) { if (!m_modules.ContainsKey(module.name)) { m_modules[module.name] = module; } } LoadMacros(); for (int i = 0; i < 16; i += 4) { GUIRow row = new GUIRow(); row.Height = 100; for (int j = 0; j < 4; j++) { string name = (i + j).ToString(); var button = CreateMacroButton(name, m_macros[name]); m_buttonMap[name] = button; row.Items.Add(button); } GUIRows.Add(row); } }
private void AddParameters <T>(PostProcessProfile profile) where T : PostProcessEffectSettings { foreach (var effect in profile.settings) { var effectName = effect.GetType().Name; var cast = effect as T; if (cast != null) { foreach (var thisVar in cast.GetType().GetFields()) { UnityEngine.Rendering.PostProcessing.FloatParameter item = thisVar.GetValue(cast) as UnityEngine.Rendering.PostProcessing.FloatParameter; if (item != null) { var row = new GUIRow(); var parameter = new GUIFloat(effectName + "." + thisVar.Name, 0, 1, 0, delegate(float v) { item.value = v; }); Parameters.Add(parameter); row.Items.Add(parameter); GUIRows.Add(row); } } // add some spacing GUIRows.Add(new GUIRow()); } } }
public override void InitInternal() { Parameters.Add(new GUIFloat("x", -10, 10, 1, delegate(float v) { m_ff.OffsetX = v; })); Parameters.Add(new GUIFloat("y", -10, 10, 1, delegate(float v) { m_ff.OffsetY = v; })); Parameters.Add(new GUIFloat("z", -10, 10, 1, delegate(float v) { m_ff.OffsetZ = v; })); foreach (var p in Parameters) { var row = new GUIRow(); row.Items.Add(p); GUIRows.Add(row); } }
public override void InitInternal() { for (int i = 0; i < m_scenes.Length; i += 2) { var row = new GUIRow(); var scene = m_scenes[i]; var p = new GUIToggle(scene.name, scene.SetActive); Parameters.Add(p); row.Items.Add(p); var scene2 = m_scenes[i + 1]; var p2 = new GUIToggle(scene2.name, scene2.SetActive); Parameters.Add(p2); row.Items.Add(p2); GUIRows.Add(row); } }
public override void InitInternal() { Parameters.Add(new GUIFloat("speed", 0, 7, 1, delegate(float v) { m_physarum.speed = v; })); Parameters.Add(new GUIFloat("iter", 0, 14, 1, delegate(float v) { m_physarum.iterations = v; })); Parameters.Add(new GUIFloat("sensorDist", 0, 100, 1, delegate(float v) { m_physarum.sensorDist = v; })); Parameters.Add(new GUIFloat("sensorDeg", 0, 100, 20, delegate(float v) { m_physarum.sensorDegrees = v; })); Parameters.Add(new GUIFloat("noiseAmount", 0, 0.2f, 0, delegate(float v) { m_physarum.noiseAmount = v; })); Parameters.Add(new GUIFloat("noiseScroll", 0, 0.2f, 0, delegate(float v) { m_physarum.noiseScroll = v; })); Parameters.Add(new GUIFloat("noiseFreq", 0, 8, 0, delegate(float v) { m_physarum.noiseFreq = v; })); Parameters.Add(new GUIFloat("linearForce", -0.01f, 0.01f, 0, delegate(float v) { m_physarum.linearForce = new Vector2(0, v); })); Parameters.Add(new GUIFloat("radialForce", -0.01f, 0.01f, 0, delegate(float v) { m_physarum.RadialForce = v; })); foreach (var p in Parameters) { var row = new GUIRow(); row.Items.Add(p); GUIRows.Add(row); } }
public override void InitInternal() { Parameters.Add(new GUIFloat("spout", 0, 1, 1, delegate(float v) { m_spoutRenderer.sharedMaterial.SetColor("_Color", Color.white * v); m_spoutRenderer.sharedMaterial.SetColor("_EmissionColor", Color.white * v); })); Parameters.Add(new GUIFloat("spoutScale", 0, 2, 1, delegate(float v) { m_spoutScale = v; })); Parameters.Add(new GUIFloat("fov", 25, 120, 80, delegate(float v) { m_camera.fieldOfView = v; m_spoutRenderer.transform.localScale = new Vector3(16, 9, 1) * 5 / 4 * m_spoutScale * Mathf.Tan(Mathf.Deg2Rad * v / 2); })); Parameters.Add(new GUIFloat("offset", 0, 10, 2, delegate(float v) { foreach (var off in m_zOffsetTransforms) { off.localPosition = Vector3.back * v; } })); Parameters.Add(new GUIFloat("Intensity", 0, 0.3f, 0.1f, delegate(float v) { m_linear.angularVelocity = Vector3.up * v * 90f; m_brownian.rotationAmount = new Vector3(90, 180, 90) * v; })); foreach (var p in Parameters) { var r = new GUIRow(); r.Items.Add(p); GUIRows.Add(r); } var row = new GUIRow(); Parameters.Add(new GUITrigger("Reset", delegate { m_follow.target = m_transforms[0]; })); row.Items.Add(Parameters[Parameters.Count - 1]); Parameters.Add(new GUITrigger("Noise", delegate { m_follow.target = m_transforms[1]; })); row.Items.Add(Parameters[Parameters.Count - 1]); Parameters.Add(new GUITrigger("spinner", delegate { m_follow.target = m_transforms[2]; })); row.Items.Add(Parameters[Parameters.Count - 1]); Parameters.Add(new GUITrigger("jump", delegate { m_cameraJump.Jump(); })); row.Items.Add(Parameters[Parameters.Count - 1]); GUIRows.Add(row); }
public override void InitInternal() { m_camera = Camera.main; m_profile = GetComponent <PostProcessVolume>().profile; m_colorGrade = m_profile.GetSetting <ColorGrading>(); m_ao = m_profile.GetSetting <AmbientOcclusion>(); m_bloom = m_profile.GetSetting <Bloom>(); m_grain = m_profile.GetSetting <Grain>(); Parameters.Add(new GUIFloat("Exposure", -3, 4, 0, delegate(float v) { m_colorGrade.postExposure.value = v; })); Parameters.Add(new GUIFloat("Contrast", -100, 100, 0, delegate(float v) { m_colorGrade.contrast.value = v; })); Parameters.Add(new GUIFloat("Saturation", -100, 100, 0, delegate(float v) { m_colorGrade.saturation.value = v; })); Parameters.Add(new GUIFloat("ao", 0, 2, 0.5f, delegate(float v) { m_ao.intensity.value = v; })); Parameters.Add(new GUIFloat("bloom", 0, 2, 0, delegate(float v) { m_bloom.intensity.value = v; })); Parameters.Add(new GUIFloat("grain", 0, 1, 0, delegate(float v) { m_grain.intensity.value = v; })); Parameters.Add(new GUIFloat("Ambient", 0, 3, 1, delegate(float v) { RenderSettings.ambientMode = AmbientMode.Flat; RenderSettings.ambientLight = Color.white * v; })); Parameters.Add(new GUIFloat("Directional", 0, 3, 1, delegate(float v) { m_dirLight.intensity = v; })); Parameters.Add(new GUIFloat("Time", 0, 2, 1, delegate(float v) { Time.timeScale = v; })); foreach (var p in Parameters) { var r = new GUIRow(); r.Items.Add(p); GUIRows.Add(r); } var row = new GUIRow(); Parameters.Add(new GUITrigger("hdri", delegate { RenderSettings.defaultReflectionMode = DefaultReflectionMode.Custom; RenderSettings.customReflection = m_hdri; m_camera.clearFlags = CameraClearFlags.Skybox; RenderSettings.skybox = m_hdriSkybox; })); row.Items.Add(Parameters[Parameters.Count - 1]); Parameters.Add(new GUITrigger("gradientsky", delegate { RenderSettings.defaultReflectionMode = DefaultReflectionMode.Custom; RenderSettings.customReflection = m_gradient; m_camera.clearFlags = CameraClearFlags.Skybox; RenderSettings.skybox = m_gradientSkybox; })); row.Items.Add(Parameters[Parameters.Count - 1]); Parameters.Add(new GUITrigger("color", delegate { m_camera.clearFlags = CameraClearFlags.SolidColor; m_camera.backgroundColor = Color.white * 0.1f; })); row.Items.Add(Parameters[Parameters.Count - 1]); GUIRows.Add(row); }