Beispiel #1
0
        private void ShowProperties()
        {
            EditorGUILayout.LabelField(new GUIContent("Utility Action Parameters:"), EditorStyles.boldLabel);
            EditorGUILayout.Separator();

            EditorGUI.BeginChangeCheck();
            SelectedAction.qualifierType =
                (QualifierType)EditorGUILayout.EnumPopup(new GUIContent("Considerations Qualifier"),
                                                         SelectedAction.qualifierType);

            if (EditorGUI.EndChangeCheck())
            {
                SelectedAction.qualifier =
                    ConsiderationsQualifierFactory.GetQualifier(SelectedAction.qualifierType);
                EditorUtility.SetDirty(target);
            }

            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();

            SelectedAction.CooldownTime = Mathf.Clamp(
                EditorGUILayout.FloatField(new GUIContent("Cooldown (s)"), SelectedAction.CooldownTime),
                0f,
                100f);
            EditorGUILayout.Separator();

            SelectedAction.InertiaTime = Mathf.Clamp(
                EditorGUILayout.FloatField(new GUIContent("Inertia time (s)"), SelectedAction.InertiaTime),
                0f,
                100f);
            EditorGUILayout.Separator();

            SelectedAction.ActionWeight =
                EditorGUILayout.FloatField(new GUIContent("Weight"), SelectedAction.ActionWeight);

            EditorGUILayout.Separator();

            EditorGUILayout.LabelField(new GUIContent("Action To Be Performed:"), EditorStyles.boldLabel);
            EditorGUILayout.Separator();

            EditorGUILayout.PropertyField(serializedObject.FindProperty("actionTask"));
            if (EditorGUI.EndChangeCheck())
            {
                EditorUtility.SetDirty(target);
            }
        }
 private void OnEnable()
 {
     hideFlags = HideFlags.DontUnloadUnusedAsset;
     qualifier = ConsiderationsQualifierFactory.GetQualifier(qualifierType);
 }