public override void OnInspectorGUI(ParticleSystem s) { if (LightsModuleUI.s_Texts == null) { LightsModuleUI.s_Texts = new LightsModuleUI.Texts(); } ModuleUI.GUIObject(LightsModuleUI.s_Texts.light, this.m_Light, new GUILayoutOption[0]); ModuleUI.GUIFloat(LightsModuleUI.s_Texts.ratio, this.m_Ratio, new GUILayoutOption[0]); ModuleUI.GUIToggle(LightsModuleUI.s_Texts.randomDistribution, this.m_RandomDistribution, new GUILayoutOption[0]); ModuleUI.GUIToggle(LightsModuleUI.s_Texts.color, this.m_UseParticleColor, new GUILayoutOption[0]); ModuleUI.GUIToggle(LightsModuleUI.s_Texts.range, this.m_SizeAffectsRange, new GUILayoutOption[0]); ModuleUI.GUIToggle(LightsModuleUI.s_Texts.intensity, this.m_AlphaAffectsIntensity, new GUILayoutOption[0]); ModuleUI.GUIMinMaxCurve(LightsModuleUI.s_Texts.rangeCurve, this.m_Range, new GUILayoutOption[0]); ModuleUI.GUIMinMaxCurve(LightsModuleUI.s_Texts.intensityCurve, this.m_Intensity, new GUILayoutOption[0]); ModuleUI.GUIInt(LightsModuleUI.s_Texts.maxLights, this.m_MaxLights, new GUILayoutOption[0]); if (this.m_Light.objectReferenceValue) { Light light = (Light)this.m_Light.objectReferenceValue; if (light.type != LightType.Point && light.type != LightType.Spot) { GUIContent gUIContent = EditorGUIUtility.TextContent("Only point and spot lights are supported on particles."); EditorGUILayout.HelpBox(gUIContent.text, MessageType.Warning, true); } } }
protected override void Init() { if (this.m_Ratio == null) { if (LightsModuleUI.s_Texts == null) { LightsModuleUI.s_Texts = new LightsModuleUI.Texts(); } this.m_Ratio = base.GetProperty("ratio"); this.m_RandomDistribution = base.GetProperty("randomDistribution"); this.m_Light = base.GetProperty("light"); this.m_UseParticleColor = base.GetProperty("color"); this.m_SizeAffectsRange = base.GetProperty("range"); this.m_AlphaAffectsIntensity = base.GetProperty("intensity"); this.m_MaxLights = base.GetProperty("maxLights"); this.m_Range = new SerializedMinMaxCurve(this, LightsModuleUI.s_Texts.rangeCurve, "rangeCurve"); this.m_Intensity = new SerializedMinMaxCurve(this, LightsModuleUI.s_Texts.intensityCurve, "intensityCurve"); } }