public virtual void OnDisable() { ExitBlueprintEditMode(); #if (UNITY_2019_1_OR_NEWER) RenderPipelineManager.beginCameraRendering -= renderCallback; #endif Camera.onPreCull -= DrawWithCamera; ObiParticleEditorDrawing.DestroyParticlesMesh(); foreach (var tool in tools) { tool.OnDisable(); tool.OnDestroy(); } foreach (var renderMode in renderModes) { renderMode.OnDestroy(); } properties.Clear(); renderModes.Clear(); }
public virtual void OnDisable() { ExitBlueprintEditMode(); Camera.onPreCull -= DrawWithCamera; ObiParticleEditorDrawing.DestroyParticlesMesh(); foreach (var tool in tools) { tool.OnDisable(); tool.OnDestroy(); } foreach (var renderMode in renderModes) { renderMode.OnDestroy(); } }
public virtual void OnSceneGUI(SceneView sceneView) { if (!isEditing || sceneView.camera == null) { return; } ResizeParticleArrays(); Event e = Event.current; if (e.type == EventType.Repaint) { // Update camera facing status and world space positions array: UpdateParticleVisibility(); // Generate sorted indices for back-to-front rendering: for (int i = 0; i < sortedIndices.Length; i++) { sortedIndices[i] = i; } Array.Sort <int>(sortedIndices, (a, b) => sqrDistanceToCamera[b].CompareTo(sqrDistanceToCamera[a])); // render modes OnSceneRepaint: for (int i = 0; i < renderModes.Count; ++i) { if ((1 << i & renderModeFlags) != 0) { renderModes[i].OnSceneRepaint(sceneView); } } // property OnSceneRepaint: currentProperty.OnSceneRepaint(); // Draw particle handles: ObiParticleEditorDrawing.DrawParticles(sceneView.camera, blueprint, visible, selectionStatus, sortedIndices); } if (currentTool != null) { currentTool.OnSceneGUI(sceneView); } }