/// <summary> /// Handles drawing the selection rect /// </summary> public override void AfterNodeRender() { if (!IsActivated) { return; } GUIExtensions.ColouredBox(selectionRect, SelectionColor, null); }
private void RenderImportSection() { Rect sceneImportSection = EditorGUILayout.BeginVertical(); EditorGUILayout.Space(); if (Event.current.type == EventType.Repaint) { GUIExtensions.ColouredBox(sceneImportSection, Color.gray, GUIContent.none); } EditorGUI.indentLevel++; RenderTypeSelection(); EditorGUI.BeginChangeCheck(); populatorEditor.DrawExcludingScript(serializedSceneManager.ScenePopulator); if (EditorGUI.EndChangeCheck()) { serializedSceneManager.ScenePopulator.ApplyModifiedProperties(); } EditorGUI.indentLevel--; EditorGUILayout.Space(); if (GUILayout.Button("Import Scenes")) { ImportScenes(); } EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(clearScenesContent)) { ClearExistingBuildScenes(); } if (GUILayout.Button("Send To Build", GUILayout.MinWidth(GUI.skin.button.CalcSize(clearScenesContent).x))) { SendToBuildSettings(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); }
private void OnDrawBackground(Rect rect, int index, bool isActive, bool isSelected) { if (isSelected) { GUIExtensions.ColouredBox(rect, GUI.skin.settings.selectionColor, ZPCommonResources.SimpleSolidBackground); return; } GUIExtensions.ColouredBox(rect, ZPCommonResources.GetElementBgColor(index, EditorGUIUtility.isProSkin), ZPCommonResources.SimpleSolidBackground); }
public override void Draw(Vector2 nodeOffset) { if (Event.current.type != EventType.Repaint) { return; } GUIStyle nodeStyle = GetNodeStyle(); InitializeGUIContent(nodeStyle); Rect renderRect = GetNodeRect(nodeOffset); Color drawColor = IsSelected() ? SelectedColor : NormalColor; GUIExtensions.ColouredBox(renderRect, drawColor, nodeTextContent, nodeStyle); }
/// <summary> /// Handles drawing the background before applying the element on top /// </summary> /// <param name="rect">The rectangle to render the variable in</param> /// <param name="index">The index of the property</param> /// <param name="isActive">True if the element is active, false if not</param> /// <param name="isSelected">True if the element is selected, false if not</param> private void DrawBackground(Rect rect, int index, bool isActive, bool isSelected) { int finalIndex = index; if (HasFilterString()) { filterIndices.TryGetValue(index, out finalIndex); } Color color = ZPCommonResources.GetElementBgColor(finalIndex, EditorGUIUtility.isProSkin); if (isSelected) { color = GUI.skin.settings.selectionColor; } GUIExtensions.ColouredBox(rect, color, ZPCommonResources.SimpleSolidBackground); }