void Start() { if (fluid_simulation == null) { fluid_simulation = GetComponent <FluidSimulation3D>(); } UpdateCollisionVolume();// Create invisible collider to detect collisions }
public override void OnInspectorGUI() { collision_interactor = (FluidCollisionInteractor)target; simulation = collision_interactor.GetComponent <FluidSimulation3D>(); EditorGUI.BeginDisabledGroup(true);// Default script ref EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour(collision_interactor), typeof(FluidCollisionInteractor), false); EditorGUI.EndDisabledGroup(); if (simulation == null)// Only allow transform setting if not on a fluid sim { EditorGUILayout.PropertyField(serializedObject.FindProperty("fluid_simulation"), false); } }
protected virtual void DrawDebugControlsGroup(FluidSimulation3D _sim) { StartGroup("Simulation Debug Controls"); EditorGUILayout.PropertyField(serializedObject.FindProperty("draw_bounds"), true);//debug paramaters to display EditorGUILayout.PropertyField(serializedObject.FindProperty("velocity_debug"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("velocity_debug_resolution"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("velocity_debug_colour_threshold"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("velocity_debug_normalise"), true); if (GUILayout.Button("Reset Simulation") && Application.isPlaying)//button for reseting simulation { _sim.ResetSim(); } EndGroup(); }