diff --git a/Assets/HnSF/Combat/Attack/AttackDefinition.cs b/Assets/HnSF/Combat/Attack/AttackDefinition.cs index b8508fe0..e5889fae 100644 --- a/Assets/HnSF/Combat/Attack/AttackDefinition.cs +++ b/Assets/HnSF/Combat/Attack/AttackDefinition.cs @@ -13,7 +13,6 @@ public class AttackDefinition : ScriptableObject public bool useState = false; public ushort stateOverride = 0; public int length = 1; //In frames - public BoxCollectionDefinition hurtboxDefinition; #endregion [Header("Groups")] diff --git a/Assets/HnSF/Combat/BoxCollectionDefinition.cs b/Assets/HnSF/Combat/BoxCollectionDefinition.cs deleted file mode 100644 index f69945b0..00000000 --- a/Assets/HnSF/Combat/BoxCollectionDefinition.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace HnSF.Combat -{ - [CreateAssetMenu(fileName = "BoxCollectionDefinition", menuName = "HnSF/BoxCollectionDefinition")] - public class BoxCollectionDefinition : ScriptableObject - { - [SerializeReference] public List hurtboxGroups = new List(); - } -} \ No newline at end of file diff --git a/Assets/HnSF/Combat/BoxCollectionDefinition.cs.meta b/Assets/HnSF/Combat/BoxCollectionDefinition.cs.meta deleted file mode 100644 index 7e8f6421..00000000 --- a/Assets/HnSF/Combat/BoxCollectionDefinition.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ddc3fb6b6ed280c429284393cec54523 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HnSF/Editor/Combat/BoxCollectionDefinitionEditor.cs b/Assets/HnSF/Editor/Combat/BoxCollectionDefinitionEditor.cs deleted file mode 100644 index 044a52db..00000000 --- a/Assets/HnSF/Editor/Combat/BoxCollectionDefinitionEditor.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -namespace HnSF.Combat -{ - [CustomEditor(typeof(BoxCollectionDefinition), true)] - public class BoxCollectionDefinitionEditor : Editor - { - protected Dictionary hurtboxGroupTypes = new Dictionary(); - - public virtual void OnEnable() - { - hurtboxGroupTypes.Clear(); - foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) - { - foreach (var givenType in a.GetTypes()) - { - if (givenType.IsSubclassOf(typeof(HurtboxGroup)) || givenType == typeof(HurtboxGroup)) - { - hurtboxGroupTypes.Add(givenType.FullName, givenType); - } - } - } - } - - public override void OnInspectorGUI() - { - serializedObject.Update(); - CreateMenus(); - serializedObject.ApplyModifiedProperties(); - } - - protected bool hurtboxGroupsDropdown; - public virtual void CreateMenus() - { - GenericMenu menu = new GenericMenu(); - foreach (string hType in hurtboxGroupTypes.Keys) - { - string destination = hType.Replace('.', '/'); - menu.AddItem(new GUIContent(destination), true, OnHurtboxGroupTypeSelected, hType); - } - DrawBoxSection(menu, serializedObject, "Add Hurtbox Group", "hurtboxGroups", ref hurtboxGroupsDropdown); - } - - protected virtual void DrawBoxSection(GenericMenu addMenu, SerializedObject serializedObject, string addButtonName, string listPropertyName, ref bool foldoutValue) - { - if (GUILayout.Button(addButtonName)) - { - addMenu.ShowAsContext(); - } - - foldoutValue = EditorGUILayout.Foldout(foldoutValue, "Boxes"); - - if (foldoutValue) - { - EditorGUI.indentLevel++; - SerializedProperty listProperty = serializedObject.FindProperty(listPropertyName); - - int lCount = listProperty.arraySize; - for (int i = 0; i < lCount; i++) - { - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField($"Group {i}", GUILayout.MaxWidth(100)); - if (GUILayout.Button("X", GUILayout.Width(30))) - { - listProperty.DeleteArrayElementAtIndex(i); - break; - } - if (GUILayout.Button("∨", GUILayout.Width(30))) - { - listProperty.MoveArrayElement(i, i + 1); - } - if (GUILayout.Button("∧", GUILayout.Width(30))) - { - listProperty.MoveArrayElement(i, i - 1); - } - EditorGUILayout.EndHorizontal(); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(listProperty.GetArrayElementAtIndex(i)); - EditorGUI.indentLevel--; - } - EditorGUI.indentLevel--; - } - } - - protected virtual void OnHurtboxGroupTypeSelected(object type) - { - serializedObject.Update(); - SerializedProperty property = serializedObject.FindProperty("hurtboxGroups"); - property.InsertArrayElementAtIndex(property.arraySize); - property.GetArrayElementAtIndex(property.arraySize - 1).managedReferenceValue = Activator.CreateInstance(hurtboxGroupTypes[(string)type]); - serializedObject.ApplyModifiedProperties(); - } - } -} diff --git a/Assets/HnSF/Editor/Combat/BoxCollectionDefinitionEditor.cs.meta b/Assets/HnSF/Editor/Combat/BoxCollectionDefinitionEditor.cs.meta deleted file mode 100644 index 2f81a6c5..00000000 --- a/Assets/HnSF/Editor/Combat/BoxCollectionDefinitionEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c9906069d0c51d447b48b4c2c46f1b91 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/HnSF.Editor.csproj b/HnSF.Editor.csproj index eb0e044f..1fab0940 100644 --- a/HnSF.Editor.csproj +++ b/HnSF.Editor.csproj @@ -65,7 +65,6 @@ - diff --git a/HnSF.csproj b/HnSF.csproj index 1877e8fd..81b50db5 100644 --- a/HnSF.csproj +++ b/HnSF.csproj @@ -96,7 +96,6 @@ -