예제 #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            serializedObject.Update();
            AresEditorUtility.DrawDamageGroup(m_damage);
            serializedObject.ApplyModifiedProperties();
        }
예제 #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            AresEditorUtility.DrawDamageGroup(m_damage);

            AresEditorUtility.DrawBoxGroup("Physics", () =>
            {
                if (m_speed.floatValue <= 0)
                {
                    EditorGUILayout.HelpBox("\"Speed\" must be greater than 0!", MessageType.Error);
                    m_speed.floatValue = 0f;
                }

                EditorGUILayout.PropertyField(m_speed);

                m_acceleration.floatValue = Mathf.Max(m_acceleration.floatValue, 0f);
                EditorGUILayout.PropertyField(m_acceleration);

                if (m_acceleration.floatValue > 0f)
                {
                    m_maxSpeed.floatValue = Mathf.Min(m_maxSpeed.floatValue, m_speed.floatValue);
                    EditorGUILayout.PropertyField(m_maxSpeed);
                }
            });

            AresEditorUtility.DrawBoxGroup("Tracking", () =>
            {
                EditorGUILayout.PropertyField(m_target);

                if (m_angularSpeed.floatValue <= 0f && m_target.objectReferenceValue != null)
                {
                    EditorGUILayout.HelpBox("\"Angular Speed\" must be greater than 0!", MessageType.Error);
                    m_angularSpeed.floatValue = 0f;
                }

                EditorGUILayout.PropertyField(m_angularSpeed);
            });

            serializedObject.ApplyModifiedProperties();
        }