DoGUI() public static method

public static DoGUI ( string title, bool &show, Vector2 &scrollPos, GetValueFunc getValue, SetValueFunc setValue ) : void
title string
show bool
scrollPos Vector2
getValue GetValueFunc
setValue SetValueFunc
return void
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            DrawPropertiesExcluding(serializedObject, "m_JobOptions");

            GUILayout.BeginHorizontal();
            GUILayout.Space(0);
            EditorGUILayout.PropertyField(m_JobOptions, Styles.kJobOptionsLabel, true);
            GUILayout.EndHorizontal();

            m_GizmoSettingsFade.value = m_GizmoSettingsFade.target = EditorGUILayout.Foldout(m_GizmoSettingsFade.target, Styles.kGizmosLabel, true);

            if (m_GizmoSettingsFade.value)
            {
                if (EditorGUILayout.BeginFadeGroup(m_GizmoSettingsFade.faded))
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.PropertyField(m_AlwaysShowColliders);
                    EditorGUILayout.PropertyField(m_ShowColliderSleep);
                    EditorGUILayout.PropertyField(m_ColliderAwakeColor);
                    EditorGUILayout.PropertyField(m_ColliderAsleepColor);
                    EditorGUILayout.PropertyField(m_ShowColliderContacts);
                    EditorGUILayout.Slider(m_ContactArrowScale, 0.1f, 1.0f, m_ContactArrowScale.displayName);
                    EditorGUILayout.PropertyField(m_ColliderContactColor);
                    EditorGUILayout.PropertyField(m_ShowColliderAABB);
                    EditorGUILayout.PropertyField(m_ColliderAABBColor);
                    EditorGUI.indentLevel--;
                }
                EditorGUILayout.EndFadeGroup();
            }
            serializedObject.ApplyModifiedProperties();

            LayerMatrixGUI.DoGUI(Styles.kLayerCollisionMatrixLabel, ref m_ShowLayerCollisionMatrix, GetValue, SetValue);
        }
Esempio n. 2
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     Physics2DSettingsInspector.s_ShowGizmoSettings = EditorGUILayout.Foldout(Physics2DSettingsInspector.s_ShowGizmoSettings, "Gizmos");
     this.m_GizmoSettingsFade.target = Physics2DSettingsInspector.s_ShowGizmoSettings;
     if (this.m_GizmoSettingsFade.value)
     {
         base.serializedObject.Update();
         if (EditorGUILayout.BeginFadeGroup(this.m_GizmoSettingsFade.faded))
         {
             EditorGUI.indentLevel++;
             EditorGUILayout.PropertyField(this.m_AlwaysShowColliders, new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.m_ShowColliderSleep, new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.m_ColliderAwakeColor, new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.m_ColliderAsleepColor, new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.m_ShowColliderContacts, new GUILayoutOption[0]);
             EditorGUILayout.Slider(this.m_ContactArrowScale, 0.1f, 1f, this.m_ContactArrowScale.displayName, new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.m_ColliderContactColor, new GUILayoutOption[0]);
             EditorGUI.indentLevel--;
         }
         EditorGUILayout.EndFadeGroup();
         base.serializedObject.ApplyModifiedProperties();
     }
     LayerMatrixGUI.DoGUI("Layer Collision Matrix", ref this.m_ShowLayerCollisionMatrix, ref this.m_LayerCollisionMatrixScrollPos, new LayerMatrixGUI.GetValueFunc(Physics2DSettingsInspector.GetValue), new LayerMatrixGUI.SetValueFunc(Physics2DSettingsInspector.SetValue));
 }
Esempio n. 3
0
        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            Editor.DrawPropertiesExcluding(base.serializedObject, new string[]
            {
                "m_ClothInterCollisionDistance",
                "m_ClothInterCollisionStiffness",
                "m_ClothInterCollisionSettingsToggle"
            });
            base.serializedObject.ApplyModifiedProperties();
            LayerMatrixGUI.DoGUI("Layer Collision Matrix", ref this.show, ref this.scrollPos, new LayerMatrixGUI.GetValueFunc(this.GetValue), new LayerMatrixGUI.SetValueFunc(this.SetValue));
            EditorGUI.BeginChangeCheck();
            bool interCollisionSettingsToggle = EditorGUILayout.Toggle(PhysicsManagerInspector.Styles.interCollisionPropertiesLabel, Physics.interCollisionSettingsToggle, new GUILayoutOption[0]);
            bool flag = EditorGUI.EndChangeCheck();

            if (flag)
            {
                Undo.RecordObject(base.target, "Change inter collision settings");
                Physics.interCollisionSettingsToggle = interCollisionSettingsToggle;
            }
            if (Physics.interCollisionSettingsToggle)
            {
                EditorGUI.indentLevel++;
                EditorGUI.BeginChangeCheck();
                float num   = EditorGUILayout.FloatField(PhysicsManagerInspector.Styles.interCollisionDistanceLabel, Physics.interCollisionDistance, new GUILayoutOption[0]);
                bool  flag2 = EditorGUI.EndChangeCheck();
                if (flag2)
                {
                    Undo.RecordObject(base.target, "Change inter collision distance");
                    if (num < 0f)
                    {
                        num = 0f;
                    }
                    Physics.interCollisionDistance = num;
                }
                EditorGUI.BeginChangeCheck();
                float num2  = EditorGUILayout.FloatField(PhysicsManagerInspector.Styles.interCollisionStiffnessLabel, Physics.interCollisionStiffness, new GUILayoutOption[0]);
                bool  flag3 = EditorGUI.EndChangeCheck();
                if (flag3)
                {
                    Undo.RecordObject(base.target, "Change inter collision stiffness");
                    if (num2 < 0f)
                    {
                        num2 = 0f;
                    }
                    Physics.interCollisionStiffness = num2;
                }
                EditorGUI.indentLevel--;
            }
        }
Esempio n. 4
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            DrawPropertiesExcluding(serializedObject, "m_ClothInterCollisionDistance", "m_ClothInterCollisionStiffness", "m_ClothInterCollisionSettingsToggle");
            serializedObject.ApplyModifiedProperties();

            LayerMatrixGUI.DoGUI(Styles.kLayerCollisionMatrixLabel, ref show, GetValue, SetValue);

            EditorGUI.BeginChangeCheck();
            bool collisionSettings = EditorGUILayout.Toggle(Styles.interCollisionPropertiesLabel, Physics.interCollisionSettingsToggle);
            bool settingsChanged   = EditorGUI.EndChangeCheck();

            if (settingsChanged)
            {
                Undo.RecordObject(target, "Change inter collision settings");
                Physics.interCollisionSettingsToggle = collisionSettings;
            }

            if (Physics.interCollisionSettingsToggle)
            {
                EditorGUI.indentLevel++;
                EditorGUI.BeginChangeCheck();
                float distance        = EditorGUILayout.FloatField(Styles.interCollisionDistanceLabel, Physics.interCollisionDistance);
                bool  distanceChanged = EditorGUI.EndChangeCheck();
                if (distanceChanged)
                {
                    Undo.RecordObject(target, "Change inter collision distance");
                    if (distance < 0.0f)
                    {
                        distance = 0.0f;
                    }
                    Physics.interCollisionDistance = distance;
                }

                EditorGUI.BeginChangeCheck();
                float stiffness        = EditorGUILayout.FloatField(Styles.interCollisionStiffnessLabel, Physics.interCollisionStiffness);
                bool  stiffnessChanged = EditorGUI.EndChangeCheck();
                if (stiffnessChanged)
                {
                    Undo.RecordObject(target, "Change inter collision stiffness");
                    if (stiffness < 0.0f)
                    {
                        stiffness = 0.0f;
                    }
                    Physics.interCollisionStiffness = stiffness;
                }
                EditorGUI.indentLevel--;
            }
        }
        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            Editor.DrawPropertiesExcluding(base.serializedObject, new string[]
            {
                "m_JobOptions"
            });
            EditorGUILayout.PropertyField(this.m_JobOptions, Physics2DSettingsInspector.Styles.kJobOptionsLabel, true, new GUILayoutOption[0]);
            Physics2DSettingsInspector.s_ShowGizmoSettings = EditorGUILayout.Foldout(Physics2DSettingsInspector.s_ShowGizmoSettings, "Gizmos", true);
            this.m_GizmoSettingsFade.target = Physics2DSettingsInspector.s_ShowGizmoSettings;
            if (this.m_GizmoSettingsFade.value)
            {
                if (EditorGUILayout.BeginFadeGroup(this.m_GizmoSettingsFade.faded))
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.PropertyField(this.m_AlwaysShowColliders, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ShowColliderSleep, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ColliderAwakeColor, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ColliderAsleepColor, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ShowColliderContacts, new GUILayoutOption[0]);
                    EditorGUILayout.Slider(this.m_ContactArrowScale, 0.1f, 1f, this.m_ContactArrowScale.displayName, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ColliderContactColor, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ShowColliderAABB, new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(this.m_ColliderAABBColor, new GUILayoutOption[0]);
                    EditorGUI.indentLevel--;
                }
                EditorGUILayout.EndFadeGroup();
            }
            base.serializedObject.ApplyModifiedProperties();
            string arg_1B5_0 = "Layer Collision Matrix";

            if (Physics2DSettingsInspector.< > f__mg$cache0 == null)
            {
                Physics2DSettingsInspector.< > f__mg$cache0 = new LayerMatrixGUI.GetValueFunc(Physics2DSettingsInspector.GetValue);
            }
            LayerMatrixGUI.GetValueFunc arg_1B5_3 = Physics2DSettingsInspector.< > f__mg$cache0;
            if (Physics2DSettingsInspector.< > f__mg$cache1 == null)
            {
                Physics2DSettingsInspector.< > f__mg$cache1 = new LayerMatrixGUI.SetValueFunc(Physics2DSettingsInspector.SetValue);
            }
            LayerMatrixGUI.DoGUI(arg_1B5_0, ref this.m_ShowLayerCollisionMatrix, ref this.m_LayerCollisionMatrixScrollPos, arg_1B5_3, Physics2DSettingsInspector.< > f__mg$cache1);
        }
Esempio n. 6
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     LayerMatrixGUI.DoGUI("Layer Collision Matrix", ref this.show, ref this.scrollPos, new LayerMatrixGUI.GetValueFunc(this.GetValue), new LayerMatrixGUI.SetValueFunc(this.SetValue));
 }