private void SyncVisualization() { if (!base.enabled) { return; } if (this.m_PlaneVisualizationType != CollisionModuleUI.PlaneVizType.Solid) { return; } for (int i = 0; i < this.m_ShownPlanes.Length; i++) { UnityEngine.Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue; if (!(objectReferenceValue == null)) { Transform transform = objectReferenceValue as Transform; if (!(transform == null)) { GameObject plane = ParticleEffectUtils.GetPlane(i); plane.transform.position = transform.position; plane.transform.rotation = transform.rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); } } } }
private void SyncVisualization() { if (base.enabled) { if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Solid) { for (int i = 0; i < this.m_ShownPlanes.Length; i++) { UnityEngine.Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue; if (objectReferenceValue == null) { ParticleEffectUtils.HidePlaneIfExists(i); } else { Transform transform = objectReferenceValue as Transform; if (transform == null) { ParticleEffectUtils.HidePlaneIfExists(i); } else { GameObject plane = ParticleEffectUtils.GetPlane(i); plane.transform.position = transform.position; plane.transform.rotation = transform.rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); plane.transform.position += transform.up.normalized * 0.002f; } } } } } }
public override void OnSceneGUI(ParticleSystem s, InitialModuleUI initial) { Event current = Event.current; EventType rawType = current.type; if ((current.type == EventType.Ignore) && (current.rawType == EventType.MouseUp)) { rawType = current.rawType; } Color color = Handles.color; Color color2 = new Color(1f, 1f, 1f, 0.5f); Handles.color = color2; if (this.m_Type.intValue == 0) { for (int i = 0; i < this.m_ShownPlanes.Length; i++) { UnityEngine.Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue; if (objectReferenceValue != null) { Transform objB = objectReferenceValue as Transform; if (objB != null) { Vector3 position = objB.position; Quaternion rotation = objB.rotation; Vector3 vector2 = (Vector3)(rotation * Vector3.right); Vector3 normal = (Vector3)(rotation * Vector3.up); Vector3 vector4 = (Vector3)(rotation * Vector3.forward); if (object.ReferenceEquals(s_SelectedTransform, objB)) { Tools.s_Hidden = true; EditorGUI.BeginChangeCheck(); if (Tools.current == UnityEditor.Tool.Move) { objB.position = Handles.PositionHandle(position, rotation); } else if (Tools.current == UnityEditor.Tool.Rotate) { objB.rotation = Handles.RotationHandle(rotation, position); } if (EditorGUI.EndChangeCheck()) { if (this.m_PlaneVisualizationType == PlaneVizType.Solid) { GameObject plane = ParticleEffectUtils.GetPlane(i); plane.transform.position = position; plane.transform.rotation = rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); } ParticleSystemEditorUtils.PerformCompleteResimulation(); } } else { int keyboardControl = GUIUtility.keyboardControl; float size = HandleUtility.GetHandleSize(position) * 0.06f; if (< > f__mg$cache0 == null) {
private void SyncVisualization() { if (!this.enabled || this.m_PlaneVisualizationType != CollisionModuleUI.PlaneVizType.Solid) { return; } for (int index = 0; index < this.m_ShownPlanes.Length; ++index) { Object objectReferenceValue = this.m_ShownPlanes[index].objectReferenceValue; if (!(objectReferenceValue == (Object)null)) { Transform transform = objectReferenceValue as Transform; if (!((Object)transform == (Object)null)) { GameObject plane = ParticleEffectUtils.GetPlane(index); plane.transform.position = transform.position; plane.transform.rotation = transform.rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); plane.transform.position += transform.up.normalized * (1f / 500f); } } } }
private void SyncVisualization() { if (base.enabled && (this.m_PlaneVisualizationType == PlaneVizType.Solid)) { for (int i = 0; i < this.m_ShownPlanes.Length; i++) { Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue; if (objectReferenceValue != null) { Transform transform = objectReferenceValue as Transform; if (transform != null) { GameObject plane = ParticleEffectUtils.GetPlane(i); plane.transform.position = transform.position; plane.transform.rotation = transform.rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); Transform transform1 = plane.transform; transform1.position += (Vector3)(transform.up.normalized * 0.002f); } } } } }
public override void OnSceneGUI(ParticleSystem s, InitialModuleUI initial) { Event current = Event.current; EventType eventType = current.type; if (current.type == EventType.Ignore && current.rawType == EventType.MouseUp) { eventType = current.rawType; } Color color1 = Handles.color; Handles.color = new Color(1f, 1f, 1f, 0.5f); if (this.m_Type.intValue == 0) { for (int index = 0; index < this.m_ShownPlanes.Length; ++index) { Object objectReferenceValue = this.m_ShownPlanes[index].objectReferenceValue; if (objectReferenceValue != (Object)null) { Transform transform = objectReferenceValue as Transform; if ((Object)transform != (Object)null) { Vector3 position = transform.position; Quaternion rotation = transform.rotation; Vector3 axis1 = rotation * Vector3.right; Vector3 normal = rotation * Vector3.up; Vector3 axis2 = rotation * Vector3.forward; if (object.ReferenceEquals((object)CollisionModuleUI.m_SelectedTransform, (object)transform)) { Tools.s_Hidden = true; EditorGUI.BeginChangeCheck(); if (Tools.current == Tool.Move) { transform.position = Handles.PositionHandle(position, rotation); } else if (Tools.current == Tool.Rotate) { transform.rotation = Handles.RotationHandle(rotation, position); } if (EditorGUI.EndChangeCheck()) { if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Solid) { GameObject plane = ParticleEffectUtils.GetPlane(index); plane.transform.position = position; plane.transform.rotation = rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); } ParticleSystemEditorUtils.PerformCompleteResimulation(); } } else { int keyboardControl = GUIUtility.keyboardControl; float size = HandleUtility.GetHandleSize(position) * 0.06f; Handles.FreeMoveHandle(position, Quaternion.identity, size, Vector3.zero, new Handles.DrawCapFunction(Handles.RectangleCap)); if (eventType == EventType.MouseDown && current.type == EventType.Used && keyboardControl != GUIUtility.keyboardControl) { CollisionModuleUI.m_SelectedTransform = transform; eventType = EventType.Used; } } if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Grid) { Color color2 = Handles.s_ColliderHandleColor * 0.9f; if (!this.enabled) { color2 = new Color(0.7f, 0.7f, 0.7f, 0.7f); } this.DrawGrid(position, axis1, axis2, normal, color2, index); } else { this.DrawSolidPlane(position, rotation, index); } } else { Debug.LogError((object)("Not a transform: " + (object)objectReferenceValue.GetType())); } } } } Handles.color = color1; }
public override void OnSceneGUI(ParticleSystem s, InitialModuleUI initial) { Event current = Event.current; EventType rawType = current.type; if ((current.type == EventType.Ignore) && (current.rawType == EventType.MouseUp)) { rawType = current.rawType; } Color color = Handles.color; Color color2 = new Color(1f, 1f, 1f, 0.5f); Handles.color = color2; if (this.m_Type.intValue == 0) { for (int i = 0; i < this.m_ShownPlanes.Length; i++) { Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue; if (objectReferenceValue != null) { Transform objB = objectReferenceValue as Transform; if (objB != null) { Vector3 position = objB.position; Quaternion rotation = objB.rotation; Vector3 vector2 = (Vector3)(rotation * Vector3.right); Vector3 normal = (Vector3)(rotation * Vector3.up); Vector3 vector4 = (Vector3)(rotation * Vector3.forward); if (object.ReferenceEquals(m_SelectedTransform, objB)) { Tools.s_Hidden = true; EditorGUI.BeginChangeCheck(); if (Tools.current == Tool.Move) { objB.position = Handles.PositionHandle(position, rotation); } else if (Tools.current == Tool.Rotate) { objB.rotation = Handles.RotationHandle(rotation, position); } if (EditorGUI.EndChangeCheck()) { if (this.m_PlaneVisualizationType == PlaneVizType.Solid) { GameObject plane = ParticleEffectUtils.GetPlane(i); plane.transform.position = position; plane.transform.rotation = rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); } ParticleSystemEditorUtils.PerformCompleteResimulation(); } } else { int keyboardControl = GUIUtility.keyboardControl; float size = HandleUtility.GetHandleSize(position) * 0.06f; Handles.FreeMoveHandle(position, Quaternion.identity, size, Vector3.zero, new Handles.DrawCapFunction(Handles.RectangleCap)); if (((rawType == EventType.MouseDown) && (current.type == EventType.Used)) && (keyboardControl != GUIUtility.keyboardControl)) { m_SelectedTransform = objB; rawType = EventType.Used; } } if (this.m_PlaneVisualizationType == PlaneVizType.Grid) { Color color3 = (Color)(Handles.s_ColliderHandleColor * 0.9f); if (!base.enabled) { color3 = new Color(0.7f, 0.7f, 0.7f, 0.7f); } this.DrawGrid(position, vector2, vector4, normal, color3, i); } else { this.DrawSolidPlane(position, rotation, i); } } else { Debug.LogError("Not a transform: " + objectReferenceValue.GetType()); } } } } Handles.color = color; }
public override void OnSceneGUI(ParticleSystem s, InitialModuleUI initial) { Event current = Event.current; EventType eventType = current.type; if (current.type == EventType.Ignore && current.rawType == EventType.MouseUp) { eventType = current.rawType; } Color color = Handles.color; Color color2 = new Color(1f, 1f, 1f, 0.5f); Handles.color = color2; if (this.m_Type.intValue == 0) { for (int i = 0; i < this.m_ShownPlanes.Length; i++) { UnityEngine.Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue; if (objectReferenceValue != null) { Transform transform = objectReferenceValue as Transform; if (transform != null) { Vector3 position = transform.position; Quaternion rotation = transform.rotation; Vector3 axis = rotation * Vector3.right; Vector3 normal = rotation * Vector3.up; Vector3 axis2 = rotation * Vector3.forward; if (object.ReferenceEquals(CollisionModuleUI.s_SelectedTransform, transform)) { Tools.s_Hidden = true; EditorGUI.BeginChangeCheck(); if (Tools.current == Tool.Move) { transform.position = Handles.PositionHandle(position, rotation); } else if (Tools.current == Tool.Rotate) { transform.rotation = Handles.RotationHandle(rotation, position); } if (EditorGUI.EndChangeCheck()) { if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Solid) { GameObject plane = ParticleEffectUtils.GetPlane(i); plane.transform.position = position; plane.transform.rotation = rotation; plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid); } ParticleSystemEditorUtils.PerformCompleteResimulation(); } } else { int keyboardControl = GUIUtility.keyboardControl; float num = HandleUtility.GetHandleSize(position) * 0.06f; Vector3 arg_1EB_0 = position; Quaternion arg_1EB_1 = Quaternion.identity; float arg_1EB_2 = num; Vector3 arg_1EB_3 = Vector3.zero; if (CollisionModuleUI.< > f__mg$cache0 == null) { CollisionModuleUI.< > f__mg$cache0 = new Handles.CapFunction(Handles.RectangleHandleCap); } Handles.FreeMoveHandle(arg_1EB_0, arg_1EB_1, arg_1EB_2, arg_1EB_3, CollisionModuleUI.< > f__mg$cache0); if (eventType == EventType.MouseDown && current.type == EventType.Used && keyboardControl != GUIUtility.keyboardControl) { CollisionModuleUI.s_SelectedTransform = transform; eventType = EventType.Used; } } if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Grid) { Color color3 = Handles.s_ColliderHandleColor * 0.9f; if (!base.enabled) { color3 = new Color(0.7f, 0.7f, 0.7f, 0.7f); } this.DrawGrid(position, axis, axis2, normal, color3, i); } else { this.DrawSolidPlane(position, rotation, i); } } else { Debug.LogError("Not a transform: " + objectReferenceValue.GetType()); } } } } Handles.color = color; }