protected override void Init() { if (this.m_Inside == null) { if (TriggerModuleUI.s_Texts == null) { TriggerModuleUI.s_Texts = new TriggerModuleUI.Texts(); } List <SerializedProperty> list = new List <SerializedProperty>(); for (int i = 0; i < this.m_CollisionShapes.Length; i++) { this.m_CollisionShapes[i] = base.GetProperty("collisionShape" + i); if (i == 0 || this.m_CollisionShapes[i].objectReferenceValue != null) { list.Add(this.m_CollisionShapes[i]); } } this.m_ShownCollisionShapes = list.ToArray(); this.m_Inside = base.GetProperty("inside"); this.m_Outside = base.GetProperty("outside"); this.m_Enter = base.GetProperty("enter"); this.m_Exit = base.GetProperty("exit"); this.m_RadiusScale = base.GetProperty("radiusScale"); TriggerModuleUI.s_VisualizeBounds = EditorPrefs.GetBool("VisualizeTriggerBounds", false); } }
public override void OnInspectorGUI(ParticleSystem s) { if (TriggerModuleUI.s_Texts == null) { TriggerModuleUI.s_Texts = new TriggerModuleUI.Texts(); } this.DoListOfCollisionShapesGUI(); ModuleUI.GUIPopup(TriggerModuleUI.s_Texts.inside, this.m_Inside, TriggerModuleUI.s_Texts.overlapOptions, new GUILayoutOption[0]); ModuleUI.GUIPopup(TriggerModuleUI.s_Texts.outside, this.m_Outside, TriggerModuleUI.s_Texts.overlapOptions, new GUILayoutOption[0]); ModuleUI.GUIPopup(TriggerModuleUI.s_Texts.enter, this.m_Enter, TriggerModuleUI.s_Texts.overlapOptions, new GUILayoutOption[0]); ModuleUI.GUIPopup(TriggerModuleUI.s_Texts.exit, this.m_Exit, TriggerModuleUI.s_Texts.overlapOptions, new GUILayoutOption[0]); ModuleUI.GUIFloat(TriggerModuleUI.s_Texts.radiusScale, this.m_RadiusScale, new GUILayoutOption[0]); EditorGUI.BeginChangeCheck(); TriggerModuleUI.s_VisualizeBounds = ModuleUI.GUIToggle(TriggerModuleUI.s_Texts.visualizeBounds, TriggerModuleUI.s_VisualizeBounds, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool("VisualizeTriggerBounds", TriggerModuleUI.s_VisualizeBounds); } }