public static int GUIPopup(GUIContent label, SerializedProperty intProp, string[] options) { Rect position = ModuleUI.PrefixLabel(ModuleUI.GetControlRect(13), label); intProp.intValue = EditorGUI.Popup(position, intProp.intValue, options, ParticleSystemStyles.Get().popup); return(intProp.intValue); }
public override bool DrawHeader(Rect rect, GUIContent label) { var wasBold = EditorGUIUtility.GetBoldDefaultFont(); SerializedProperty itr = m_Object.GetIterator(); bool useBold = false; if (m_Object.targetObjects.Length == 1) { bool validItr = itr.Next(true); while (validItr) { if (itr.isInstantiatedPrefab && itr.prefabOverride) { useBold = true; break; } validItr = itr.Next(false); } } EditorGUIUtility.SetBoldDefaultFont(useBold); var toggleState = GUI.Toggle(rect, foldout, label, ParticleSystemStyles.Get().moduleHeaderStyle); EditorGUIUtility.SetBoldDefaultFont(wasBold); return(toggleState); }
public static void GUIMMColorPopUp(Rect rect, SerializedProperty boolProp) { if (EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown)) { GenericMenu genericMenu = new GenericMenu(); GUIContent[] array = new GUIContent[] { new GUIContent("Constant Color"), new GUIContent("Random Between Two Colors") }; bool[] array2 = new bool[] { default(bool), true }; for (int i = 0; i < array.Length; i++) { GenericMenu arg_8C_0 = genericMenu; GUIContent arg_8C_1 = array[i]; bool arg_8C_2 = boolProp.boolValue == array2[i]; if (ModuleUI.< > f__mg$cache2 == null) { ModuleUI.< > f__mg$cache2 = new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxColorStateCallback); } arg_8C_0.AddItem(arg_8C_1, arg_8C_2, ModuleUI.< > f__mg$cache2, new ModuleUI.ColorCallbackData(array2[i], boolProp)); } genericMenu.ShowAsContext(); Event.current.Use(); } }
public static Enum GUIEnumMask(GUIContent label, Enum enumValue) { Rect rect = ModuleUI.GetControlRect(13); rect = ModuleUI.PrefixLabel(rect, label); return(EditorGUI.EnumMaskField(rect, enumValue, ParticleSystemStyles.Get().popup)); }
public static int GUIMask(GUIContent label, int intValue, string[] options, params GUILayoutOption[] layoutOptions) { Rect rect = ModuleUI.GetControlRect(13, layoutOptions); rect = ModuleUI.PrefixLabel(rect, label); return(EditorGUI.MaskField(rect, label, intValue, options, ParticleSystemStyles.Get().popup)); }
public override void OnInspectorGUI(ParticleSystem s) { if (s_Texts == null) { s_Texts = new Texts(); } List <UnityEngine.Object> subEmitterProperties = this.GetSubEmitterProperties(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(true) }; GUILayout.Label("", ParticleSystemStyles.Get().label, options); GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(120f) }; GUILayout.Label(s_Texts.inherit, ParticleSystemStyles.Get().label, optionArray2); GUILayout.EndHorizontal(); for (int i = 0; i < this.m_SubEmitters.arraySize; i++) { this.ShowSubEmitter(i); } List <UnityEngine.Object> list2 = this.GetSubEmitterProperties(); for (int j = 0; j < Mathf.Min(subEmitterProperties.Count, list2.Count); j++) { if (subEmitterProperties[j] != list2[j]) { if (this.m_CheckObjectIndex == -1) { EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.Update)); } this.m_CheckObjectIndex = j; } } }
public static void GUILayerMask(GUIContent guiContent, SerializedProperty boolProp) { Rect rect = ModuleUI.GetControlRect(13); rect = ModuleUI.PrefixLabel(rect, guiContent); EditorGUI.LayerMaskField(rect, boolProp, GUIContent.none, ParticleSystemStyles.Get().popup); }
public static void GUIMMCurveStateList(Rect rect, SerializedMinMaxCurve[] minMaxCurves) { if (!EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown) || minMaxCurves.Length == 0) { return; } GUIContent[] guiContentArray = new GUIContent[4] { new GUIContent("Constant"), new GUIContent("Curve"), new GUIContent("Random Between Two Constants"), new GUIContent("Random Between Two Curves") }; MinMaxCurveState[] minMaxCurveStateArray = new MinMaxCurveState[4] { MinMaxCurveState.k_Scalar, MinMaxCurveState.k_Curve, MinMaxCurveState.k_TwoScalars, MinMaxCurveState.k_TwoCurves }; bool[] flagArray = new bool[4] { (minMaxCurves[0].m_AllowConstant ? 1 : 0) != 0, (minMaxCurves[0].m_AllowCurves ? 1 : 0) != 0, (minMaxCurves[0].m_AllowRandom ? 1 : 0) != 0, (!minMaxCurves[0].m_AllowRandom ? 0 : (minMaxCurves[0].m_AllowCurves ? 1 : 0)) != 0 }; GenericMenu genericMenu = new GenericMenu(); for (int index = 0; index < guiContentArray.Length; ++index) { if (flagArray[index]) { genericMenu.AddItem(guiContentArray[index], minMaxCurves[0].state == minMaxCurveStateArray[index], new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxCurveStateCallback), (object)new ModuleUI.CurveStateCallbackData(minMaxCurveStateArray[index], minMaxCurves)); } } genericMenu.DropDown(rect); Event.current.Use(); }
private static void GUIMMModePopUp(Rect rect, SerializedProperty modeProp) { if (EditorGUI.DropdownButton(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown)) { GUIContent[] array = new GUIContent[] { EditorGUIUtility.TrTextContent("Infinite", null, null), EditorGUIUtility.TrTextContent("Count", null, null) }; GenericMenu genericMenu = new GenericMenu(); for (int i = 0; i < array.Length; i++) { GenericMenu arg_81_0 = genericMenu; GUIContent arg_81_1 = array[i]; bool arg_81_2 = modeProp.intValue == i; if (EmissionModuleUI.< > f__mg$cache0 == null) { EmissionModuleUI.< > f__mg$cache0 = new GenericMenu.MenuFunction2(EmissionModuleUI.SelectModeCallback); } arg_81_0.AddItem(arg_81_1, arg_81_2, EmissionModuleUI.< > f__mg$cache0, new EmissionModuleUI.ModeCallbackData(i, modeProp)); } genericMenu.ShowAsContext(); Event.current.Use(); } }
public override bool DrawHeader(Rect rect, GUIContent label) { bool boldDefaultFont = EditorGUIUtility.GetBoldDefaultFont(); SerializedProperty iterator = this.m_Object.GetIterator(); bool boldDefaultFont2 = false; if (this.m_Object.targetObjects.Length == 1) { bool flag = iterator.Next(true); while (flag) { if (iterator.isInstantiatedPrefab && iterator.prefabOverride) { boldDefaultFont2 = true; break; } flag = iterator.Next(false); } } EditorGUIUtility.SetBoldDefaultFont(boldDefaultFont2); bool result = GUI.Toggle(rect, base.foldout, label, ParticleSystemStyles.Get().moduleHeaderStyle); EditorGUIUtility.SetBoldDefaultFont(boldDefaultFont); return(result); }
public static void GUIMMGradientPopUp(Rect rect, SerializedMinMaxGradient gradientProp) { if (!EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown)) { return; } GUIContent[] guiContentArray = new GUIContent[4] { new GUIContent("Color"), new GUIContent("Gradient"), new GUIContent("Random Between Two Colors"), new GUIContent("Random Between Two Gradients") }; MinMaxGradientState[] maxGradientStateArray = new MinMaxGradientState[4] { MinMaxGradientState.k_Color, MinMaxGradientState.k_Gradient, MinMaxGradientState.k_RandomBetweenTwoColors, MinMaxGradientState.k_RandomBetweenTwoGradients }; bool[] flagArray = new bool[4] { (gradientProp.m_AllowColor ? 1 : 0) != 0, (gradientProp.m_AllowGradient ? 1 : 0) != 0, (gradientProp.m_AllowRandomBetweenTwoColors ? 1 : 0) != 0, (gradientProp.m_AllowRandomBetweenTwoGradients ? 1 : 0) != 0 }; GenericMenu genericMenu = new GenericMenu(); for (int index = 0; index < guiContentArray.Length; ++index) { if (flagArray[index]) { genericMenu.AddItem(guiContentArray[index], gradientProp.state == maxGradientStateArray[index], new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxGradientStateCallback), (object)new ModuleUI.GradientCallbackData(maxGradientStateArray[index], gradientProp)); } } genericMenu.ShowAsContext(); Event.current.Use(); }
private void MultiParticleSystemGUI(bool verticalLayout) { ParticleSystem root = ParticleSystemEditorUtils.GetRoot(this.m_SelectedParticleSystem); GUILayout.BeginVertical(ParticleSystemStyles.Get().effectBgStyle, new GUILayoutOption[0]); this.m_EmitterAreaScrollPos = EditorGUILayout.BeginScrollView(this.m_EmitterAreaScrollPos, new GUILayoutOption[0]); Rect position = EditorGUILayout.BeginVertical(new GUILayoutOption[0]); this.m_EmitterAreaScrollPos -= EditorGUI.MouseDeltaReader(position, Event.current.alt); GUILayout.Space(3f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(3f); Color color = GUI.color; bool flag = Event.current.type == EventType.Repaint; bool flag2 = this.IsShowOnlySelectedMode(); List <ParticleSystemUI> selectedParticleSystemUIs = this.GetSelectedParticleSystemUIs(); for (int i = 0; i < this.m_Emitters.Length; i++) { if (i != 0) { GUILayout.Space(ModuleUI.k_SpaceBetweenModules); } bool flag3 = selectedParticleSystemUIs.Contains(this.m_Emitters[i]); ModuleUI particleSystemRendererModuleUI = this.m_Emitters[i].GetParticleSystemRendererModuleUI(); if (flag && particleSystemRendererModuleUI != null && !particleSystemRendererModuleUI.enabled) { GUI.color = ParticleEffectUI.GetDisabledColor(); } if (flag && flag2 && !flag3) { GUI.color = ParticleEffectUI.GetDisabledColor(); } Rect rect = EditorGUILayout.BeginVertical(new GUILayoutOption[0]); if (flag && flag3 && this.m_Emitters.Length > 1) { this.DrawSelectionMarker(rect); } this.m_Emitters[i].OnGUI(root, ModuleUI.k_CompactFixedModuleWidth, true); EditorGUILayout.EndVertical(); GUI.color = color; } GUILayout.Space(5f); if (GUILayout.Button(ParticleEffectUI.s_Texts.addParticleSystem, "OL Plus", new GUILayoutOption[] { GUILayout.Width(20f) })) { this.CreateParticleSystem(root, SubModuleUI.SubEmitterType.None); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(4f); this.m_EmitterAreaScrollPos -= EditorGUI.MouseDeltaReader(position, true); GUILayout.FlexibleSpace(); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); GUILayout.EndVertical(); this.HandleKeyboardShortcuts(root); }
public static int GUIPopup(GUIContent label, int intValue, string[] options) { Rect rect = ModuleUI.GetControlRect(13); rect = ModuleUI.PrefixLabel(rect, label); return(EditorGUI.Popup(rect, intValue, options, ParticleSystemStyles.Get().popup)); }
public static void GUIObject(GUIContent label, SerializedProperty objectProp) { Rect rect = ModuleUI.GetControlRect(13); rect = ModuleUI.PrefixLabel(rect, label); EditorGUI.ObjectField(rect, objectProp, null, GUIContent.none, ParticleSystemStyles.Get().objectField); }
void DrawSubEmitterElementCallback(Rect rect, int index, bool isActive, bool isFocused) { var subEmitterData = m_SubEmitters.GetArrayElementAtIndex(index); var subEmitter = subEmitterData.FindPropertyRelative("emitter"); var type = subEmitterData.FindPropertyRelative("type"); var properties = subEmitterData.FindPropertyRelative("properties"); var emitProbability = subEmitterData.FindPropertyRelative("emitProbability"); rect.height = kSingleLineHeight; rect.y += kSubEmitterPadding; Rect typeRect = new Rect(rect.x, rect.y, EditorGUIUtility.labelWidth - EditorGUI.kSpacing, rect.height); Rect objectRect = new Rect(rect.x + EditorGUIUtility.labelWidth, rect.y, rect.width - EditorGUIUtility.labelWidth - EditorGUI.kSpacing * 3, rect.height); GUIPopup(typeRect, GUIContent.none, type, s_Texts.subEmitterTypes); GUIObject(objectRect, GUIContent.none, subEmitter, null); if (subEmitter.objectReferenceValue == null) { Rect buttonRect = new Rect(objectRect.xMax + EditorGUI.kSpacing, rect.y + 4, ParticleSystemStyles.Get().plus.fixedWidth, rect.height); if (GUI.Button(buttonRect, s_Texts.create, ParticleSystemStyles.Get().plus)) { CreateSubEmitter(subEmitter, index, (SubEmitterType)type.intValue); } } rect.y += EditorGUIUtility.standardVerticalSpacing + rect.height; GUIMask(rect, s_Texts.inherit, properties, s_Texts.propertyTypes); rect.y += EditorGUIUtility.standardVerticalSpacing + rect.height; GUIFloat(rect, s_Texts.emitProbability, emitProbability); }
private static Rect PrefixLabel(Rect totalPosition, GUIContent label) { Rect labelPosition = new Rect(totalPosition.x + EditorGUI.indent, totalPosition.y, EditorGUIUtility.labelWidth - EditorGUI.indent, 13f); Rect result = new Rect(totalPosition.x + EditorGUIUtility.labelWidth, totalPosition.y, totalPosition.width - EditorGUIUtility.labelWidth, totalPosition.height); EditorGUI.HandlePrefixLabel(totalPosition, labelPosition, label, 0, ParticleSystemStyles.Get().label); return(result); }
public static bool GUIToggle(GUIContent guiContent, bool boolValue) { Rect rect = ModuleUI.GetControlRect(13); rect = ModuleUI.PrefixLabel(rect, guiContent); boolValue = EditorGUI.Toggle(rect, boolValue, ParticleSystemStyles.Get().toggle); return(boolValue); }
private void DrawSelectionMarker(Rect rect) { rect.x++; rect.y++; rect.width -= 2f; rect.height -= 2f; ParticleSystemStyles.Get().selectionMarker.Draw(rect, GUIContent.none, false, true, true, false); }
public virtual bool DrawHeader(Rect rect, GUIContent label) { label = EditorGUI.BeginProperty(rect, label, m_ModuleRootProperty); var toggleState = GUI.Toggle(rect, foldout, label, ParticleSystemStyles.Get().moduleHeaderStyle); EditorGUI.EndProperty(); return(toggleState); }
public static int GUIPopup(GUIContent label, SerializedProperty intProp, string[] options, params GUILayoutOption[] layoutOptions) { Rect rect = ModuleUI.GetControlRect(13, layoutOptions); rect = ModuleUI.PrefixLabel(rect, label); intProp.intValue = EditorGUI.Popup(rect, intProp.intValue, options, ParticleSystemStyles.Get().popup); return(intProp.intValue); }
public override bool DrawHeader(Rect rect, GUIContent label) { label = EditorGUI.BeginProperty(rect, label, this.m_ModuleRootProperty); bool result = GUI.Toggle(rect, base.foldout, label, ParticleSystemStyles.Get().emitterHeaderStyle); EditorGUI.EndProperty(); return(result); }
private void DrawVertexStreamListElementCallback(Rect rect, int index, bool isActive, bool isFocused) { SerializedProperty arrayElementAtIndex = this.m_VertexStreams.GetArrayElementAtIndex(index); int intValue = arrayElementAtIndex.intValue; string text = (!base.isWindowView) ? "TEXCOORD" : "TEX"; string text2 = (!base.isWindowView) ? "INSTANCED" : "INST"; int num = RendererModuleUI.s_Texts.vertexStreamTexCoordChannels[intValue]; if (this.m_HasGPUInstancing && intValue >= RendererModuleUI.s_Texts.vertexStreamsInstancedStart) { string text3 = RendererModuleUI.s_Texts.channels.Substring(0, num); GUI.Label(rect, string.Concat(new object[] { RendererModuleUI.s_Texts.vertexStreamsPacked[intValue], " (", text2, this.m_NumInstancedStreams, ".", text3, ")" }), ParticleSystemStyles.Get().label); this.m_NumInstancedStreams++; } else if (num != 0) { int length = (this.m_TexCoordChannelIndex + num <= 4) ? num : (num + 1); string text4 = RendererModuleUI.s_Texts.channels.Substring(this.m_TexCoordChannelIndex, length); GUI.Label(rect, string.Concat(new object[] { RendererModuleUI.s_Texts.vertexStreamsPacked[intValue], " (", text, this.m_NumTexCoords, ".", text4, ")" }), ParticleSystemStyles.Get().label); this.m_TexCoordChannelIndex += num; if (this.m_TexCoordChannelIndex >= 4) { this.m_TexCoordChannelIndex -= 4; this.m_NumTexCoords++; } } else { GUI.Label(rect, RendererModuleUI.s_Texts.vertexStreamsPacked[intValue] + " (" + RendererModuleUI.s_Texts.vertexStreamPackedTypes[intValue] + ")", ParticleSystemStyles.Get().label); if (RendererModuleUI.s_Texts.vertexStreamsPacked[intValue] == "Tangent") { this.m_HasTangent = true; } if (RendererModuleUI.s_Texts.vertexStreamsPacked[intValue] == "Color") { this.m_HasColor = true; } } }
private void DoBurstGUI(InitialModuleUI initial) { EditorGUILayout.Space(); Rect controlRect = ModuleUI.GetControlRect(13, new GUILayoutOption[0]); GUI.Label(controlRect, EmissionModuleUI.s_Texts.burst, ParticleSystemStyles.Get().label); this.m_BurstList.displayAdd = (this.m_Bursts.arraySize < 8); this.m_BurstList.DoLayoutList(); }
private void ShowSubEmitter(int index) { GUILayout.BeginHorizontal(GUILayout.Height(EditorGUI.kSingleLineHeight)); SerializedProperty subEmitterData = m_SubEmitters.GetArrayElementAtIndex(index); SerializedProperty subEmitter = subEmitterData.FindPropertyRelative("emitter"); SerializedProperty type = subEmitterData.FindPropertyRelative("type"); SerializedProperty properties = subEmitterData.FindPropertyRelative("properties"); GUIPopup(GUIContent.none, type, s_Texts.subEmitterTypes, GUILayout.MaxWidth(80)); GUILayout.Label("", ParticleSystemStyles.Get().label, GUILayout.Width(4)); GUIObject(GUIContent.none, subEmitter); var olPlusStyle = new GUIStyle("OL Plus"); if (subEmitter.objectReferenceValue == null) { GUILayout.Label("", ParticleSystemStyles.Get().label, GUILayout.Width(8)); GUILayout.BeginVertical(GUILayout.Width(16), GUILayout.Height(olPlusStyle.fixedHeight)); GUILayout.FlexibleSpace(); if (GUILayout.Button(GUIContent.none, ParticleSystemStyles.Get().plus)) { CreateSubEmitter(subEmitter, index, (SubEmitterType)type.intValue); } GUILayout.FlexibleSpace(); GUILayout.EndVertical(); } else { GUILayout.Label("", ParticleSystemStyles.Get().label, GUILayout.Width(24)); } GUIMask(GUIContent.none, properties, s_Texts.propertyTypes, GUILayout.Width(100)); GUILayout.Label("", ParticleSystemStyles.Get().label, GUILayout.Width(8)); // add plus button to first element if (index == 0) { if (GUILayout.Button(GUIContent.none, olPlusStyle, GUILayout.Width(16))) { m_SubEmitters.InsertArrayElementAtIndex(m_SubEmitters.arraySize); SerializedProperty newSubEmitterData = m_SubEmitters.GetArrayElementAtIndex(m_SubEmitters.arraySize - 1); SerializedProperty newSubEmitter = newSubEmitterData.FindPropertyRelative("emitter"); newSubEmitter.objectReferenceValue = null; } } // add minus button to all other elements else { if (GUILayout.Button(GUIContent.none, new GUIStyle("OL Minus"), GUILayout.Width(16))) { m_SubEmitters.DeleteArrayElementAtIndex(index); } } GUILayout.EndHorizontal(); }
private static bool Toggle(Rect rect, SerializedProperty boolProp) { bool boolValue = boolProp.boolValue; bool flag = EditorGUI.Toggle(rect, boolValue, ParticleSystemStyles.Get().toggle); if (boolValue != flag) { boolProp.boolValue = flag; } return(flag); }
internal static void DrawRenderingLayer(SerializedProperty layerMask, Renderer target, Object[] targets, bool useMiniStyle = false) { RenderPipelineAsset srpAsset = GraphicsSettings.currentRenderPipeline; bool usingSRP = srpAsset != null; if (!usingSRP || target == null) { return; } EditorGUI.showMixedValue = layerMask.hasMultipleDifferentValues; var renderer = target; var mask = (int)renderer.renderingLayerMask; var layerNames = srpAsset.renderingLayerMaskNames; if (layerNames == null) { layerNames = defaultRenderingLayerNames; } EditorGUI.BeginChangeCheck(); var rect = EditorGUILayout.GetControlRect(); EditorGUI.BeginProperty(rect, Styles.renderingLayerMask, layerMask); if (useMiniStyle) { rect = ModuleUI.PrefixLabel(rect, Styles.renderingLayerMask); mask = EditorGUI.MaskField(rect, GUIContent.none, mask, layerNames, ParticleSystemStyles.Get().popup); } else { mask = EditorGUI.MaskField(rect, Styles.renderingLayerMask, mask, layerNames); } EditorGUI.EndProperty(); if (EditorGUI.EndChangeCheck()) { Undo.RecordObjects(targets, "Set rendering layer mask"); foreach (var t in targets) { var r = t as Renderer; if (r != null) { r.renderingLayerMask = (uint)mask; EditorUtility.SetDirty(t); } } } EditorGUI.showMixedValue = false; }
public static bool GUIBoolAsPopup(GUIContent label, SerializedProperty boolProp, string[] options) { Rect position = ModuleUI.PrefixLabel(ModuleUI.GetControlRect(13), label); int selectedIndex = !boolProp.boolValue ? 0 : 1; int num = EditorGUI.Popup(position, selectedIndex, options, ParticleSystemStyles.Get().popup); if (num != selectedIndex) { boolProp.boolValue = num > 0; } return(num > 0); }
protected override void Init() { // Already initialized? if (m_StrengthX != null) { return; } if (s_Texts == null) { s_Texts = new Texts(); } m_StrengthX = new SerializedMinMaxCurve(this, s_Texts.x, "strength", kUseSignedRange); m_StrengthY = new SerializedMinMaxCurve(this, s_Texts.y, "strengthY", kUseSignedRange); m_StrengthZ = new SerializedMinMaxCurve(this, s_Texts.z, "strengthZ", kUseSignedRange); m_SeparateAxes = GetProperty("separateAxes"); m_Damping = GetProperty("damping"); m_Frequency = GetProperty("frequency"); m_Octaves = GetProperty("octaves"); m_OctaveMultiplier = GetProperty("octaveMultiplier"); m_OctaveScale = GetProperty("octaveScale"); m_Quality = GetProperty("quality"); m_ScrollSpeed = new SerializedMinMaxCurve(this, s_Texts.scrollSpeed, "scrollSpeed", kUseSignedRange); m_ScrollSpeed.m_AllowRandom = false; m_RemapX = new SerializedMinMaxCurve(this, s_Texts.x, "remap", kUseSignedRange); m_RemapY = new SerializedMinMaxCurve(this, s_Texts.y, "remapY", kUseSignedRange); m_RemapZ = new SerializedMinMaxCurve(this, s_Texts.z, "remapZ", kUseSignedRange); m_RemapX.m_AllowRandom = false; m_RemapY.m_AllowRandom = false; m_RemapZ.m_AllowRandom = false; m_RemapX.m_AllowConstant = false; m_RemapY.m_AllowConstant = false; m_RemapZ.m_AllowConstant = false; m_RemapEnabled = GetProperty("remapEnabled"); m_PositionAmount = new SerializedMinMaxCurve(this, s_Texts.positionAmount, "positionAmount", kUseSignedRange); m_RotationAmount = new SerializedMinMaxCurve(this, s_Texts.rotationAmount, "rotationAmount", kUseSignedRange); m_SizeAmount = new SerializedMinMaxCurve(this, s_Texts.sizeAmount, "sizeAmount", kUseSignedRange); if (s_PreviewTexture == null) { s_PreviewTexture = new Texture2D(k_PreviewSize, k_PreviewSize, TextureFormat.RGBA32, false, true); s_PreviewTexture.name = "ParticleNoisePreview"; s_PreviewTexture.filterMode = FilterMode.Bilinear; s_PreviewTexture.hideFlags = HideFlags.HideAndDontSave; s_Texts.previewTexture.image = s_PreviewTexture; s_Texts.previewTextureMultiEdit.image = s_PreviewTexture; } s_PreviewTextureDirty = true; previewTextureStyle = new GUIStyle(ParticleSystemStyles.Get().label); previewTextureStyle.alignment = TextAnchor.LowerCenter; previewTextureStyle.imagePosition = ImagePosition.ImageAbove; }
public override bool DrawHeader(Rect rect, GUIContent label) { // When displaying prefab overrides, the whole UI is disabled, but we still need to be able to expand the modules to see the settings - this doesn't modify the asset bool wasEnabled = GUI.enabled; GUI.enabled = true; var toggleState = GUI.Toggle(rect, foldout, label, ParticleSystemStyles.Get().emitterHeaderStyle); GUI.enabled = wasEnabled; return(toggleState); }
public static void GUIMMColorPopUp(Rect rect, SerializedProperty boolProp) { if (EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown)) { GenericMenu menu = new GenericMenu(); GUIContent[] contentArray = new GUIContent[] { new GUIContent("Constant Color"), new GUIContent("Random Between Two Colors") }; bool[] flagArray1 = new bool[2]; flagArray1[1] = true; bool[] flagArray = flagArray1; for (int i = 0; i < contentArray.Length; i++) { if (< > f__mg$cache2 == null) {