diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17733370..3fc4c711 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: recursive - uses: actions/setup-dotnet@v3 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..6ad28544 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Unity/Packages/Tri-Inspector"] + path = Unity/Packages/Tri-Inspector + url = https://github.com/Alexejhero/Tri-Inspector/ diff --git a/SCHIZO/Helpers/StaticHelpers.cs b/SCHIZO/Helpers/StaticHelpers.cs index 7137af67..ed75b95b 100644 --- a/SCHIZO/Helpers/StaticHelpers.cs +++ b/SCHIZO/Helpers/StaticHelpers.cs @@ -1,9 +1,10 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; using HarmonyLib; -using NaughtyAttributes; +using TriInspector; namespace SCHIZO.Helpers; @@ -13,11 +14,13 @@ partial class CacheAttribute { public static void CacheAll() { - PLUGIN_ASSEMBLY.GetTypes().SelectMany(t => t.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) - .Where(f => f.GetCustomAttribute() != null) - .Select(f => (IDropdownList) f.GetValue(null)) - .Select(d => d.Select(kvp => (string) kvp.Value)) - .ForEach(CacheValues); + IEnumerable names = PLUGIN_ASSEMBLY.GetTypes() + .SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) + .Where(m => m.GetCustomAttribute() != null) + .SelectMany(m => (IEnumerable) m.Invoke(null, Array.Empty())) + .Select(i => i.Value.ToString()); + + CacheValues(names); } } diff --git a/SCHIZO/Interop/NaughtyAttributes/NaughtyAttributesInterop.cs b/SCHIZO/Interop/NaughtyAttributes/NaughtyAttributesInterop.cs deleted file mode 100644 index 32866f68..00000000 --- a/SCHIZO/Interop/NaughtyAttributes/NaughtyAttributesInterop.cs +++ /dev/null @@ -1,112 +0,0 @@ -// ReSharper disable UnusedParameter.Local -// ReSharper disable UnusedType.Global - -#pragma warning disable CS9113 // Parameter is unread. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using UnityEngine; - -// ReSharper disable once CheckNamespace -namespace NaughtyAttributes; - -[Conditional("NEVER")] -internal class ExpandableAttribute : Attribute; - -[Conditional("NEVER")] -internal class ShowIfAttribute(EConditionOperator conditionOperator, params string[] conditions) : Attribute -{ - public ShowIfAttribute(string condition) : this(EConditionOperator.Or, condition) - { - } -} - -[Conditional("NEVER")] -internal class HideIfAttribute(EConditionOperator conditionOperator, params string[] conditions) : Attribute -{ - public HideIfAttribute(string condition) : this(EConditionOperator.Or, condition) - { - } -} - -public enum EConditionOperator -{ - And, - Or -} - -[Conditional("NEVER")] -internal class LabelAttribute(string label) : Attribute; - -[Conditional("NEVER")] -internal class ResizableTextAreaAttribute : Attribute; - -[Conditional("NEVER")] -internal class ReorderableListAttribute : Attribute; - -[Conditional("NEVER")] -internal class AllowNestingAttribute : Attribute; - -[Conditional("NEVER")] -internal class InfoBoxAttribute(string text) : Attribute; - -[Conditional("NEVER")] -internal class BoxGroupAttribute(string group) : Attribute; - -[Conditional("NEVER")] -internal class EnumFlagsAttribute : Attribute; - -[Conditional("NEVER")] -internal class ValidateInputAttribute(string callbackName, string message = null) : Attribute; - -[Conditional("NEVER")] -internal class RequiredAttribute(string message = null) : Attribute; - -[Conditional("NEVER")] -internal class DropdownAttribute(string valuesName) : Attribute; - -[Conditional("NEVER")] -internal class MinMaxSliderAttribute : Attribute -{ - public MinMaxSliderAttribute(int min, int max) { } - public MinMaxSliderAttribute(float min, float max) { } -} - -internal interface IDropdownList : IEnumerable>; - -public class DropdownList : IDropdownList -{ - private readonly List> _values = new(); - - public void Add(string displayName, T value) - { - _values.Add(new KeyValuePair(displayName, value)); - } - - public IEnumerator> GetEnumerator() - { - return _values.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } -} - -[Conditional("NEVER")] -internal class ReadOnlyAttribute : Attribute; - -[Conditional("NEVER")] -internal class ValidatorAttribute : Attribute; - -[Conditional("NEVER")] -internal class ButtonAttribute(string text = null) : Attribute; - -[Conditional("NEVER")] -internal class DrawerAttribute : PropertyAttribute; - -[Conditional("NEVER")] -public class FoldoutAttribute(string name) : Attribute; diff --git a/SCHIZO/Resources/AssetBundles/Assets.cs b/SCHIZO/Resources/AssetBundles/Assets.cs index e39c6b91..b649d3fd 100644 --- a/SCHIZO/Resources/AssetBundles/Assets.cs +++ b/SCHIZO/Resources/AssetBundles/Assets.cs @@ -12,7 +12,7 @@ namespace SCHIZO.Resources; public static class Assets { - private const int _rnd = 228879590; + private const int _rnd = -684662253; private static readonly UnityEngine.AssetBundle _a = ResourceManager.GetAssetBundle("assets"); diff --git a/SCHIZO/Resources/AssetBundles/assets b/SCHIZO/Resources/AssetBundles/assets index af53f3c9..2e91321a 100644 Binary files a/SCHIZO/Resources/AssetBundles/assets and b/SCHIZO/Resources/AssetBundles/assets differ diff --git a/SCHIZO/SCHIZO.csproj b/SCHIZO/SCHIZO.csproj index 55a74470..7158ae97 100644 --- a/SCHIZO/SCHIZO.csproj +++ b/SCHIZO/SCHIZO.csproj @@ -29,6 +29,8 @@ %(FileName).cs + + diff --git a/Unity/Assets/Editor/Scripts/Inspectors/ModRegistryItemInspector.cs b/Unity/Assets/Editor/Scripts/Inspectors/ModRegistryItemInspector.cs index 3f7f09ea..38cae0db 100644 --- a/Unity/Assets/Editor/Scripts/Inspectors/ModRegistryItemInspector.cs +++ b/Unity/Assets/Editor/Scripts/Inspectors/ModRegistryItemInspector.cs @@ -1,12 +1,12 @@ -using NaughtyAttributes.Editor; -using SCHIZO.Registering; +using SCHIZO.Registering; +using TriInspector.Editors; using UnityEditor; using UnityEngine; namespace Editor.Scripts.Inspectors { [CustomEditor(typeof(ModRegistryItem), true)] - public class ModRegistryItemInspector : NaughtyInspector + public class ModRegistryItemInspector : TriEditor { private GUIStyle _toggle; diff --git a/Unity/Assets/Editor/Scripts/Inspectors/RecipeInspector.cs b/Unity/Assets/Editor/Scripts/Inspectors/RecipeInspector.cs index 9aaf736e..a0c1a315 100644 --- a/Unity/Assets/Editor/Scripts/Inspectors/RecipeInspector.cs +++ b/Unity/Assets/Editor/Scripts/Inspectors/RecipeInspector.cs @@ -1,12 +1,12 @@ using Editor.Scripts.PropertyDrawers; -using NaughtyAttributes.Editor; using SCHIZO.Items.Data.Crafting; +using TriInspector.Editors; using UnityEditor; namespace Editor.Scripts.Inspectors { [CustomEditor(typeof(Recipe))] - public sealed class RecipeInspector : NaughtyInspector + public sealed class RecipeInspector : TriEditor { public override void OnInspectorGUI() { @@ -16,16 +16,14 @@ public override void OnInspectorGUI() TechType_AllDrawer.TargetGame = recipe.game; } - private new void OnEnable() + private void OnEnable() { - base.OnEnable(); Recipe recipe = (Recipe) target; TechType_AllDrawer.TargetGame = recipe.game; } - private new void OnDisable() + private void OnDisable() { - base.OnDisable(); TechType_AllDrawer.TargetGame = 0; } } diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions.meta b/Unity/Assets/Editor/Scripts/NaughtyExtensions.meta deleted file mode 100644 index 2ad3041d..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 65b744935265457198acdcd7a8f70057 -timeCreated: 1697388088 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers.meta b/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers.meta deleted file mode 100644 index 69706c03..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8e933f10958f416a9f2b276c7402044a -timeCreated: 1697937650 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers/SwitchDropdownAttributeDrawer.cs b/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers/SwitchDropdownAttributeDrawer.cs deleted file mode 100644 index 8ae1d8d0..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers/SwitchDropdownAttributeDrawer.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Reflection; -using HarmonyLib; -using NaughtyAttributes; -using NaughtyAttributes.Editor; -using SCHIZO.Attributes.Validation; -using UnityEditor; -using UnityEngine; - -namespace Editor.Scripts.NaughtyExtensions.PropertyDrawers -{ - [CustomPropertyDrawer(typeof(SwitchDropdownAttribute), true)] - public sealed class SwitchDropdownAttributeDrawer : DropdownPropertyDrawer - { - private static readonly FieldInfo _m_Attribute_field = AccessTools.Field(typeof(PropertyDrawer), "m_Attribute"); - - private PropertyAttribute m_Attribute - { - set => _m_Attribute_field.SetValue(this, value); - } - - protected override float GetPropertyHeight_Internal(SerializedProperty property, GUIContent label) - { - SwitchDropdownAttribute actualAttribute = (SwitchDropdownAttribute) attribute; - m_Attribute = new DropdownAttribute(actualAttribute.GetDropdownListName(property)); - - try - { - return base.GetPropertyHeight_Internal(property, label); - } - finally - { - m_Attribute = actualAttribute; - } - } - - protected override void OnGUI_Internal(Rect rect, SerializedProperty property, GUIContent label) - { - SwitchDropdownAttribute actualAttribute = (SwitchDropdownAttribute) attribute; - m_Attribute = new DropdownAttribute(actualAttribute.GetDropdownListName(property)); - - try - { - base.OnGUI_Internal(rect, property, label); - } - finally - { - m_Attribute = actualAttribute; - } - } - } -} diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers/SwitchDropdownAttributeDrawer.cs.meta b/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers/SwitchDropdownAttributeDrawer.cs.meta deleted file mode 100644 index 144cd66c..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/PropertyDrawers/SwitchDropdownAttributeDrawer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b0a364a257984ee6aee3d37c0bb45b6c -timeCreated: 1697937662 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators.meta b/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators.meta deleted file mode 100644 index caecfa5c..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 84a4456bf1d4408db476c412abe8bff2 -timeCreated: 1697937622 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/FlexibleValidateInputPropertyValidator.cs b/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/FlexibleValidateInputPropertyValidator.cs deleted file mode 100644 index 96737752..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/FlexibleValidateInputPropertyValidator.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using HarmonyLib; -using NaughtyAttributes.Editor; -using SCHIZO.Attributes.Validation; -using UnityEditor; - -namespace Editor.Scripts.NaughtyExtensions.Validators -{ - public sealed class FlexibleValidateInputPropertyValidator : PropertyValidatorBase - { - private static readonly Dictionary _changedCache = new Dictionary(); - - public override void ValidateProperty(SerializedProperty property) - { - FlexibleValidateInputAttribute attr = PropertyUtility.GetAttribute(property); - - if (property.propertyType != SerializedPropertyType.ObjectReference) - { - string warning = attr.GetType().Name + " works only on reference types"; - NaughtyEditorGUI.HelpBox_Layout(warning, MessageType.Warning, context: property.serializedObject.targetObject); - return; - } - - object propertyCurrentValue = GetAnyValue(property); - - if (_changedCache.TryGetValue(property, out object value)) - { - if (ReferenceEquals(propertyCurrentValue, value)) return; - _changedCache[property] = propertyCurrentValue; - } - - string err = ""; - if (attr.ValidateInput(propertyCurrentValue, property, ref err)) return; - - NaughtyEditorGUI.HelpBox_Layout(err, MessageType.Error, context: property.serializedObject.targetObject); - } - - private static readonly MethodInfo get_gradientValue = AccessTools.PropertyGetter(typeof(SerializedProperty), "gradientValue"); - - private static object GetAnyValue(SerializedProperty property) - { - switch (property.propertyType) - { - // case SerializedPropertyType.Generic: - - case SerializedPropertyType.Integer: - return property.intValue; - - case SerializedPropertyType.Boolean: - return property.boolValue; - - case SerializedPropertyType.Float: - return property.floatValue; - - case SerializedPropertyType.String: - return property.stringValue; - - case SerializedPropertyType.Color: - return property.colorValue; - - case SerializedPropertyType.ObjectReference: - return property.objectReferenceValue; - - case SerializedPropertyType.LayerMask: - return property.intValue; - - case SerializedPropertyType.Enum: - return property.enumValueIndex; - - case SerializedPropertyType.Vector2: - return property.vector2Value; - - case SerializedPropertyType.Vector3: - return property.vector3Value; - - case SerializedPropertyType.Vector4: - return property.vector4Value; - - case SerializedPropertyType.Rect: - return property.rectValue; - - case SerializedPropertyType.ArraySize: - return property.arraySize; - - case SerializedPropertyType.Character: - return (char)property.intValue; - - case SerializedPropertyType.AnimationCurve: - return property.animationCurveValue; - - case SerializedPropertyType.Bounds: - return property.boundsValue; - - case SerializedPropertyType.Gradient: - return get_gradientValue.Invoke(property, Array.Empty()); - - case SerializedPropertyType.Quaternion: - return property.quaternionValue; - - case SerializedPropertyType.ExposedReference: - return property.exposedReferenceValue; - - case SerializedPropertyType.FixedBufferSize: - return property.fixedBufferSize; - - case SerializedPropertyType.Vector2Int: - return property.vector2IntValue; - - case SerializedPropertyType.Vector3Int: - return property.vector3IntValue; - - case SerializedPropertyType.RectInt: - return property.rectIntValue; - - case SerializedPropertyType.BoundsInt: - return property.boundsIntValue; - - // case SerializedPropertyType.ManagedReference: - // return property.managedReferenceValue; - - default: - return property; // caching not supported - } - } - } -} diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/FlexibleValidateInputPropertyValidator.cs.meta b/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/FlexibleValidateInputPropertyValidator.cs.meta deleted file mode 100644 index 323f3208..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/FlexibleValidateInputPropertyValidator.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: c721ad8afdf74a389c2cc01073759f6f -timeCreated: 1697935930 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/ValidateTypePropertyValidator.cs b/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/ValidateTypePropertyValidator.cs deleted file mode 100644 index 58ddf720..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/ValidateTypePropertyValidator.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using NaughtyAttributes.Editor; -using SCHIZO.Attributes.Typing; -using SCHIZO.Helpers; -using UnityEditor; - -namespace Editor.Scripts.NaughtyExtensions.Validators -{ - public sealed class ValidateTypePropertyValidator : PropertyValidatorBase - { - private static readonly Dictionary _changedCache = new Dictionary(); - - public override void ValidateProperty(SerializedProperty property) - { - ValidateTypeAttribute attr = PropertyUtility.GetAttribute(property); - if (property.propertyType != SerializedPropertyType.ObjectReference) - { - string warning = attr.GetType().Name + " works only on reference types"; - NaughtyEditorGUI.HelpBox_Layout(warning, MessageType.Warning, context: property.serializedObject.targetObject); - return; - } - - if (_changedCache.TryGetValue(property, out object value) - && ReferenceEquals(property.objectReferenceValue, value)) return; - _changedCache[property] = property.objectReferenceValue; - - if (property.objectReferenceValue == null) return; - - Type expectedType = ReflectionCache.GetType(attr.typeName); - - Type actualType = property.objectReferenceValue.GetType(); - if (expectedType.IsAssignableFrom(actualType)) return; - - List sisterTypes = actualType.GetCustomAttributes().Select(a => ReflectionCache.GetType(a.typeName)).ToList(); - if (sisterTypes.Any(t => expectedType.IsAssignableFrom(t))) return; - - NaughtyEditorGUI.HelpBox_Layout($"{property.displayName} must be of type {attr.typeName}", MessageType.Error, context: property.serializedObject.targetObject); - } - } -} diff --git a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/ValidateTypePropertyValidator.cs.meta b/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/ValidateTypePropertyValidator.cs.meta deleted file mode 100644 index 485495db..00000000 --- a/Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators/ValidateTypePropertyValidator.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 33ca658392ed40ada18647b194506929 -timeCreated: 1697388105 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/Patches/CustomValidatorAttributes.cs b/Unity/Assets/Editor/Scripts/Patches/CustomValidatorAttributes.cs deleted file mode 100644 index 6ab3baa1..00000000 --- a/Unity/Assets/Editor/Scripts/Patches/CustomValidatorAttributes.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using Editor.Scripts.NaughtyExtensions.Validators; -using HarmonyLib; -using JetBrains.Annotations; -using NaughtyAttributes; -using NaughtyAttributes.Editor; -using SCHIZO.Attributes.Typing; -using SCHIZO.Attributes.Validation; - -namespace Editor.Scripts.Patches -{ - [HarmonyPatch, UsedImplicitly] - public static class CustomValidatorAttributes - { - private static readonly FieldInfo _validatorsByAttributeType_field = AccessTools.Field(typeof(ValidatorAttributeExtensions), "_validatorsByAttributeType"); - private static Dictionary _originalPropertyValidators => (Dictionary) _validatorsByAttributeType_field.GetValue(null); - - private static readonly Dictionary _customPropertyValidators = new Dictionary() - { - {typeof(ValidateTypeAttribute), new ValidateTypePropertyValidator()}, - {typeof(FlexibleValidateInputAttribute), new FlexibleValidateInputPropertyValidator()}, - {typeof(object), null}, - }; - - [HarmonyPatch(typeof(ValidatorAttributeExtensions), nameof(ValidatorAttributeExtensions.GetValidator)), UsedImplicitly] - [HarmonyPrefix] - public static bool GetCustomValidator(out PropertyValidatorBase __result, ValidatorAttribute attr) - { - __result = GetValidator(attr.GetType()); - return __result == null; - } - - private static PropertyValidatorBase GetValidator(Type type) - { - if (_customPropertyValidators.TryGetValue(type, out PropertyValidatorBase customValidator)) return customValidator; - if (_originalPropertyValidators.TryGetValue(type, out PropertyValidatorBase originalValidator)) return originalValidator; - return GetValidator(type.BaseType); - } - } -} diff --git a/Unity/Assets/Editor/Scripts/Patches/CustomValidatorAttributes.cs.meta b/Unity/Assets/Editor/Scripts/Patches/CustomValidatorAttributes.cs.meta deleted file mode 100644 index 328f88f5..00000000 --- a/Unity/Assets/Editor/Scripts/Patches/CustomValidatorAttributes.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 32e1fd0d1904463db3ef0c976b8e5890 -timeCreated: 1697304200 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/Patches/DisableCscSettingsLog.cs b/Unity/Assets/Editor/Scripts/Patches/DisableCscSettingsLog.cs new file mode 100644 index 00000000..ce392196 --- /dev/null +++ b/Unity/Assets/Editor/Scripts/Patches/DisableCscSettingsLog.cs @@ -0,0 +1,29 @@ +using System; +using System.Reflection; +using HarmonyLib; +using UnityEditor; +using UnityEngine; + +namespace Editor.Scripts.Patches; + +public class DisableCscSettingsLog : AssetPostprocessor +{ + private static readonly MethodInfo _targetMethod = AccessTools.Method(typeof(Debug), nameof(Debug.Log), new[] {typeof(object)}); + + public override int GetPostprocessOrder() => int.MaxValue; + + private static string OnGeneratedCSProject(string path, string content) + { + if (!(Harmony.GetPatchInfo(_targetMethod)?.Prefixes?.Count > 0)) + { + new Harmony(new Guid().ToString()).Patch(_targetMethod, new HarmonyMethod(typeof(DisableCscSettingsLog), nameof(Prefix))); + } + + return content; + } + + public static bool Prefix(object message) + { + return !message.ToString().Contains("OnGeneratedCSProject"); + } +} diff --git a/Unity/Assets/Editor/Scripts/Patches/DisableCscSettingsLog.cs.meta b/Unity/Assets/Editor/Scripts/Patches/DisableCscSettingsLog.cs.meta new file mode 100644 index 00000000..06d57797 --- /dev/null +++ b/Unity/Assets/Editor/Scripts/Patches/DisableCscSettingsLog.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4eff0bb549614b1db4e7af16ced3a1e1 +timeCreated: 1699179491 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/Patches/Editor.Patches.asmdef b/Unity/Assets/Editor/Scripts/Patches/Editor.Patches.asmdef new file mode 100644 index 00000000..4d893e7d --- /dev/null +++ b/Unity/Assets/Editor/Scripts/Patches/Editor.Patches.asmdef @@ -0,0 +1,22 @@ +{ + "name": "Editor.Patches", + "references": [ + "GUID:3d316254c8cfea64cb626dce93a4def6", + "GUID:c4b8fc492eac8184fb9a42684cf8c464", + "GUID:f88fb04354076c646a4107a491394033", + "GUID:6ed54bcbddd234d55b95cd3dd4df4bec" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "0Harmony.dll" + ], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/Patches/Editor.Patches.asmdef.meta b/Unity/Assets/Editor/Scripts/Patches/Editor.Patches.asmdef.meta new file mode 100644 index 00000000..c5b3d133 --- /dev/null +++ b/Unity/Assets/Editor/Scripts/Patches/Editor.Patches.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ed48f85bfd774e35b975544074a70957 +timeCreated: 1699180909 \ No newline at end of file diff --git a/Unity/Assets/Editor/Scripts/Patches/NaughtyPatches.cs b/Unity/Assets/Editor/Scripts/Patches/NaughtyPatches.cs deleted file mode 100644 index fa694644..00000000 --- a/Unity/Assets/Editor/Scripts/Patches/NaughtyPatches.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using HarmonyLib; -using NaughtyAttributes.Editor; -using SCHIZO.Helpers; -using UnityEditor; -using UnityEngine; - -namespace Editor.Scripts.Patches -{ - [HarmonyPatch] - public static class NaughtyPatches - { - [HarmonyPatch(typeof(ReflectionUtility))] - public static class ReflectionPerfDetours - { - [HarmonyPatch(nameof(ReflectionUtility.GetField))] - [HarmonyPrefix] - public static bool FieldLookupPerfDetour(out FieldInfo __result, object target, string fieldName) - { - __result = null; - if (target != null) __result = ReflectionCache.GetField(target.GetType(), fieldName); - - return false; - } - - [HarmonyPatch(nameof(ReflectionUtility.GetMethod))] - [HarmonyPrefix] - public static bool MethodLookupPerfDetour(out MethodInfo __result, object target, string methodName) - { - __result = null; - if (target != null) __result = ReflectionCache.GetMethod(target.GetType(), methodName); - - return false; - } - - [HarmonyPatch(nameof(ReflectionUtility.GetProperty))] - [HarmonyPrefix] - public static bool PropertyLookupPerfDetour(out PropertyInfo __result, object target, string propertyName) - { - __result = null; - if (target != null) __result = ReflectionCache.GetProperty(target.GetType(), propertyName); - - return false; - } - - [HarmonyPatch("GetSelfAndBaseTypes")] - [HarmonyPrefix] - public static bool TypeHierarchyPerfDetour(out List __result, object target) - { - __result = ReflectionHelpers.WalkTypeHierarchy(target?.GetType()).ToList(); - return false; - } - } - - [HarmonyPatch(typeof(NaughtyInspector), "OnEnable")] - [HarmonyPostfix] - public static void EnumerablePerfDetour(NaughtyInspector __instance, - ref IEnumerable ____nonSerializedFields, - ref IEnumerable ____nativeProperties, - ref IEnumerable ____methods) - { - if (!__instance.target) return; - - ____nonSerializedFields = ____nonSerializedFields.ToList(); - ____nativeProperties = ____nativeProperties.ToList(); - ____methods = ____methods.ToList(); - } - - [HarmonyPatch(typeof(PropertyUtility), nameof(PropertyUtility.GetLabel))] - [HarmonyPostfix] - public static void AddTooltip(SerializedProperty property, ref GUIContent __result) - { - TooltipAttribute tooltip = PropertyUtility.GetAttribute(property); - if (tooltip != null) __result.tooltip = tooltip.tooltip; - } - } -} diff --git a/Unity/Assets/Editor/Scripts/Patches/NaughtyPatches.cs.meta b/Unity/Assets/Editor/Scripts/Patches/NaughtyPatches.cs.meta deleted file mode 100644 index a5459c21..00000000 --- a/Unity/Assets/Editor/Scripts/Patches/NaughtyPatches.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f03ff73a61240f94eacfc99f6748d41f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/Editor/Scripts/PropertyDrawers/CarefulAttributeDrawer.cs b/Unity/Assets/Editor/Scripts/PropertyDrawers/CarefulAttributeDrawer.cs index 3f9c8add..bc43d810 100644 --- a/Unity/Assets/Editor/Scripts/PropertyDrawers/CarefulAttributeDrawer.cs +++ b/Unity/Assets/Editor/Scripts/PropertyDrawers/CarefulAttributeDrawer.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; using HarmonyLib; -using SCHIZO.Attributes.Visual; +using SCHIZO.Attributes; using SCHIZO.Items.Data.Crafting; using UnityEditor; using UnityEngine; diff --git a/Unity/Assets/Editor/Scripts/PropertyDrawers/ExposedTypeAttributeDrawer.cs b/Unity/Assets/Editor/Scripts/PropertyDrawers/ExposedTypeAttributeDrawer.cs index 40838448..a4127f94 100644 --- a/Unity/Assets/Editor/Scripts/PropertyDrawers/ExposedTypeAttributeDrawer.cs +++ b/Unity/Assets/Editor/Scripts/PropertyDrawers/ExposedTypeAttributeDrawer.cs @@ -1,5 +1,5 @@ using System; -using SCHIZO.Attributes.Typing; +using SCHIZO.Attributes; using SCHIZO.Helpers; using UnityEditor; using UnityEngine; diff --git a/Unity/Assets/Editor/Scripts/TriExtensions.meta b/Unity/Assets/Editor/Scripts/TriExtensions.meta new file mode 100644 index 00000000..e0cec107 --- /dev/null +++ b/Unity/Assets/Editor/Scripts/TriExtensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd7c24495e8a48deb1e5b2ed89eaf7d1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Editor/Scripts/TriExtensions/DeclareUnexploredGroupDrawer.cs b/Unity/Assets/Editor/Scripts/TriExtensions/DeclareUnexploredGroupDrawer.cs new file mode 100644 index 00000000..9e9d7c5b --- /dev/null +++ b/Unity/Assets/Editor/Scripts/TriExtensions/DeclareUnexploredGroupDrawer.cs @@ -0,0 +1,23 @@ +using Editor.Scripts.TriExtensions; +using SCHIZO.TriInspector; +using TriInspector; +using TriInspector.Elements; + +[assembly: RegisterTriGroupDrawer(typeof(TriFoldoutGroupDrawer))] + +namespace Editor.Scripts.TriExtensions +{ + internal class TriFoldoutGroupDrawer : TriGroupDrawer + { + public override TriPropertyCollectionBaseElement CreateElement(DeclareUnexploredGroupAttribute attribute) + { + return new TriBoxGroupElement(new TriBoxGroupElement.Props + { + title = attribute.Title, + titleMode = TriBoxGroupElement.TitleMode.Foldout, + expandedByDefault = attribute.Expanded, + hideIfChildrenInvisible = true, + }); + } + } +} diff --git a/Unity/Assets/Editor/Scripts/TriExtensions/DeclareUnexploredGroupDrawer.cs.meta b/Unity/Assets/Editor/Scripts/TriExtensions/DeclareUnexploredGroupDrawer.cs.meta new file mode 100644 index 00000000..d0067a27 --- /dev/null +++ b/Unity/Assets/Editor/Scripts/TriExtensions/DeclareUnexploredGroupDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 045b88296ea04fde8ceecda72e3883f8 +timeCreated: 1699160860 \ No newline at end of file diff --git a/Unity/Assets/Ermfish/Ermfish regular.asset b/Unity/Assets/Ermfish/Ermfish regular.asset index 87d58d20..5f85b706 100644 --- a/Unity/Assets/Ermfish/Ermfish regular.asset +++ b/Unity/Assets/Ermfish/Ermfish regular.asset @@ -22,9 +22,6 @@ MonoBehaviour: loopEffectBelowPercent: 0 loopingDamageEffect: {fileID: 0} canResurrect: 0 - damageEffect: {fileID: 0} - deathEffect: {fileID: 0} - electricalDamageEffect: {fileID: 0} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/Ermfish/Ermfish.prefab b/Unity/Assets/Ermfish/Ermfish.prefab index f2837e6c..ba2ff0ea 100644 --- a/Unity/Assets/Ermfish/Ermfish.prefab +++ b/Unity/Assets/Ermfish/Ermfish.prefab @@ -696,6 +696,12 @@ PrefabInstance: propertyPath: swimVelocity value: 7 objectReference: {fileID: 0} + - target: {fileID: 2722342412455638247, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: sounds + value: + objectReference: {fileID: 3464179523288004460, guid: 4f47d8b7127a0234ea057da7472d7808, + type: 2} - target: {fileID: 2722342412455638247, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: soundCollection @@ -723,6 +729,12 @@ PrefabInstance: propertyPath: evaluatePriority value: 0.6 objectReference: {fileID: 0} + - target: {fileID: 3365459996886375183, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: sounds + value: + objectReference: {fileID: -1178557504063532876, guid: 2b7bde06469e9fc49911f3cac3ffa231, + type: 2} - target: {fileID: 3365459996886375183, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: soundCollection @@ -835,6 +847,12 @@ PrefabInstance: propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 7784437994874313104, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: sounds + value: + objectReference: {fileID: -1161355378763634503, guid: 2b7bde06469e9fc49911f3cac3ffa231, + type: 2} - target: {fileID: 7784437994874313104, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: soundCollection diff --git a/Unity/Assets/Plugins/Subnautica/UniqueIdentifier.cs b/Unity/Assets/Plugins/Subnautica/UniqueIdentifier.cs index 8db04247..80ff3ad8 100644 --- a/Unity/Assets/Plugins/Subnautica/UniqueIdentifier.cs +++ b/Unity/Assets/Plugins/Subnautica/UniqueIdentifier.cs @@ -1,9 +1,7 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; -using UnityEngine; +using UnityEngine; [DisallowMultipleComponent] public abstract class UniqueIdentifier : MonoBehaviour { - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public string classId; + // [ReadOnly] public string _classId = " (string)"; } diff --git a/Unity/Assets/Scripts/ECCLibrary/ECCLibrary.asmdef b/Unity/Assets/Scripts/ECCLibrary/ECCLibrary.asmdef index 1796348b..6c83d0e1 100644 --- a/Unity/Assets/Scripts/ECCLibrary/ECCLibrary.asmdef +++ b/Unity/Assets/Scripts/ECCLibrary/ECCLibrary.asmdef @@ -1,8 +1,8 @@ { "name": "ECCLibrary", "references": [ - "GUID:776d03a35f1b52c4a9aed9f56d7b4229", - "GUID:3d316254c8cfea64cb626dce93a4def6" + "GUID:3d316254c8cfea64cb626dce93a4def6", + "GUID:324caed91501a9c47a04ebfd87b68794" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Unity/Assets/Scripts/ECCLibrary/SwimInSchoolFieldSetter.cs b/Unity/Assets/Scripts/ECCLibrary/SwimInSchoolFieldSetter.cs index cb35a90c..33035f87 100644 --- a/Unity/Assets/Scripts/ECCLibrary/SwimInSchoolFieldSetter.cs +++ b/Unity/Assets/Scripts/ECCLibrary/SwimInSchoolFieldSetter.cs @@ -1,13 +1,14 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; // ReSharper disable once CheckNamespace namespace ECCLibrary.Mono { - public class SwimInSchoolFieldSetter : MonoBehaviour + public sealed class SwimInSchoolFieldSetter : TriMonoBehaviour { - [Foldout("Component References"), Required, ExposedType("SwimInSchool")] + [ComponentReferencesGroup, Required, ExposedType("SwimInSchool")] public MonoBehaviour behaviour; public float breakDistance = 20; diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/CarefulAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/CarefulAttribute.cs new file mode 100644 index 00000000..4fc27bd2 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Attributes/CarefulAttribute.cs @@ -0,0 +1,11 @@ +using System; +using System.Diagnostics; +using UnityEngine; + +namespace SCHIZO.Attributes; + +[AttributeUsage(AttributeTargets.Field)] +[Conditional("UNITY_STANDALONE")] +internal sealed class CarefulAttribute : PropertyAttribute +{ +} \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Visual/CarefulAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/CarefulAttribute.cs.meta similarity index 100% rename from Unity/Assets/Scripts/SCHIZO/Attributes/Visual/CarefulAttribute.cs.meta rename to Unity/Assets/Scripts/SCHIZO/Attributes/CarefulAttribute.cs.meta diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/ExposedTypeAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/ExposedTypeAttribute.cs new file mode 100644 index 00000000..287b36c1 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Attributes/ExposedTypeAttribute.cs @@ -0,0 +1,12 @@ +using System; +using System.Diagnostics; +using UnityEngine; + +namespace SCHIZO.Attributes; + +[AttributeUsage(AttributeTargets.Field)] +[Conditional("UNITY_STANDALONE")] +internal sealed class ExposedTypeAttribute(string typeName) : PropertyAttribute +{ + public readonly string typeName = typeName; +} diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ExposedTypeAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/ExposedTypeAttribute.cs.meta similarity index 100% rename from Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ExposedTypeAttribute.cs.meta rename to Unity/Assets/Scripts/SCHIZO/Attributes/ExposedTypeAttribute.cs.meta diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Typing.meta deleted file mode 100644 index 7cca0032..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8dbe4a4599364fda8e019db6e1ba7009 -timeCreated: 1697401342 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ActualTypeAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ActualTypeAttribute.cs deleted file mode 100644 index 67b7ae9a..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ActualTypeAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Diagnostics; - -namespace SCHIZO.Attributes.Typing -{ - [AttributeUsage(AttributeTargets.Class)] - [Conditional("UNITY_STANDALONE")] - internal sealed class ActualTypeAttribute : Attribute - { - public string typeName; - - public ActualTypeAttribute(string typeName) - { - this.typeName = typeName; - } - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ActualTypeAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ActualTypeAttribute.cs.meta deleted file mode 100644 index 23a5d966..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ActualTypeAttribute.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d2e8e9b36f7b4bd28d2b2b7ed40cc60d -timeCreated: 1697388179 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ExposedTypeAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ExposedTypeAttribute.cs deleted file mode 100644 index f45e83d1..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ExposedTypeAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Diagnostics; -using UnityEngine; - -namespace SCHIZO.Attributes.Typing -{ - [AttributeUsage(AttributeTargets.Field)] - [Conditional("UNITY_STANDALONE")] - internal sealed class ExposedTypeAttribute : PropertyAttribute - { - public string typeName; - - public ExposedTypeAttribute(string typeName) - { - this.typeName = typeName; - } - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ValidateTypeAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ValidateTypeAttribute.cs deleted file mode 100644 index c85e0a70..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ValidateTypeAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Diagnostics; -using JetBrains.Annotations; -using NaughtyAttributes; - -namespace SCHIZO.Attributes.Typing -{ - [AttributeUsage(AttributeTargets.Field)] - [Conditional("UNITY_STANDALONE")] - [UsedImplicitly] - internal sealed class ValidateTypeAttribute : ValidatorAttribute - { - public string typeName; - - public ValidateTypeAttribute(string typeName) - { - this.typeName = typeName; - } - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ValidateTypeAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ValidateTypeAttribute.cs.meta deleted file mode 100644 index cf2cac75..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Typing/ValidateTypeAttribute.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 00a343a939404bc6a22f5b59883ee877 -timeCreated: 1697388131 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Validation.meta deleted file mode 100644 index 9ef31d16..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6b795dcf407545eca551bd87f978046e -timeCreated: 1697935803 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/FlexibleValidateInputAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/FlexibleValidateInputAttribute.cs deleted file mode 100644 index 322dd2bd..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/FlexibleValidateInputAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using NaughtyAttributes; -using SCHIZO.Interop.NaughtyAttributes; - -namespace SCHIZO.Attributes.Validation -{ - [AttributeUsage(AttributeTargets.Field)] - internal abstract class FlexibleValidateInputAttribute : ValidatorAttribute - { - public abstract bool ValidateInput(object val, SerializedPropertyHolder propertyHolder, ref string err); - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/FlexibleValidateInputAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/FlexibleValidateInputAttribute.cs.meta deleted file mode 100644 index 57fe4641..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/FlexibleValidateInputAttribute.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ab15ddea707348369b85bca18094c218 -timeCreated: 1697935825 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/SwitchDropdownAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/SwitchDropdownAttribute.cs deleted file mode 100644 index 531aef61..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/SwitchDropdownAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using NaughtyAttributes; -using SCHIZO.Interop.NaughtyAttributes; - -namespace SCHIZO.Attributes.Validation -{ - internal abstract class SwitchDropdownAttribute : DrawerAttribute - { - public abstract string GetDropdownListName(SerializedPropertyHolder property); - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/SwitchDropdownAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/SwitchDropdownAttribute.cs.meta deleted file mode 100644 index cbcb6985..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Validation/SwitchDropdownAttribute.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ea4e73f831a74c6da73257af4012f645 -timeCreated: 1697937515 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Visual.meta b/Unity/Assets/Scripts/SCHIZO/Attributes/Visual.meta deleted file mode 100644 index 8c980b63..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Visual.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d8ee05c291f14f3a9aecca0ad0803984 -timeCreated: 1697493988 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Attributes/Visual/CarefulAttribute.cs b/Unity/Assets/Scripts/SCHIZO/Attributes/Visual/CarefulAttribute.cs deleted file mode 100644 index a708827c..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Attributes/Visual/CarefulAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Diagnostics; -using UnityEngine; - -namespace SCHIZO.Attributes.Visual -{ - [AttributeUsage(AttributeTargets.Field)] - [Conditional("UNITY_STANDALONE")] - internal sealed class CarefulAttribute : PropertyAttribute - { - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs index 7227fa0e..28ea6fc9 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs @@ -1,12 +1,13 @@ +using JetBrains.Annotations; using UnityEngine; -using NaughtyAttributes; using SCHIZO.Interop.Subnautica.Enums; +using TriInspector; namespace SCHIZO.Creatures.Components { public sealed partial class CarryCreature : CustomCreatureAction { - [SerializeField] + [SerializeField, UsedImplicitly] private EcoTargetType_All _ecoTargetType; [Required] public Transform attachPoint; diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CreaturePhysicMaterial.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CreaturePhysicMaterial.cs index dd3466e4..1d603c4b 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CreaturePhysicMaterial.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CreaturePhysicMaterial.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Creatures.Components diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CustomCreatureTool.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CustomCreatureTool.cs index 7638a504..7d288457 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CustomCreatureTool.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CustomCreatureTool.cs @@ -1,17 +1,18 @@ -using NaughtyAttributes; +using TriInspector; using SCHIZO.Interop.Subnautica; using SCHIZO.Interop.Subnautica.Enums; using UnityEngine; namespace SCHIZO.Creatures.Components { + [DeclareBoxGroup("ik_bz", Title = "IK Overrides (Below Zero)")] public partial class CustomCreatureTool : _CreatureTool { [SerializeField] private TechType_All referenceAnimation; [SerializeField] private GameObject subnauticaModel; [SerializeField] private GameObject belowZeroModel; - [Foldout("IK"), SerializeField] private Transform leftHandIKTargetOverrideBZ; - [Foldout("IK"), SerializeField] private Transform rightHandIKTargetOverrideBZ; + [Group("ik_bz"), LabelText("Left Hand IK Target"), SerializeField] private Transform leftHandIKTargetOverrideBZ; + [Group("ik_bz"), LabelText("Right Hand IK Target"), SerializeField] private Transform rightHandIKTargetOverrideBZ; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/GetCarried.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/GetCarried.cs index f646dc79..04a92aa8 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/GetCarried.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/GetCarried.cs @@ -1,23 +1,21 @@ -using NaughtyAttributes; using SCHIZO.Interop.Subnautica; using SCHIZO.Sounds.Collections; +using TriInspector; using UnityEngine; namespace SCHIZO.Creatures.Components { + [DeclareBoxGroup("Sounds")] public partial class GetCarried : CustomCreatureAction { public bool likesBeingCarried; public Transform pickupPoint; - [BoxGroup("Sounds")] + + [GroupNext("Sounds")] public _FMOD_CustomEmitter emitter; - [BoxGroup("Sounds")] public float carryNoiseInterval = 5f; - [BoxGroup("Sounds")] public SoundCollectionInstance pickupSounds; - [BoxGroup("Sounds")] public SoundCollectionInstance carrySounds; - [BoxGroup("Sounds")] public SoundCollectionInstance releaseSounds; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/CreatureData.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/CreatureData.cs index 88368e3c..6f6c6563 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/CreatureData.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/CreatureData.cs @@ -1,30 +1,34 @@ -using JetBrains.Annotations; -using NaughtyAttributes; -using SCHIZO.Interop.Subnautica.Enums.Subnautica; +using SCHIZO.Interop.Subnautica.Enums.Subnautica; using SCHIZO.Items.Data; +using TriInspector; using UnityEngine; namespace SCHIZO.Creatures { [CreateAssetMenu(menuName = "SCHIZO/Creatures/Creature Data")] + [DeclareBoxGroup("creaturedata", Title = "Creature Data")] public partial class CreatureData : ItemData { - public bool isPickupable; + [PropertyOrder(1)] public bool isPickupable; - [BoxGroup("Creature Data"), Required_BehaviourType_SN, SerializeField, UsedImplicitly] + [Group("creaturedata"), ValidateInput(nameof(Validate_behaviourType)), SerializeField] private BehaviourType_SN behaviourType; - [BoxGroup("Creature Data")] + [Group("creaturedata")] public bool acidImmune = true; - [BoxGroup("Creature Data")] + [Group("creaturedata")] public float bioReactorCharge; #region NaughyAttributes stuff protected override bool ShowPickupableProps() => isPickupable; - private bool Validate_behaviourType(BehaviourType_SN val) => val != BehaviourType_SN.Unknown; + private TriValidationResult Validate_behaviourType() + { + if (behaviourType == BehaviourType_SN.Unknown) return TriValidationResult.Error("Behaviour type cannot be Unknown"); + return TriValidationResult.Valid; + } #endregion } diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/Ermshark.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/Ermshark.cs index 81d358df..036c0757 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/Ermshark.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/Ermshark.cs @@ -1,24 +1,25 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using SCHIZO.Attributes; +using TriInspector; using SCHIZO.Interop.Subnautica; -using SCHIZO.Attributes.Typing; using SCHIZO.Sounds.Players; using UnityEngine; namespace SCHIZO.Creatures.Ermshark { + [DeclareFoldoutGroup(CREATURE_GROUP, Title = "Creature")] public sealed partial class Ermshark : _Creature { - [BoxGroup("Ermshark"), SerializeField, UsedImplicitly] + [SerializeField, UsedImplicitly] private int mitosisRemaining = 4; - [BoxGroup("Ermshark"), Required, SerializeField, UsedImplicitly] + [Required, SerializeField, UsedImplicitly] private HurtSoundPlayer hurtSoundPlayer; - [BoxGroup("Ermshark"), Required, SerializeField, UsedImplicitly] + [Required, SerializeField, UsedImplicitly] private WorldAmbientSoundPlayer ambientSoundPlayer; - [BoxGroup("Ermshark"), Required, SerializeField, ExposedType("Locomotion"), UsedImplicitly] + [Required, SerializeField, ExposedType("Locomotion"), UsedImplicitly] private MonoBehaviour locomotion; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs index 10b374b8..c7822f2b 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs @@ -1,17 +1,18 @@ using JetBrains.Annotations; -using NaughtyAttributes; using SCHIZO.Interop.Subnautica; using SCHIZO.Sounds.Collections; +using TriInspector; using UnityEngine; namespace SCHIZO.Creatures.Ermshark { + [DeclareBoxGroup("Sounds")] public sealed partial class ErmsharkAttack : _MeleeAttack { - [BoxGroup("Sounds"), SerializeField, Required, UsedImplicitly] + [Group("Sounds"), SerializeField, Required, UsedImplicitly] private SoundCollectionInstance attackSounds; - [BoxGroup("Sounds"), SerializeField, Required, UsedImplicitly] + [Group("Sounds"), SerializeField, Required, UsedImplicitly] private _FMOD_CustomEmitter emitter; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Tutel/Tutel.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Tutel/Tutel.cs index 7cca979f..2470a7f7 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Tutel/Tutel.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Tutel/Tutel.cs @@ -1,7 +1,9 @@ using SCHIZO.Interop.Subnautica; +using TriInspector; namespace SCHIZO.Creatures.Tutel { + [DeclareFoldoutGroup(CAVE_CRAWLER_GROUP, Title = "Cave Crawler")] public sealed partial class Tutel : _CaveCrawler { } diff --git a/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/Ermcon.cs b/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/Ermcon.cs index e388b600..d6c88895 100644 --- a/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/Ermcon.cs +++ b/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/Ermcon.cs @@ -1,4 +1,4 @@ -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Events.Ermcon @@ -6,7 +6,7 @@ namespace SCHIZO.Events.Ermcon [DisallowMultipleComponent] public sealed partial class Ermcon : GameEvent { - [MinMaxSlider(0, 100), Tooltip("Min/max number of creatures attending the event.")] + [Tooltip("Min/max number of creatures attending the event.")] public Vector2Int ticketsSold = new Vector2Int(10, 50); public float attendeeSearchRadius = 250f; public float panelistSearchRadius = 30; diff --git a/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/ErmconAttendee.cs b/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/ErmconAttendee.cs index 8eb13523..fe5e7f31 100644 --- a/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/ErmconAttendee.cs +++ b/Unity/Assets/Scripts/SCHIZO/Events/Ermcon/ErmconAttendee.cs @@ -1,7 +1,8 @@ -using NaughtyAttributes; +using JetBrains.Annotations; using SCHIZO.Creatures.Components; using SCHIZO.Interop.Subnautica; using SCHIZO.Sounds.Collections; +using TriInspector; using UnityEngine; namespace SCHIZO.Events.Ermcon @@ -13,13 +14,13 @@ public sealed partial class ErmconAttendee : CustomCreatureAction [Tooltip("Affects how long the creature will stay focused on one target as well as the con itself. The relationship is non-linear.")] public float patience = 10f; - [SerializeField] private SoundCollectionInstance pickupDeniedSounds; - [SerializeField] private _FMOD_CustomEmitter emitter; + [SerializeField, UsedImplicitly] private SoundCollectionInstance pickupDeniedSounds; + [SerializeField, UsedImplicitly] private _FMOD_CustomEmitter emitter; - private bool ForceDisable() + private TriValidationResult ForceDisable() { enabled = false; - return true; + return TriValidationResult.Valid; } } } diff --git a/Unity/Assets/Scripts/SCHIZO/Events/GameEvent.cs b/Unity/Assets/Scripts/SCHIZO/Events/GameEvent.cs index 03c67b09..90b57597 100644 --- a/Unity/Assets/Scripts/SCHIZO/Events/GameEvent.cs +++ b/Unity/Assets/Scripts/SCHIZO/Events/GameEvent.cs @@ -1,19 +1,22 @@ -using NaughtyAttributes; +using JetBrains.Annotations; +using TriInspector; using UnityEngine; namespace SCHIZO.Events { + [DeclareBoxGroup("sn", Title = "Subnautica")] + [DeclareBoxGroup("bz", Title = "Below Zero")] public abstract partial class GameEvent : MonoBehaviour { [Tooltip("If unchecked, the event can only be started manually through the 'event' console command.")] public bool canAutoStart = true; - [BoxGroup("Subnautica"), SerializeField, ShowIf(nameof(canAutoStart))] - [Label("Required Story Goal"), Tooltip("This story goal must be completed before the event can autostart.")] + [Group("sn"), SerializeField, ShowIf(nameof(canAutoStart)), UsedImplicitly] + [LabelText("Required Story Goal"), Tooltip("This story goal must be completed before the event can autostart.")] private string requiredStoryGoal_SN; - [BoxGroup("Below Zero"), SerializeField, ShowIf(nameof(canAutoStart))] - [Label("Required Story Goal"), Tooltip("This story goal must be completed before the event can autostart.")] + [Group("bz"), SerializeField, ShowIf(nameof(canAutoStart)), UsedImplicitly] + [LabelText("Required Story Goal"), Tooltip("This story goal must be completed before the event can autostart.")] private string requiredStoryGoal_BZ; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Helpers/BetterDropdownList.cs b/Unity/Assets/Scripts/SCHIZO/Helpers/BetterDropdownList.cs deleted file mode 100644 index 6649a410..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Helpers/BetterDropdownList.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using NaughtyAttributes; - -namespace SCHIZO.Helpers -{ - public class BetterDropdownList : Dictionary, IDropdownList - { - IEnumerator> IEnumerable>.GetEnumerator() - { - foreach (KeyValuePair kv in this) - { - yield return new KeyValuePair(kv.Key, kv.Value); - } - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } -} - diff --git a/Unity/Assets/Scripts/SCHIZO/Helpers/BetterDropdownList.cs.meta b/Unity/Assets/Scripts/SCHIZO/Helpers/BetterDropdownList.cs.meta deleted file mode 100644 index c37ca94c..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Helpers/BetterDropdownList.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 98159ce75d69c9549b38af0c1b5c5d2b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/Scripts/SCHIZO/Helpers/StaticHelpers.cs b/Unity/Assets/Scripts/SCHIZO/Helpers/StaticHelpers.cs index 0f250b59..7d04a687 100644 --- a/Unity/Assets/Scripts/SCHIZO/Helpers/StaticHelpers.cs +++ b/Unity/Assets/Scripts/SCHIZO/Helpers/StaticHelpers.cs @@ -4,7 +4,7 @@ namespace SCHIZO.Helpers { public static partial class StaticHelpers { - [AttributeUsage(AttributeTargets.Field)] + [AttributeUsage(AttributeTargets.Method)] public sealed partial class CacheAttribute : Attribute { } diff --git a/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlate.cs b/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlate.cs index af2d0aa6..eebd9b3d 100644 --- a/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlate.cs +++ b/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlate.cs @@ -1,5 +1,5 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Visual; +using SCHIZO.Attributes; +using TriInspector; using UnityEngine; namespace SCHIZO.HullPlates @@ -9,7 +9,7 @@ public sealed class HullPlate : ScriptableObject { [Careful] public string classId; public string displayName; - [HideIf(nameof(deprecated)), ResizableTextArea] public string tooltip; + [HideIf(nameof(deprecated)), TextArea(1, 5)] public string tooltip; public Texture2D texture; [HideIf(nameof(deprecated)), Careful] public Texture2D overrideIcon; public bool expensive; diff --git a/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlateLoader.cs b/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlateLoader.cs index c194e5c5..b0d28a91 100644 --- a/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlateLoader.cs +++ b/Unity/Assets/Scripts/SCHIZO/HullPlates/HullPlateLoader.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using NaughtyAttributes; +using TriInspector; using SCHIZO.Items.Data.Crafting; using SCHIZO.Registering; using UnityEngine; @@ -15,7 +15,7 @@ public sealed partial class HullPlateLoader : ModRegistryItem [FormerlySerializedAs("deprecatedTexture"), Required] public Texture2D missingTexture; [Required] public Recipe recipeRegular; [Required] public Recipe recipeExpensive; - [ReorderableList] public List hullPlates; + [ListDrawerSettings] public List hullPlates; [Button] private void Sort() diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes.meta b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes.meta deleted file mode 100644 index d6523eb4..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f68140a324064af8b3a7bb4d2d9f8d23 -timeCreated: 1697932624 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyMonoBehaviour.cs b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyMonoBehaviour.cs deleted file mode 100644 index 3a6e4993..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyMonoBehaviour.cs +++ /dev/null @@ -1,17 +0,0 @@ -using NaughtyAttributes; -using UnityEngine; - -namespace SCHIZO.Interop.NaughtyAttributes -{ - public abstract class NaughyMonoBehaviour : MonoBehaviour - { - private protected sealed class Required_string : ValidateInputAttribute - { - public Required_string(string message = null) : base(nameof(_required_string), message) - { - } - } - - private bool _required_string(string val) => !string.IsNullOrWhiteSpace(val); - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyMonoBehaviour.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyMonoBehaviour.cs.meta deleted file mode 100644 index 8fa8f773..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyMonoBehaviour.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: dcb7eb716e57475180e0bc1006ff3da8 -timeCreated: 1698712969 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyScriptableObject.cs b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyScriptableObject.cs deleted file mode 100644 index db16b9b5..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyScriptableObject.cs +++ /dev/null @@ -1,218 +0,0 @@ -using System; -using NaughtyAttributes; -using SCHIZO.Helpers; -using SCHIZO.Interop.Subnautica.Enums; -using SCHIZO.Interop.Subnautica.Enums.Subnautica; -using SCHIZO.Registering; -using SCHIZO.Attributes.Validation; -using UnityEngine; - -namespace SCHIZO.Interop.NaughtyAttributes -{ - public abstract class NaughtyScriptableObject : ScriptableObject - { - #region Validation attributes - - private protected sealed class Required_BehaviourType_SN : ValidateInputAttribute - { - public Required_BehaviourType_SN(string message = null) : base(nameof(_required_BehaviourType_SN), message) - { - } - } - - private protected sealed class Required_string : ValidateInputAttribute - { - public Required_string(string message = null) : base(nameof(_required_string), message) - { - } - } - - private bool _required_BehaviourType_SN(BehaviourType_SN val) => val != BehaviourType_SN.Unknown; - private bool _required_string(string val) => !string.IsNullOrWhiteSpace(val); - - #endregion - - #region Common dropdown values - - private protected sealed class CraftTreePathAttribute : SwitchDropdownAttribute - { - private readonly Game _game; - private readonly string _craftTreeName; - - public CraftTreePathAttribute(Game game, string craftTreeName) - { - _game = game; - _craftTreeName = craftTreeName; - } - - public override string GetDropdownListName(SerializedPropertyHolder property) - { - CraftTree_Type_All type = ReflectionHelpers.GetMemberValue(property.serializedObject_targetObject, _craftTreeName); - switch (_game) - { - case Game.Subnautica: - return GetDropdownListSN(type); - - case Game.BelowZero: - return GetDropdownListBZ(type); - - case Game.Both: - return GetDropdownListBoth(type); - - default: - throw new ArgumentOutOfRangeException(); - } - } - - private static string GetDropdownListSN(CraftTree_Type_All type) - { - switch (type) - { - case CraftTree_Type_All.Fabricator: - return nameof(_craftTreePaths_SN_Fabricator); - - case CraftTree_Type_All.Constructor: - return nameof(_craftTreePaths_SN_MVB); - - case CraftTree_Type_All.SeamothUpgrades: - return nameof(_craftTreePaths_SN_VUC); - - default: - return nameof(_craftTreePaths_other); - } - } - - private static string GetDropdownListBZ(CraftTree_Type_All type) - { - switch (type) - { - case CraftTree_Type_All.Fabricator: - case CraftTree_Type_All.SeaTruckFabricator: - return nameof(_craftTreePaths_BZ_Fabricator); - - case CraftTree_Type_All.Constructor: - return nameof(_craftTreePaths_BZ_MVB); - - case CraftTree_Type_All.SeamothUpgrades: - return nameof(_craftTreePaths_BZ_VUC); - - default: - return nameof(_craftTreePaths_other); - } - } - - private static string GetDropdownListBoth(CraftTree_Type_All type) - { - switch (type) - { - case CraftTree_Type_All.Fabricator: - return nameof(_craftTreePaths_SN_Fabricator); - - case CraftTree_Type_All.Constructor: - return nameof(_craftTreePaths_common_MVB); - - case CraftTree_Type_All.SeamothUpgrades: - return nameof(_craftTreePaths_common_VUC); - - default: - return nameof(_craftTreePaths_other); - } - } - } - - private readonly DropdownList _craftTreePaths_SN_Fabricator = new DropdownList() - { - {"(root)", ""}, - {"Resources", "Resources"}, - {"Resources -> Basic materials", "Resources/BasicMaterials"}, - {"Resources -> Advanced materials", "Resources/AdvancedMaterials"}, - {"Resources -> Electronics", "Resources/Electronics"}, - {"Survival", "Survival"}, - {"Survival -> Water", "Survival/Water"}, - {"Survival -> Cooked food", "Survival/CookedFood"}, - {"Survival -> Cured food", "Survival/CuredFood"}, - {"Personal", "Personal"}, - {"Personal -> Equipment", "Personal/Equipment"}, - {"Personal -> Tools", "Personal/Tools"}, - {"Personal -> Deployables", "Machines"}, - }; - - private readonly DropdownList _craftTreePaths_SN_MVB = new DropdownList() - { - {"(root)", ""}, - {"Vehicles", "Vehicles"}, - {"Rocket", "Rocket"}, - }; - - private readonly DropdownList _craftTreePaths_SN_VUC = new DropdownList() - { - {"(root)", ""}, - {"Common Modules", "CommonModules"}, - {"Seamoth Modules", "SeamothModules"}, - {"Prawn Suit Modules", "ExosuitModules"}, - {"Torpedoes", "Torpedoes"}, - }; - - private readonly DropdownList _craftTreePaths_BZ_Fabricator = new DropdownList() - { - {"(root)", ""}, - {"Resources", "Resources"}, - {"Resources -> Basic materials", "Resources/BasicMaterials"}, - {"Resources -> Advanced materials", "Resources/AdvancedMaterials"}, - {"Resources -> Electronics", "Resources/Electronics"}, - {"Survival", "Survival"}, - {"Survival -> Water", "Survival/Water"}, - {"Survival -> Cooked food", "Survival/CookedFood"}, - {"Survival -> Cured food", "Survival/CuredFood"}, - {"Personal", "Personal"}, - {"Personal -> Equipment", "Personal/Equipment"}, - {"Personal -> Tools", "Personal/Tools"}, - {"Personal -> Deployables", "Machines"}, - {"Upgrades", "Upgrades"}, - {"Upgrades -> Prawn Suit Upgrades", "Upgrades/ExosuitUpgrades"}, - {"Upgrades -> Seatruck Upgrades", "Upgrades/SeatruckUpgrades"}, - }; - - private readonly DropdownList _craftTreePaths_BZ_MVB = new DropdownList() - { - {"(root)", ""}, - {"Vehicles", "Vehicles"}, - {"Modules", "Modules"}, - }; - - private readonly DropdownList _craftTreePaths_BZ_VUC = new DropdownList() - { - {"(root)", ""}, - {"Prawn Suit Upgrades", "ExosuitModules"}, - {"Seatruck Upgrades", "SeaTruckUpgrade"}, - }; - - private readonly DropdownList _craftTreePaths_other = new DropdownList() - { - {"(root)", ""} - }; - - private readonly DropdownList _craftTreePaths_common_MVB = new DropdownList() - { - {"(root)", ""}, - {"Vehicles", "Vehicles"}, - }; - - private readonly DropdownList _craftTreePaths_common_VUC = new DropdownList() - { - {"(root)", ""}, - {"Prawn Suit Upgrades", "ExosuitModules"}, - }; - - #endregion - - private protected class HideInNormalInspectorAttribute : HideIfAttribute - { - public HideInNormalInspectorAttribute() : base(nameof(_true)) - { - } - } - - public bool _true => true; - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyScriptableObject.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyScriptableObject.cs.meta deleted file mode 100644 index 00adbe8b..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/NaughtyScriptableObject.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 7e2f2288b96042db9292f572263a9a4f -timeCreated: 1697933718 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.Unity.cs deleted file mode 100644 index f0eaa5f3..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.Unity.cs +++ /dev/null @@ -1,19 +0,0 @@ -using UnityEditor; - -namespace SCHIZO.Interop.NaughtyAttributes -{ - partial class SerializedPropertyHolder - { -#if UNITY_EDITOR - private readonly SerializedProperty _property; - - private SerializedPropertyHolder(SerializedProperty property) - { - _property = property; - } - - public static implicit operator SerializedPropertyHolder(SerializedProperty property) => new SerializedPropertyHolder(property); - public static implicit operator SerializedProperty(SerializedPropertyHolder holder) => holder._property; -#endif - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.Unity.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.Unity.cs.meta deleted file mode 100644 index 57557f2e..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.Unity.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: af56f048e74f44e78e1aa421d84e8452 -timeCreated: 1697942146 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.cs b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.cs deleted file mode 100644 index 216f39a9..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace SCHIZO.Interop.NaughtyAttributes -{ - public sealed partial class SerializedPropertyHolder - { - public object serializedObject_targetObject => -#if UNITY_EDITOR - _property.serializedObject.targetObject; -#else - throw new System.InvalidOperationException(); -#endif - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.cs.meta deleted file mode 100644 index 41fe59cc..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Interop/NaughtyAttributes/SerializedPropertyHolder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 5ff65c36815048c0bbfaa64967dfdf71 -timeCreated: 1697942111 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.Unity.cs new file mode 100644 index 00000000..970b162c --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.Unity.cs @@ -0,0 +1,9 @@ +namespace SCHIZO.Interop.Subnautica +{ + partial class _AggressionCreatureTrait : _CreatureTrait + { + public _AggressionCreatureTrait(float value, float falloff) : base(value, falloff) + { + } + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.Unity.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.Unity.cs.meta new file mode 100644 index 00000000..7bf21bef --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.Unity.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 370d217148e542fca2051239ad960b10 +timeCreated: 1699166225 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.cs new file mode 100644 index 00000000..f0d8d9a1 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.cs @@ -0,0 +1,9 @@ +using System; + +namespace SCHIZO.Interop.Subnautica +{ + [Serializable] + public partial class _AggressionCreatureTrait + { + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.cs.meta new file mode 100644 index 00000000..69d08ed7 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_AggressionCreatureTrait.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 10e85f2759b1489b8dcc1af1dd949e7a +timeCreated: 1699166213 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.Unity.cs index 1156e000..407e9a01 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.Unity.cs @@ -1,20 +1,24 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { + [DeclareFoldoutGroup(CREATURE_GROUP, Title = "Creature")] + [DeclareUnexploredGroup(CAVE_CRAWLER_GROUP)] public partial class _CaveCrawler : _Creature { - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float animationMaxSpeed = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float animationMaxTilt = 10; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float dampTime = 0.5f; - [BoxGroup("Cave Crawler"), ExposedType("FMODAsset")] public ScriptableObject jumpSound; - [BoxGroup("Cave Crawler"), ExposedType("FMOD_CustomLoopingEmitter")] public _FMOD_CustomEmitter walkingSound; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody rb; - [BoxGroup("Cave Crawler"), Required] public Collider aliveCollider; - [BoxGroup("Cave Crawler"), Required] public Collider deadCollider; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("OnSurfaceTracker")] public MonoBehaviour onSurfaceTracker; + [ComponentReferencesGroup, Required] public Rigidbody rb; + [ComponentReferencesGroup, Required, ExposedType("OnSurfaceTracker")] public MonoBehaviour onSurfaceTracker; + + [Group(CAVE_CRAWLER_GROUP), ExposedType("FMODAsset")] public ScriptableObject jumpSound; + [Group(CAVE_CRAWLER_GROUP), ExposedType("FMOD_CustomLoopingEmitter")] public _FMOD_CustomEmitter walkingSound; + [Group(CAVE_CRAWLER_GROUP), Required] public Collider aliveCollider; + [Group(CAVE_CRAWLER_GROUP), Required] public Collider deadCollider; + + [UnexploredGroup(CAVE_CRAWLER_GROUP)] public float animationMaxSpeed = 1; + [UnexploredGroup(CAVE_CRAWLER_GROUP)] public float animationMaxTilt = 10; + [UnexploredGroup(CAVE_CRAWLER_GROUP)] public float dampTime = 0.5f; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.cs index 89d4c9f2..896de3fe 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawler.cs @@ -1,9 +1,7 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("CaveCrawler")] public abstract partial class _CaveCrawler { + protected const string CAVE_CRAWLER_GROUP = "basecavecrawler"; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.Unity.cs index 5ba58796..df20d0c7 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.Unity.cs @@ -1,14 +1,14 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { - partial class _CaveCrawlerGravity : MonoBehaviour + partial class _CaveCrawlerGravity : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public _CaveCrawler caveCrawler; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody crawlerRigidbody; + [ComponentReferencesGroup, Required] public _CaveCrawler caveCrawler; + [ComponentReferencesGroup, Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; + [ComponentReferencesGroup, Required] public Rigidbody crawlerRigidbody; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.cs index e242c74c..e5e72beb 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CaveCrawlerGravity.cs @@ -1,9 +1,6 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("CaveCrawlerGravity")] - public partial class _CaveCrawlerGravity + public abstract partial class _CaveCrawlerGravity { } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.Unity.cs index 04fc7a1d..eb32a6ca 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.Unity.cs @@ -1,56 +1,34 @@ -using System; -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { - partial class _Creature : MonoBehaviour + [DeclareUnexploredGroup(CREATURE_GROUP)] + partial class _Creature : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; + [ComponentReferencesGroup, Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; + [ComponentReferencesGroup, Required] public Animator traitsAnimator; - [Required] public Animator traitsAnimator; + [Group(CREATURE_GROUP)] public AnimationCurve sizeDistribution; + [Group(CREATURE_GROUP)] public _AggressionCreatureTrait Aggression = new _AggressionCreatureTrait(0, 0.05f); + [Group(CREATURE_GROUP)] public _CreatureTrait Hunger = new _CreatureTrait(0, -0.1f); + [Group(CREATURE_GROUP)] public _CreatureTrait Scared = new _CreatureTrait(0, 0.1f); + [Group(CREATURE_GROUP), Range(0, -1)] public float eyeFOV = 0; - [BoxGroup("Base Creature")] public AnimationCurve sizeDistribution; - [BoxGroup("Base Creature")] public AggressionCreatureTrait Aggression = new AggressionCreatureTrait(0, 0.05f); - [BoxGroup("Base Creature")] public CreatureTrait Hunger = new CreatureTrait(0, -0.1f); - [BoxGroup("Base Creature")] public CreatureTrait Scared = new CreatureTrait(0, 0.1f); - [BoxGroup("Base Creature"), Range(0, -1)] public float eyeFOV = 0.25f; - - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public AnimationCurve initialCuriosity; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public AnimationCurve initialFriendliness; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public AnimationCurve initialHunger; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public CreatureTrait Curiosity; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public CreatureTrait Friendliness; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public CreatureTrait Tired; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public CreatureTrait Happy; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public AnimationCurve activity; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool hasEyes = true; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool eyesOnTop = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float hearingSensitivity = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool detectsMotion = true; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float babyScaleSize = 0.5f; - - [Serializable] - public class CreatureTrait - { - public float value; - public float falloff; - - public CreatureTrait(float value, float falloff) - { - this.value = value; - this.falloff = falloff; - } - } - - [Serializable] - public class AggressionCreatureTrait : CreatureTrait - { - public AggressionCreatureTrait(float value, float falloff) : base(value, falloff) - { - } - } + [UnexploredGroup(CREATURE_GROUP)] public AnimationCurve initialCuriosity; + [UnexploredGroup(CREATURE_GROUP)] public AnimationCurve initialFriendliness; + [UnexploredGroup(CREATURE_GROUP)] public AnimationCurve initialHunger; + [UnexploredGroup(CREATURE_GROUP)] public _CreatureTrait Curiosity; + [UnexploredGroup(CREATURE_GROUP)] public _CreatureTrait Friendliness; + [UnexploredGroup(CREATURE_GROUP)] public _CreatureTrait Tired; + [UnexploredGroup(CREATURE_GROUP)] public _CreatureTrait Happy; + [UnexploredGroup(CREATURE_GROUP)] public AnimationCurve activity; + [UnexploredGroup(CREATURE_GROUP)] public bool hasEyes = true; + [UnexploredGroup(CREATURE_GROUP)] public bool eyesOnTop = false; + [UnexploredGroup(CREATURE_GROUP)] public float hearingSensitivity = 1; + [UnexploredGroup(CREATURE_GROUP)] public bool detectsMotion = true; + [UnexploredGroup(CREATURE_GROUP)] public float babyScaleSize = 0.5f; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.cs index 86cdc302..34b5e55b 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_Creature.cs @@ -1,9 +1,7 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("Creature")] public abstract partial class _Creature { + protected const string CREATURE_GROUP = "basecreature"; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.Unity.cs index 901801a7..f5702b11 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.Unity.cs @@ -1,18 +1,20 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { - partial class _CreatureAction : MonoBehaviour + [DeclareBoxGroup("creatureaction", Title = "Base Creature Action")] + [DeclareUnexploredGroup("creatureaction")] + partial class _CreatureAction : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("_Creature")] public MonoBehaviour creature; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("SwimBehaviour")] public MonoBehaviour swimBehaviour; + [ComponentReferencesGroup, Required, ExposedType("_Creature")] public MonoBehaviour creature; + [ComponentReferencesGroup, Required, ExposedType("SwimBehaviour")] public MonoBehaviour swimBehaviour; - [BoxGroup("Base Creature Action"), Range(0, 1)] public float evaluatePriority = 0.4f; + [Group("creatureaction"), Range(0, 1)] public float evaluatePriority = 0.4f; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public AnimationCurve priorityMultiplier; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float minActionCheckInterval = -1; + [UnexploredGroup("creatureaction")] public AnimationCurve priorityMultiplier; + [UnexploredGroup("creatureaction")] public float minActionCheckInterval = -1; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.cs index f9e2a0f2..047771d3 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureAction.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - namespace SCHIZO.Interop.Subnautica { - [ActualType("CreatureAction")] public abstract partial class _CreatureAction { } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.Unity.cs index 1cafdbea..84d1ad51 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.Unity.cs @@ -1,21 +1,29 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { + [DeclareFoldoutGroup(DROP_TOOL_GROUP, Title = "Drop Tool")] + [DeclareFoldoutGroup(CREATURE_TOOL_GROUP + "/release", Title = "Release")] + [DeclareUnexploredGroup(CREATURE_TOOL_GROUP)] partial class _CreatureTool : _DropTool { - [Foldout("Release"), ExposedType("FMODAsset")] public Object releaseUnderwaterSound; - [Foldout("Release"), ExposedType("FMODAsset")] public Object releaseAboveWaterSound; + protected const string CREATURE_TOOL_GROUP = "creaturetool"; - [Foldout("\u00af\\_(ツ)_/\u00af")] public bool useSpeedAnimationParam; - [Foldout("\u00af\\_(ツ)_/\u00af")] public bool disableSoundsOnKill = true; + [GroupNext(CREATURE_TOOL_GROUP + "/release")] + public _FMODAsset releaseUnderwaterSound; + public _FMODAsset releaseAboveWaterSound; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("_Creature")] public MonoBehaviour creature; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Animator animator; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("Locomotion")] public MonoBehaviour locomotion; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; + [UnexploredGroupNext(CREATURE_TOOL_GROUP)] + public bool useSpeedAnimationParam; + public bool disableSoundsOnKill = true; + + [ComponentReferencesGroupNext] + [Required] public _Creature creature; + [Required] public Animator animator; + [Required, ExposedType("Locomotion")] public MonoBehaviour locomotion; + [Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.cs index c27db519..d7ba7e70 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTool.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("CreatureTool")] public abstract partial class _CreatureTool { } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.Unity.cs new file mode 100644 index 00000000..6b83aa4f --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.Unity.cs @@ -0,0 +1,14 @@ +namespace SCHIZO.Interop.Subnautica +{ + partial class _CreatureTrait + { + public float value; + public float falloff; + + public _CreatureTrait(float value, float falloff) + { + this.value = value; + this.falloff = falloff; + } + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.Unity.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.Unity.cs.meta new file mode 100644 index 00000000..dcfe2313 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.Unity.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2086114b6e034e78a0ccc3074b2b078d +timeCreated: 1699164564 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.cs new file mode 100644 index 00000000..896a7065 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.cs @@ -0,0 +1,9 @@ +using System; + +namespace SCHIZO.Interop.Subnautica +{ + [Serializable] + public partial class _CreatureTrait + { + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.cs.meta b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.cs.meta new file mode 100644 index 00000000..32d6d9be --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_CreatureTrait.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 90ac2048f85b485c865eb3145bc0f41d +timeCreated: 1699164537 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.Unity.cs index 7fd92ccd..30d034f8 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.Unity.cs @@ -1,9 +1,12 @@ -using NaughtyAttributes; +using TriInspector; namespace SCHIZO.Interop.Subnautica { + [DeclareFoldoutGroup(PLAYER_TOOL_GROUP, Title = "Player Tool")] partial class _DropTool : _PlayerTool { - [Foldout("Drop Tool")] public float pushForce = 8f; + protected const string DROP_TOOL_GROUP = "droptool"; + + [Group(DROP_TOOL_GROUP)] public float pushForce = 8f; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.cs index dfe52202..7accaaf4 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_DropTool.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("DropTool")] public abstract partial class _DropTool { } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMODAsset.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMODAsset.Unity.cs index cc5ac7b7..03b5b496 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMODAsset.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMODAsset.Unity.cs @@ -1,4 +1,4 @@ -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.Unity.cs index 4aa7f107..89624aed 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.Unity.cs @@ -1,15 +1,15 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { + [DeclareFoldoutGroup("Meaningless")] partial class _FMOD_CustomEmitter : MonoBehaviour { - [Foldout("Meaningless"), ExposedType("FMODAsset")] public ScriptableObject asset; - [Foldout("Meaningless")] public bool playOnAwake; - [Foldout("Meaningless")] public bool followParent = true; - [Foldout("Meaningless")] public bool restartOnPlay; - [Foldout("Meaningless")] public bool debug; + [Group("Meaningless")] public _FMODAsset asset; + [Group("Meaningless")] public bool playOnAwake; + [Group("Meaningless")] public bool followParent = true; + [Group("Meaningless")] public bool restartOnPlay; + [Group("Meaningless")] public bool debug; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.cs index 58de74d9..5b8bdee4 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_FMOD_CustomEmitter.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("FMOD_CustomEmitter")] public abstract partial class _FMOD_CustomEmitter { } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.Unity.cs index 68abb94f..278e143e 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.Unity.cs @@ -1,24 +1,26 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { - partial class _LandCreatureGravity : MonoBehaviour + partial class _LandCreatureGravity : TriMonoBehaviour { + [ComponentReferencesGroup, Required, ExposedType("OnSurfaceTracker")] public MonoBehaviour onSurfaceTracker; + [ComponentReferencesGroup, Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; + [ComponentReferencesGroup, Required] public Rigidbody creatureRigidbody; + [ComponentReferencesGroup, Required, ExposedType("WorldForces")] public MonoBehaviour worldForces; + [ComponentReferencesGroup, Required] public SphereCollider bodyCollider; + [ComponentReferencesGroup, ExposedType("Pickupable")] public MonoBehaviour pickupable; + public float downforce = 10; public float aboveWaterGravity = 9.81f; public float underWaterGravity = 2.7f; public bool applyDownforceUnderwater; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool canGoInStasisUnderwater = true; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("OnSurfaceTracker")] public MonoBehaviour onSurfaceTracker; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody creatureRigidbody; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("WorldForces")] public MonoBehaviour worldForces; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public SphereCollider bodyCollider; - [Foldout(STRINGS.COMPONENT_REFERENCES), ExposedType("Pickupable")] public MonoBehaviour pickupable; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool trackSurfaceCollider = true; + + [UnexploredGroup] public bool canGoInStasisUnderwater = true; + [UnexploredGroup] public bool trackSurfaceCollider = true; // public LandCreatureGravity.OnInStasisStateChange onInStasisStateChange; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.cs index 4afd128e..15301ecf 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_LandCreatureGravity.cs @@ -1,9 +1,6 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("LandCreatureGravity")] - public partial class _LandCreatureGravity + public abstract partial class _LandCreatureGravity { } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.Unity.cs index a970008d..cccfd0f1 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.Unity.cs @@ -1,15 +1,18 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; -using SCHIZO.Utilities; +using SCHIZO.Attributes; +using TriInspector; +using SCHIZO.TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { - partial class _MeleeAttack : MonoBehaviour + partial class _MeleeAttack : TriMonoBehaviour { - [Required] public GameObject mouth; - [Required] public Animator animator; + [ComponentReferencesGroup, Required, ExposedType("LastTarget")] public MonoBehaviour lastTarget; + [ComponentReferencesGroup, Required] public _Creature creature; + [ComponentReferencesGroup, Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; + [ComponentReferencesGroup, Required] public Animator animator; + [Required] public GameObject mouth; public float biteInterval = 1; public float biteDamage = 30; public bool canBitePlayer = true; @@ -19,17 +22,13 @@ partial class _MeleeAttack : MonoBehaviour public bool ignoreSameKind = false; public bool canBeFed = true; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("LastTarget")] public MonoBehaviour lastTarget; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public _Creature creature; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required, ExposedType("LiveMixin")] public MonoBehaviour liveMixin; - - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float biteAggressionThreshold = 0.3f; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float eatHungerDecrement = 0.5f; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float eatHappyIncrement = 0.5f; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float biteAggressionDecrement = 0.4f; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public GameObject damageFX; + [UnexploredGroup] public float biteAggressionThreshold = 0.3f; + [UnexploredGroup] public float eatHungerDecrement = 0.5f; + [UnexploredGroup] public float eatHappyIncrement = 0.5f; + [UnexploredGroup] public float biteAggressionDecrement = 0.4f; + [UnexploredGroup] public GameObject damageFX; - [Foldout(STRINGS.UNCHANGED_BY_ECC), ReadOnly] public Object _attackSound; + // [UnexploredGroup, ReadOnly] public Object attackSound; public void OnTouch(Collider col) {} } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.cs index db39cc42..567fee33 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_MeleeAttack.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("MeleeAttack")] public abstract partial class _MeleeAttack { } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.Unity.cs index 3ceae65e..6933f0a6 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.Unity.cs @@ -1,10 +1,13 @@ -using NaughtyAttributes; +using SCHIZO.TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { - partial class _ModelPlug : MonoBehaviour + [DeclareUnexploredGroup(MODEL_PLUG_GROUP)] + partial class _ModelPlug : TriMonoBehaviour { - [Foldout("\u00af\\_(ツ)_/\u00af")] public Transform plugOrigin; + protected const string MODEL_PLUG_GROUP = "Model Plug"; + + [UnexploredGroup(MODEL_PLUG_GROUP)] public Transform plugOrigin; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.cs index 65154514..c892f7d9 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_ModelPlug.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("ModelPlug")] public abstract partial class _ModelPlug { } diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.Unity.cs index f3308424..524a4628 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.Unity.cs @@ -1,46 +1,63 @@ -using NaughtyAttributes; -using SCHIZO.Attributes.Typing; +using SCHIZO.Attributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; namespace SCHIZO.Interop.Subnautica { + [DeclareFoldoutGroup(MODEL_PLUG_GROUP, Title = "Model Plug")] + [DeclareFoldoutGroup(PLAYER_TOOL_GROUP + "/ik", Title = "IK")] + [DeclareFoldoutGroup(PLAYER_TOOL_GROUP + "/anims", Title = "Main Animations")] + [DeclareFoldoutGroup(PLAYER_TOOL_GROUP + "/bash", Title = "Bashing")] + [DeclareFoldoutGroup(PLAYER_TOOL_GROUP + "/firstuse", Title = "First Use")] + [DeclareFoldoutGroup(PLAYER_TOOL_GROUP + "/reload", Title = "Reloading")] + [DeclareUnexploredGroup(PLAYER_TOOL_GROUP)] partial class _PlayerTool : _ModelPlug { + protected const string PLAYER_TOOL_GROUP = "Player Tool"; + + [GroupNext(PLAYER_TOOL_GROUP)] public Collider mainCollider; [ExposedType("Pickupable")] public MonoBehaviour pickupable; - [ReorderableList] public Renderer[] renderers; - - [Foldout("IK")] public bool ikAimLeftArm; - [Foldout("IK")] public bool ikAimRightArm; - [Foldout("IK")] public Transform leftHandIKTarget; - [Foldout("IK")] public Transform rightHandIKTarget; - [Foldout("IK"), Range(0.0f, 90f)] public float ikAimLookDownAngleLimit = 90; - [Foldout("IK")] public bool useLeftAimTargetOnPlayer; - - [Foldout("Main Animations")] public bool hasAnimations = true; - [Foldout("Main Animations")] public float drawTime = 0.5f; - [Foldout("Main Animations"), ExposedType("FMODAsset")] public Object drawSound; - [Foldout("Main Animations"), ExposedType("FMODAsset")] public Object drawSoundUnderwater; - [Foldout("Main Animations")] public float holsterTime = 0.35f; - [Foldout("Main Animations"), ExposedType("FMODAsset")] public Object holsterSoundAboveWater; - [Foldout("Main Animations"), ExposedType("FMODAsset")] public Object holsterSoundUnderwater; - [Foldout("Main Animations")] public float dropTime = 1f; - - [Foldout("Bashing")] public float bashTime = 0.7f; - [Foldout("Bashing")] public float bleederDamage = 3; - [Foldout("Bashing")] public float spikeyTrapDamage = 1; - [Foldout("Bashing"), ExposedType("FMODAsset")] public Object bashAnimationSound; - [Foldout("Bashing")] public bool hasBashAnimation; - [Foldout("Bashing"), ExposedType("FMODAsset")] public Object hitBleederSound; - - [Foldout("First Use")] public bool hasFirstUseAnimation; - [Foldout("First Use")] public _FMOD_CustomEmitter firstUseSound; - - [Foldout("Reloading")] public ReloadMode reloadMode = ReloadMode.Direct; - [Foldout("Reloading"), ExposedType("FMODAsset")] public Object reloadSound; - - [Foldout("\u00af\\_(ツ)_/\u00af")] public Socket socket = Socket.RightHand; - [Foldout("\u00af\\_(ツ)_/\u00af")] public bool waitForAnimDrawEvent; + [ListDrawerSettings] public Renderer[] renderers; + + [GroupNext(PLAYER_TOOL_GROUP + "/ik")] + public bool ikAimLeftArm; + public bool ikAimRightArm; + public Transform leftHandIKTarget; + public Transform rightHandIKTarget; + [Range(0.0f, 90f)] public float ikAimLookDownAngleLimit = 90; + public bool useLeftAimTargetOnPlayer; + + [GroupNext(PLAYER_TOOL_GROUP + "/anims")] + public bool hasAnimations = true; + public float drawTime = 0.5f; + public _FMODAsset drawSound; + public _FMODAsset drawSoundUnderwater; + public float holsterTime = 0.35f; + public _FMODAsset holsterSoundAboveWater; + public _FMODAsset holsterSoundUnderwater; + public float dropTime = 1f; + + [GroupNext(PLAYER_TOOL_GROUP + "/bash")] + public float bashTime = 0.7f; + public float bleederDamage = 3; + public float spikeyTrapDamage = 1; + public _FMODAsset bashAnimationSound; + public bool hasBashAnimation; + public _FMODAsset hitBleederSound; + + [GroupNext(PLAYER_TOOL_GROUP + "/firstuse")] + public bool hasFirstUseAnimation; + public _FMOD_CustomEmitter firstUseSound; + + [GroupNext(PLAYER_TOOL_GROUP + "/reload")] + public ReloadMode reloadMode = ReloadMode.Direct; + public _FMODAsset reloadSound; + + [UnexploredGroupNext(PLAYER_TOOL_GROUP)] + public Socket socket = Socket.RightHand; + public bool waitForAnimDrawEvent; public enum ReloadMode { diff --git a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.cs b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.cs index ebad8036..732af367 100644 --- a/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.cs +++ b/Unity/Assets/Scripts/SCHIZO/Interop/Subnautica/_PlayerTool.cs @@ -1,8 +1,5 @@ -using SCHIZO.Attributes.Typing; - -namespace SCHIZO.Interop.Subnautica +namespace SCHIZO.Interop.Subnautica { - [ActualType("PlayerTool")] public abstract partial class _PlayerTool { } diff --git a/Unity/Assets/Scripts/SCHIZO/Items/CloneItemLoader.cs b/Unity/Assets/Scripts/SCHIZO/Items/CloneItemLoader.cs index f3c22d88..49954d5f 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/CloneItemLoader.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/CloneItemLoader.cs @@ -1,10 +1,11 @@ using SCHIZO.Items.Data; +using TriInspector; using UnityEngine; namespace SCHIZO.Items { public abstract partial class CloneItemLoader : ScriptableObject { - [NaughtyAttributes.ReadOnly] public CloneItemData itemData; + [ReadOnly] public CloneItemData itemData; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Items/Data/CloneItemData.cs b/Unity/Assets/Scripts/SCHIZO/Items/Data/CloneItemData.cs index 5878d1a6..97adbbe6 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/Data/CloneItemData.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/Data/CloneItemData.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using SCHIZO.Interop.Subnautica.Enums; using UnityEngine; @@ -11,10 +11,10 @@ public sealed partial class CloneItemData : ItemData [CommonData, ReadOnly, Required] public CloneItemLoader loader; - [SNData, Label("Clone Target"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN))] + [SNData, LabelText("Clone Target"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN))] private TechType_All cloneTargetSN; - [BZData, Label("Clone Target"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ))] + [BZData, LabelText("Clone Target"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ))] private TechType_All cloneTargetBZ; #if UNITY_EDITOR diff --git a/Unity/Assets/Scripts/SCHIZO/Items/Data/Crafting/Recipe.cs b/Unity/Assets/Scripts/SCHIZO/Items/Data/Crafting/Recipe.cs index 5ebe4b4d..22126578 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/Data/Crafting/Recipe.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/Data/Crafting/Recipe.cs @@ -1,5 +1,5 @@ -using NaughtyAttributes; -using SCHIZO.Registering; +using SCHIZO.Registering; +using TriInspector; using UnityEngine; namespace SCHIZO.Items.Data.Crafting @@ -10,7 +10,7 @@ public sealed partial class Recipe : ScriptableObject public Game game = Game.Subnautica | Game.BelowZero; public int craftAmount = 1; - [ReorderableList] public Ingredient[] ingredients; - [ReorderableList] public Item[] linkedItems; + [ListDrawerSettings] public Ingredient[] ingredients; + [ListDrawerSettings] public Item[] linkedItems; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs b/Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs index 799bef34..de6ecc0f 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs @@ -1,42 +1,46 @@ -using JetBrains.Annotations; -using NaughtyAttributes; +using System.Linq; +using JetBrains.Annotations; +using SCHIZO.Attributes; using SCHIZO.Interop.Subnautica.Enums; using SCHIZO.Interop.Subnautica.Enums.BelowZero; using SCHIZO.Interop.Subnautica.Enums.Subnautica; using SCHIZO.Items.Data.Crafting; using SCHIZO.Registering; -using SCHIZO.Attributes.Visual; using SCHIZO.Sounds; +using TriInspector; using UnityEngine; using UnityEngine.Serialization; -using static NaughtyAttributes.EConditionOperator; namespace SCHIZO.Items.Data { [CreateAssetMenu(menuName = "SCHIZO/Items/Item Data")] + [DeclareBoxGroup("TechType")] + [DeclareBoxGroup("common", Title = "Common Properties")] + [DeclareBoxGroup("sn", Title = "Subnautica")] + [DeclareBoxGroup("bz", Title = "Below Zero")] public partial class ItemData : ModRegistryItem { public GameObject prefab; - [BoxGroup("TechType"), Required_string, Careful] + [Group("TechType"), Required, Careful] public string classId; - [BoxGroup("TechType"), Required_string] + [Group("TechType"), Required] public string displayName; - [BoxGroup("TechType"), ResizableTextArea, ShowIf(nameof(ShowPickupableProps))] + [Group("TechType"), TextArea(1, 5), ShowIf(nameof(ShowPickupableProps))] public string tooltip; [CommonData, ShowIf(nameof(ShowPickupableProps)), Required] public Sprite icon; - [CommonData, HideIf(Or, nameof(HidePickupableProps), nameof(isBuildable)), Careful] + [CommonData, HideIf(nameof(HidePickupableProps)), HideIf(nameof(isBuildable)), Careful] public Vector2Int itemSize = new Vector2Int(1, 1); - [CommonData, HideIf(Or, nameof(HidePickupableProps), nameof(isBuildable)), Careful] + [CommonData, HideIf(nameof(HidePickupableProps)), HideIf(nameof(isBuildable)), Careful] public bool isCraftable; - [CommonData, HideIf(Or, nameof(HidePickupableProps), nameof(isCraftable)), Careful] + [CommonData, HideIf(nameof(HidePickupableProps)), HideIf(nameof(isBuildable)), Careful] public bool isBuildable; [CommonData, ShowIf(nameof(IsActuallyCraftable))] @@ -47,82 +51,195 @@ public partial class ItemData : ModRegistryItem #region Subnautica Data - [SNData, Label("Register"), SerializeField, Careful] + [SNData, LabelText("Register"), SerializeField, Careful] public bool registerInSN = true; - [SNData, Label("Recipe"), SerializeField, ShowIf(And, nameof(registerInSN), nameof(IsBuildableOrCraftable)), Careful] + [SNData, LabelText("Recipe"), SerializeField, ShowIf(nameof(registerInSN)), ShowIf(nameof(IsBuildableOrCraftable)), Careful] private Recipe recipeSN; - [SNData, Label("Craft Tree"), ShowIf(And, nameof(registerInSN), nameof(IsActuallyCraftable)), SerializeField] + [SNData, LabelText("Craft Tree"), ShowIf(nameof(registerInSN)), ShowIf(nameof(IsActuallyCraftable)), SerializeField] private CraftTree_Type_All craftTreeTypeSN = CraftTree_Type_All.None; - [SNData, Label("Craft Tree Path"), ShowIf(And, nameof(registerInSN), nameof(craftTreePathSN_ShowIf)), CraftTreePath(Game.Subnautica, nameof(craftTreeTypeSN)), SerializeField, UsedImplicitly] + [SNData, LabelText("Craft Tree Path"), ShowIf(nameof(registerInSN)), ShowIf(nameof(craftTreePathSN_ShowIf)), Dropdown(nameof(SNCraftTreePath)), SerializeField, UsedImplicitly] private string craftTreePathSN = ""; - [SNData, Label("Tech Group"), ValidateInput(nameof(techGroupSN_Validate)), SerializeField, ShowIf(And, nameof(registerInSN), nameof(IsBuildableOrCraftable))] + [SNData, LabelText("Tech Group"), ValidateInput(nameof(techGroupSN_Validate)), SerializeField, ShowIf(nameof(registerInSN)), ShowIf(nameof(IsBuildableOrCraftable))] private TechGroup_SN techGroupSN = TechGroup_SN.Uncategorized; - [SNData, Label("Tech Category"), SerializeField, ShowIf(And, nameof(registerInSN), nameof(techCategorySN_ShowIf)), UsedImplicitly] + [SNData, LabelText("Tech Category"), SerializeField, ShowIf(nameof(registerInSN)), ShowIf(nameof(techCategorySN_ShowIf)), UsedImplicitly] private TechCategory_SN techCategorySN; - [FormerlySerializedAs("databankInfoSN"), SNData, Label("PDA Ency Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN))] + [SNData, LabelText("PDA Ency Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN)), FormerlySerializedAs("databankInfoSN")] private PDAEncyclopediaInfo pdaEncyclopediaInfoSN; - [SNData, Label("Known Tech Info"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInSN), nameof(ShowPickupableProps))] + [SNData, LabelText("Known Tech Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN)), ShowIf(nameof(ShowPickupableProps))] private KnownTechInfo knownTechInfoSN; - [SNData, Label("Unlock At Start"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInSN), nameof(IsBuildableOrCraftable)), Careful] + [SNData, LabelText("Unlock At Start"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN)), ShowIf(nameof(IsBuildableOrCraftable)), Careful] private bool unlockAtStartSN = true; - [SNData, Label("Required For Unlock"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInSN), nameof(requiredForUnlockSN_ShowIf)), Careful] + [SNData, LabelText("Required For Unlock"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN)), ShowIf(nameof(requiredForUnlockSN_ShowIf)), Careful] private Item requiredForUnlockSN; #endregion #region Below Zero Data - [BZData, Label("Register"), SerializeField, Careful] + [BZData, LabelText("Register"), SerializeField, Careful] public bool registerInBZ = true; - [BZData, Label("Recipe"), SerializeField, ShowIf(And, nameof(registerInBZ), nameof(IsBuildableOrCraftable)), Careful] + [BZData, LabelText("Recipe"), SerializeField, ShowIf(nameof(registerInBZ)), ShowIf(nameof(IsBuildableOrCraftable)), Careful] private Recipe recipeBZ; - [BZData, Label("Can Be Recycled"), ShowIf(And, nameof(registerInBZ), nameof(IsActuallyCraftable))] + [BZData, LabelText("Can Be Recycled"), ShowIf(nameof(registerInBZ)), ShowIf(nameof(IsActuallyCraftable))] public bool canBeRecycledBZ = true; - [BZData, Label("Craft Tree"), ShowIf(And, nameof(registerInBZ), nameof(IsActuallyCraftable)), SerializeField] + [BZData, LabelText("Craft Tree"), ShowIf(nameof(registerInBZ)), ShowIf(nameof(IsActuallyCraftable)), SerializeField] private CraftTree_Type_All craftTreeTypeBZ = CraftTree_Type_All.None; - [BZData, Label("Craft Tree Path"), ShowIf(And, nameof(registerInBZ), nameof(craftTreePathBZ_ShowIf)), CraftTreePath(Game.BelowZero, nameof(craftTreeTypeBZ)), SerializeField, UsedImplicitly] + [BZData, LabelText("Craft Tree Path"), ShowIf(nameof(registerInBZ)), ShowIf(nameof(craftTreePathBZ_ShowIf)), SerializeField, UsedImplicitly, Dropdown(nameof(BZCraftTreePath))] private string craftTreePathBZ = ""; - [BZData, Label("Tech Group"), ValidateInput(nameof(techGroupBZ_Validate)), SerializeField, ShowIf(And, nameof(registerInBZ), nameof(IsBuildableOrCraftable))] + [BZData, LabelText("Tech Group"), ValidateInput(nameof(techGroupBZ_Validate)), SerializeField, ShowIf(nameof(registerInBZ)), ShowIf(nameof(IsBuildableOrCraftable))] private TechGroup_BZ techGroupBZ = TechGroup_BZ.Uncategorized; - [BZData, Label("Tech Category"), SerializeField, ShowIf(And, nameof(registerInBZ), nameof(techCategoryBZ_ShowIf)), UsedImplicitly] + [BZData, LabelText("Tech Category"), SerializeField, ShowIf(nameof(registerInBZ)), ShowIf(nameof(techCategoryBZ_ShowIf)), UsedImplicitly] private TechCategory_BZ techCategoryBZ; - [FormerlySerializedAs("databankInfoBZ")] [BZData, Label("PDA Ency Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ))] + [BZData, LabelText("PDA Ency Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ)), FormerlySerializedAs("databankInfoBZ")] private PDAEncyclopediaInfo pdaEncyclopediaInfoBZ; - [BZData, Label("Known Tech Info"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(ShowPickupableProps))] + [BZData, LabelText("Known Tech Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ)), ShowIf(nameof(ShowPickupableProps))] private KnownTechInfo knownTechInfoBZ; - [BZData, Label("Sound Type"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(Sounds_ShowIf))] + [BZData, LabelText("Sound Type"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ)), ShowIf(nameof(Sounds_ShowIf))] private TechData_SoundType_BZ soundTypeBZ; - [BZData, Label("Unlock At Start"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(IsBuildableOrCraftable)), Careful] + [BZData, LabelText("Unlock At Start"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ)), ShowIf(nameof(IsBuildableOrCraftable)), Careful] private bool unlockAtStartBZ = true; - [BZData, Label("Required For Unlock"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(requiredForUnlockBZ_ShowIf)), Careful] + [BZData, LabelText("Required For Unlock"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ)), ShowIf(nameof(requiredForUnlockBZ_ShowIf)), Careful] private Item requiredForUnlockBZ; #endregion #region NaughtyAttributes stuff - private bool techGroupSN_Validate(TechGroup_SN val) => !isBuildable || val != TechGroup_SN.Uncategorized; - private bool techGroupBZ_Validate(TechGroup_BZ val) => !isBuildable || val != TechGroup_BZ.Uncategorized; + private TriDropdownList SNCraftTreePath() + { + switch (craftTreeTypeSN) + { + case CraftTree_Type_All.Fabricator: + return new TriDropdownList() + { + {"", ""}, + {"Resources/", "Resources"}, + {"Resources/Basic materials", "Resources/BasicMaterials"}, + {"Resources/Advanced materials", "Resources/AdvancedMaterials"}, + {"Resources/Electronics", "Resources/Electronics"}, + {"Survival/", "Survival"}, + {"Survival/Water", "Survival/Water"}, + {"Survival/Cooked food", "Survival/CookedFood"}, + {"Survival/Cured food", "Survival/CuredFood"}, + {"Personal/", "Personal"}, + {"Personal/Equipment", "Personal/Equipment"}, + {"Personal/Tools", "Personal/Tools"}, + {"Personal/Deployables", "Machines"}, + }; + + case CraftTree_Type_All.Constructor: + return new TriDropdownList() + { + {"(root)", ""}, + {"Vehicles", "Vehicles"}, + {"Rocket", "Rocket"}, + }; + + case CraftTree_Type_All.SeamothUpgrades: + return new TriDropdownList() + { + {"(root)", ""}, + {"Common Modules", "CommonModules"}, + {"Seamoth Modules", "SeamothModules"}, + {"Prawn Suit Modules", "ExosuitModules"}, + {"Torpedoes", "Torpedoes"}, + }; + + default: + return new TriDropdownList() + { + {"(root)", ""}, + }; + } + } + + private TriDropdownList BZCraftTreePath() + { + switch (craftTreeTypeBZ) + { + case CraftTree_Type_All.Fabricator: + case CraftTree_Type_All.SeaTruckFabricator: + return new TriDropdownList() + { + {"", ""}, + {"Resources/", "Resources"}, + {"Resources/Basic materials", "Resources/BasicMaterials"}, + {"Resources/Advanced materials", "Resources/AdvancedMaterials"}, + {"Resources/Electronics", "Resources/Electronics"}, + {"Survival/", "Survival"}, + {"Survival/Water", "Survival/Water"}, + {"Survival/Cooked food", "Survival/CookedFood"}, + {"Survival/Cured food", "Survival/CuredFood"}, + {"Personal/", "Personal"}, + {"Personal/Equipment", "Personal/Equipment"}, + {"Personal/Tools", "Personal/Tools"}, + {"Personal/Deployables", "Machines"}, + {"Upgrades/", "Upgrades"}, + {"Upgrades/Prawn Suit Upgrades", "Upgrades/ExosuitUpgrades"}, + {"Upgrades/Seatruck Upgrades", "Upgrades/SeatruckUpgrades"}, + }; + + case CraftTree_Type_All.Constructor: + return new TriDropdownList() + { + {"(root)", ""}, + {"Vehicles", "Vehicles"}, + {"Modules", "Modules"}, + }; + + case CraftTree_Type_All.SeamothUpgrades: + return new TriDropdownList() + { + {"(root)", ""}, + {"Prawn Suit Upgrades", "ExosuitModules"}, + {"Seatruck Upgrades", "SeaTruckUpgrade"}, + }; + + default: + return new TriDropdownList() + { + {"(root)", ""}, + }; + } + } + + private void OnValidate() + { + if (!SNCraftTreePath().Select(i => i.Value).Contains(craftTreePathSN)) craftTreePathSN = ""; + if (!SNCraftTreePath().Select(i => i.Value).Contains(craftTreePathSN)) craftTreePathSN = ""; + } + + private TriValidationResult techGroupSN_Validate() + { + if (isBuildable && techGroupSN == TechGroup_SN.Uncategorized) return TriValidationResult.Error("Tech group cannot be Uncategorized if the item is buildable"); + return TriValidationResult.Valid; + } + + private TriValidationResult techGroupBZ_Validate() + { + if (isBuildable && techGroupBZ == TechGroup_BZ.Uncategorized) return TriValidationResult.Error("Tech group cannot be Uncategorized if the item is buildable"); + return TriValidationResult.Valid; + } private bool techCategorySN_ShowIf() => techGroupSN != TechGroup_SN.Uncategorized && IsBuildableOrCraftable(); private bool techCategoryBZ_ShowIf() => techGroupBZ != TechGroup_BZ.Uncategorized && IsBuildableOrCraftable(); @@ -142,23 +259,23 @@ public partial class ItemData : ModRegistryItem private bool IsBuildableOrCraftable() => isBuildable || IsActuallyCraftable(); - private protected sealed class CommonData : BoxGroupAttribute + private protected sealed class CommonData : GroupAttribute { - public CommonData() : base("Common Properties") + public CommonData() : base("common") { } } - private protected class SNData : BoxGroupAttribute + private protected class SNData : GroupAttribute { - public SNData() : base("Subnautica Data") + public SNData() : base("sn") { } } - private protected class BZData : BoxGroupAttribute + private protected class BZData : GroupAttribute { - public BZData() : base("Below Zero Data") + public BZData() : base("bz") { } } diff --git a/Unity/Assets/Scripts/SCHIZO/Items/Data/KnownTechInfo.cs b/Unity/Assets/Scripts/SCHIZO/Items/Data/KnownTechInfo.cs index 0d3ba2a2..1c11493b 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/Data/KnownTechInfo.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/Data/KnownTechInfo.cs @@ -1,6 +1,6 @@ using JetBrains.Annotations; -using NaughtyAttributes; using SCHIZO.Helpers; +using TriInspector; using UnityEngine; namespace SCHIZO.Items.Data @@ -11,32 +11,38 @@ public partial class KnownTechInfo : ScriptableObject [SerializeField] private bool hasCustomUnlockMessage; - [SerializeField, Label("Unlock Message"), HideIf(nameof(hasCustomUnlockMessage)), Dropdown(nameof(defaultUnlockMessages)), UsedImplicitly] + [SerializeField, LabelText("Unlock Message"), HideIf(nameof(hasCustomUnlockMessage)), Dropdown(nameof(DefaultUnlockMessages)), UsedImplicitly] private string defaultUnlockMessage; - [SerializeField, Label("Unlock Message"), ShowIf(nameof(hasCustomUnlockMessage)), UsedImplicitly] + [SerializeField, LabelText("Unlock Message"), ShowIf(nameof(hasCustomUnlockMessage)), UsedImplicitly] private string customUnlockMessage; - [SerializeField, UsedImplicitly, Dropdown(nameof(unlockSounds))] + [SerializeField, UsedImplicitly, Dropdown(nameof(UnlockSounds))] private string unlockSound; [SerializeField, Required] public Sprite unlockSprite; [StaticHelpers.Cache] - private static DropdownList defaultUnlockMessages = new DropdownList + private static TriDropdownList DefaultUnlockMessages() { - {"Blueprint Scan", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BlueprintUnlockMessage"}, - {"Blueprint Pickup", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BlueprintPickupMessage"}, - {"Creature Discovered", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:NewCreatureDiscoveredMessage"}, - }; + return new TriDropdownList() + { + {"Blueprint Scan", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BlueprintUnlockMessage"}, + {"Blueprint Pickup", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BlueprintPickupMessage"}, + {"Creature Discovered", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:NewCreatureDiscoveredMessage"}, + }; + } [StaticHelpers.Cache] - private static DropdownList unlockSounds = new DropdownList + private static TriDropdownList UnlockSounds() { - {"Basic", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BasicUnlockSound"}, - {"Blueprint", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BlueprintUnlockSound"}, - {"Creature Discovered", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:NewCreatureDiscoveredSound"}, - }; + return new TriDropdownList() + { + {"Basic", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BasicUnlockSound"}, + {"Blueprint", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:BlueprintUnlockSound"}, + {"Creature Discovered", "Nautilus.Handlers.KnownTechHandler+DefaultUnlockData:NewCreatureDiscoveredSound"}, + }; + } } } diff --git a/Unity/Assets/Scripts/SCHIZO/Items/Data/PDAEncyclopediaInfo.cs b/Unity/Assets/Scripts/SCHIZO/Items/Data/PDAEncyclopediaInfo.cs index 0795e3d5..bcaf07d6 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/Data/PDAEncyclopediaInfo.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/Data/PDAEncyclopediaInfo.cs @@ -1,20 +1,22 @@ -using NaughtyAttributes; -using SCHIZO.Sounds.Collections; +using SCHIZO.Sounds.Collections; +using TriInspector; using UnityEngine; namespace SCHIZO.Items.Data { [CreateAssetMenu(menuName = "SCHIZO/Items/PDA Encyclopedia Info")] + [DeclareBoxGroup("Scanning")] + [DeclareBoxGroup("Databank")] public sealed class PDAEncyclopediaInfo : ScriptableObject { - [BoxGroup("Scanning")] public float scanTime = 3; - [BoxGroup("Scanning")] public Sprite unlockSprite; - [BoxGroup("Scanning")] public bool isImportantUnlock; - [BoxGroup("Scanning")] public SoundCollectionInstance scanSounds; + [Group("Scanning")] public float scanTime = 3; + [Group("Scanning")] public Sprite unlockSprite; + [Group("Scanning")] public bool isImportantUnlock; + [Group("Scanning")] public SoundCollectionInstance scanSounds; - [BoxGroup("Databank")] public string encyPath; - [BoxGroup("Databank")] public string title; - [BoxGroup("Databank")] public Texture2D texture; - [BoxGroup("Databank")] public TextAsset description; + [Group("Databank")] public string encyPath; + [Group("Databank")] public string title; + [Group("Databank")] public Texture2D texture; + [Group("Databank")] public TextAsset description; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Jukebox/CustomJukeboxTrack.cs b/Unity/Assets/Scripts/SCHIZO/Jukebox/CustomJukeboxTrack.cs index bc4d4817..4589df5a 100644 --- a/Unity/Assets/Scripts/SCHIZO/Jukebox/CustomJukeboxTrack.cs +++ b/Unity/Assets/Scripts/SCHIZO/Jukebox/CustomJukeboxTrack.cs @@ -1,12 +1,14 @@ -using NaughtyAttributes; +using TriInspector; using SCHIZO.Registering; using JetBrains.Annotations; -using SCHIZO.Attributes.Visual; +using SCHIZO.Attributes; using UnityEngine; namespace SCHIZO.Jukebox { [CreateAssetMenu(menuName = "SCHIZO/Jukebox/Custom Jukebox Track")] + [DeclareBoxGroup("track", Title = "Track Info")] + [DeclareBoxGroup("unlock", Title = "Unlock")] public sealed partial class CustomJukeboxTrack : ModRegistryItem { private enum Source @@ -15,7 +17,7 @@ private enum Source Internet } - [Careful, Required_string] + [Careful, Required] public string identifier; [SerializeField] @@ -24,40 +26,47 @@ private enum Source [HideIf(nameof(IsRemote))] public AudioClip audioClip; - [ShowIf(nameof(IsRemote)), ValidateInput(nameof(Validate_urlIsHttp), "Must be an HTTP address. HTTPS does not work!"), Label("URL")] + [ShowIf(nameof(IsRemote)), ValidateInput(nameof(Validate_urlIsHttp)), LabelText("URL")] public string url; [ShowIf(nameof(IsRemote))] [Tooltip("Whether to handle the audio like an endless stream, e.g. internet radio.\nIn-game, this will hide duration and disable seeking.")] public bool isStream; - [BoxGroup("Track Info"), ShowIf(nameof(isStream))] + [GroupNext("track")] + + [ShowIf(nameof(isStream))] [Multiline, InfoBox("Use {0} as a placeholder for the track label.\nTextMeshPro rich text tags are supported.")] public string streamLabelFormat; - [BoxGroup("Track Info"), ShowIf(nameof(IsRemote))] + [ShowIf(nameof(IsRemote))] [Tooltip("If not overridden, the remote file or stream's metadata (if any) will be used.")] public bool overrideTrackLabel; - [BoxGroup("Track Info")] public string trackLabel; - [BoxGroup("Unlock")] + [GroupNext("unlock")] + public bool unlockedOnStart = true; - [BoxGroup("Unlock"), HideIf(nameof(unlockedOnStart)), UsedImplicitly] + [HideIf(nameof(unlockedOnStart)), UsedImplicitly] [Tooltip("If not set, the disk will use the base game model.")] public GameObject diskPrefab; - [BoxGroup("Unlock"), HideIf(nameof(unlockedOnStart)), UsedImplicitly] + [HideIf(nameof(unlockedOnStart)), UsedImplicitly] public Vector3 diskSpawnLocation; - [BoxGroup("Unlock"), HideIf(nameof(unlockedOnStart)), UsedImplicitly] + [HideIf(nameof(unlockedOnStart)), UsedImplicitly] public AudioClip unlockSound; public bool IsLocal => source == Source.Asset; public bool IsRemote => source == Source.Internet; - private bool Validate_urlIsHttp() => url.StartsWith("http://"); + private TriValidationResult Validate_urlIsHttp() + { + if (string.IsNullOrEmpty(url)) return TriValidationResult.Error("URL cannot be empty"); + if (!url.StartsWith("http://")) return TriValidationResult.Error("URL must be HTTP (HTTPS will not work)"); + return TriValidationResult.Valid; + } } } diff --git a/Unity/Assets/Scripts/SCHIZO/Loading/FumoLoadingIcon.cs b/Unity/Assets/Scripts/SCHIZO/Loading/FumoLoadingIcon.cs index 421c2e19..66076f1f 100644 --- a/Unity/Assets/Scripts/SCHIZO/Loading/FumoLoadingIcon.cs +++ b/Unity/Assets/Scripts/SCHIZO/Loading/FumoLoadingIcon.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Loading diff --git a/Unity/Assets/Scripts/SCHIZO/Loading/LoadingArtManager.cs b/Unity/Assets/Scripts/SCHIZO/Loading/LoadingArtManager.cs index f1443efb..567986be 100644 --- a/Unity/Assets/Scripts/SCHIZO/Loading/LoadingArtManager.cs +++ b/Unity/Assets/Scripts/SCHIZO/Loading/LoadingArtManager.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Loading diff --git a/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackground.cs b/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackground.cs index 85b4d344..ad83c08e 100644 --- a/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackground.cs +++ b/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackground.cs @@ -1,5 +1,5 @@ -using SCHIZO.Registering; -using SCHIZO.Attributes.Visual; +using SCHIZO.Attributes; +using SCHIZO.Registering; using UnityEngine; namespace SCHIZO.Loading diff --git a/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackgroundCollection.cs b/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackgroundCollection.cs index 3a18d6b8..20364846 100644 --- a/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackgroundCollection.cs +++ b/Unity/Assets/Scripts/SCHIZO/Loading/LoadingBackgroundCollection.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Loading @@ -7,7 +7,7 @@ namespace SCHIZO.Loading [CreateAssetMenu(menuName = "SCHIZO/Loading/Loading Background Collection")] public sealed partial class LoadingBackgroundCollection : ScriptableObject { - [ReorderableList, SerializeField, UsedImplicitly] + [ListDrawerSettings, SerializeField, UsedImplicitly] private LoadingBackground[] backgrounds; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Options/Generic/ConfigurableValue.cs b/Unity/Assets/Scripts/SCHIZO/Options/Generic/ConfigurableValue.cs index 24542ba8..cf60b03d 100644 --- a/Unity/Assets/Scripts/SCHIZO/Options/Generic/ConfigurableValue.cs +++ b/Unity/Assets/Scripts/SCHIZO/Options/Generic/ConfigurableValue.cs @@ -1,14 +1,14 @@ using System; -using NaughtyAttributes; +using TriInspector; namespace SCHIZO.Options.Generic { [Serializable] public abstract partial class ConfigurableValue where TRaw : struct where TModOption : ModOption { - [ShowIf(nameof(ShowIsHardCoded)), AllowNesting] public bool isHardCoded = false; - [ShowIf(nameof(ShowModOption)), Required, AllowNesting] public TModOption modOption; - [ShowIf(nameof(ShowValue)), AllowNesting] public TRaw value; + [ShowIf(nameof(ShowIsHardCoded))] public bool isHardCoded = false; + [ShowIf(nameof(ShowModOption)), Required] public TModOption modOption; + [ShowIf(nameof(ShowValue))] public TRaw value; protected virtual bool ShowIsHardCoded => true; protected virtual bool ShowModOption => !isHardCoded; diff --git a/Unity/Assets/Scripts/SCHIZO/Options/Generic/ModOption.cs b/Unity/Assets/Scripts/SCHIZO/Options/Generic/ModOption.cs index b74c9eb4..7559c791 100644 --- a/Unity/Assets/Scripts/SCHIZO/Options/Generic/ModOption.cs +++ b/Unity/Assets/Scripts/SCHIZO/Options/Generic/ModOption.cs @@ -1,26 +1,28 @@ using System.Collections.Generic; -using NaughtyAttributes; +using SCHIZO.Attributes; using SCHIZO.Options.Bool; -using SCHIZO.Attributes.Visual; +using TriInspector; using UnityEngine; namespace SCHIZO.Options.Generic { + [DeclareBoxGroup("disabling", Title = "Disable Conditions")] public abstract partial class ModOption : ScriptableObject { [Careful] public string id; - [BoxGroup("Disable Conditions"), ReorderableList] public List disableIfAnyTrue; - [BoxGroup("Disable Conditions"), ReorderableList] public List disableIfAnyFalse; + [Group("disabling"), ListDrawerSettings] public List disableIfAnyTrue; + [Group("disabling"), ListDrawerSettings] public List disableIfAnyFalse; } public abstract partial class ModOption : ModOption where TValue : struct { public string label; public TValue defaultValue; - [ResizableTextArea] public string tooltip; + [TextArea(1, 5)] public string tooltip; } + // ReSharper disable once UnusedTypeParameter public abstract partial class ModOption : ModOption where TValue : struct where TUpdater : OptionUpdater { } diff --git a/Unity/Assets/Scripts/SCHIZO/Options/ModOptionPanel.cs b/Unity/Assets/Scripts/SCHIZO/Options/ModOptionPanel.cs index df1d7b96..2749ef31 100644 --- a/Unity/Assets/Scripts/SCHIZO/Options/ModOptionPanel.cs +++ b/Unity/Assets/Scripts/SCHIZO/Options/ModOptionPanel.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; -using NaughtyAttributes; +using JetBrains.Annotations; using SCHIZO.Options.Generic; using SCHIZO.Registering; +using TriInspector; using UnityEngine; namespace SCHIZO.Options @@ -9,7 +10,7 @@ namespace SCHIZO.Options [CreateAssetMenu(menuName = "SCHIZO/Options/Mod Option Panel")] public sealed partial class ModOptionPanel : ModRegistryItem { - [SerializeField, ReorderableList] + [SerializeField, ListDrawerSettings, UsedImplicitly] private List options; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Registering/ComponentAdder.cs b/Unity/Assets/Scripts/SCHIZO/Registering/ComponentAdder.cs index bd05da4b..e61706b0 100644 --- a/Unity/Assets/Scripts/SCHIZO/Registering/ComponentAdder.cs +++ b/Unity/Assets/Scripts/SCHIZO/Registering/ComponentAdder.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Registering @@ -22,7 +22,7 @@ public enum Mode [Tooltip("Used for targets that are already present in the scene by the time this is registered.\nCan be used to inject into e.g. main menu UI.")] private bool scanForExisting; - [SerializeField, Required_string, HideIf(nameof(isSingleton)), UsedImplicitly] + [SerializeField, Required, HideIf(nameof(isSingleton)), UsedImplicitly] private string typeName; [SerializeField, Dropdown(nameof(_methodNames)), HideIf(nameof(isSingleton)), UsedImplicitly] diff --git a/Unity/Assets/Scripts/SCHIZO/Registering/CompoundModRegistryItem.cs b/Unity/Assets/Scripts/SCHIZO/Registering/CompoundModRegistryItem.cs index fd5d5d3e..da113404 100644 --- a/Unity/Assets/Scripts/SCHIZO/Registering/CompoundModRegistryItem.cs +++ b/Unity/Assets/Scripts/SCHIZO/Registering/CompoundModRegistryItem.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NaughtyAttributes; +using TriInspector; using UnityEngine; using UnityEngine.Serialization; @@ -8,7 +8,7 @@ namespace SCHIZO.Registering [CreateAssetMenu(menuName = "SCHIZO/Registering/Compound Mod Registry Item")] public partial class CompoundModRegistryItem : ModRegistryItem { - [FormerlySerializedAs("registered"), ReorderableList] + [FormerlySerializedAs("registered"), ListDrawerSettings] public List registryItems = new List(); } } diff --git a/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistry.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistry.Unity.cs index f8fc0bff..cd44eda9 100644 --- a/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistry.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistry.Unity.cs @@ -1,6 +1,6 @@ using System; using System.Linq; -using NaughtyAttributes; +using TriInspector; using UnityEditor; namespace SCHIZO.Registering diff --git a/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistryItem.cs b/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistryItem.cs index b6a3d802..55e6a959 100644 --- a/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistryItem.cs +++ b/Unity/Assets/Scripts/SCHIZO/Registering/ModRegistryItem.cs @@ -1,8 +1,8 @@ -using SCHIZO.Interop.NaughtyAttributes; +using SCHIZO.TriInspector; namespace SCHIZO.Registering { - public abstract partial class ModRegistryItem : NaughtyScriptableObject + public abstract partial class ModRegistryItem : TriScriptableObject { protected bool IsRegistered { diff --git a/Unity/Assets/Scripts/SCHIZO/SCHIZO.asmdef b/Unity/Assets/Scripts/SCHIZO/SCHIZO.asmdef index a838d645..b527da2a 100644 --- a/Unity/Assets/Scripts/SCHIZO/SCHIZO.asmdef +++ b/Unity/Assets/Scripts/SCHIZO/SCHIZO.asmdef @@ -1,8 +1,8 @@ { "name": "SCHIZO", "references": [ - "GUID:776d03a35f1b52c4a9aed9f56d7b4229", - "GUID:77ccaf49895b0d64e87cd4b4faf83c49" + "GUID:77ccaf49895b0d64e87cd4b4faf83c49", + "GUID:324caed91501a9c47a04ebfd87b68794" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/CombinedSoundCollection.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/CombinedSoundCollection.cs index d224168e..573f3543 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/CombinedSoundCollection.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/CombinedSoundCollection.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Sounds.Collections @@ -8,7 +8,7 @@ namespace SCHIZO.Sounds.Collections [CreateAssetMenu(menuName = "SCHIZO/Sounds/Combined Sound Collection")] public sealed class CombinedSoundCollection : SoundCollection { - [ReorderableList] public List combineWith; + [ListDrawerSettings] public List combineWith; public override IEnumerable GetSounds() => combineWith.SelectMany(s => s.GetSounds()); protected override bool ShowAudioClipList => false; diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.Unity.cs index 1feceb7f..fca98b97 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.Unity.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEditor; namespace SCHIZO.Sounds.Collections diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.cs index 4d946fd3..07d2fb74 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollection.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Sounds.Collections @@ -7,7 +7,7 @@ namespace SCHIZO.Sounds.Collections [CreateAssetMenu(menuName = "SCHIZO/Sounds/Sound Collection")] public partial class SoundCollection : ScriptableObject { - [SerializeField, ReorderableList, ShowIf(nameof(ShowAudioClipList))] private List sounds; + [SerializeField, ListDrawerSettings, ShowIf(nameof(ShowAudioClipList))] private List sounds; public virtual IEnumerable GetSounds() => sounds; protected virtual bool ShowAudioClipList => true; diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.Unity.cs index ec498c6c..8b2cc44f 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.Unity.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEditor; namespace SCHIZO.Sounds.Collections diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.cs index 45650839..da959dfd 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Collections/SoundCollectionInstance.cs @@ -1,10 +1,11 @@ using SCHIZO.Interop.Subnautica; +using TriInspector; namespace SCHIZO.Sounds.Collections { public sealed partial class SoundCollectionInstance : _FMODAsset { - [NaughtyAttributes.ReadOnly] public SoundCollection collection; + [ReadOnly] public SoundCollection collection; public BusPaths bus; } } diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/ItemSounds.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/ItemSounds.cs index bbed126f..dbfff45b 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/ItemSounds.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/ItemSounds.cs @@ -1,11 +1,10 @@ -using SCHIZO.Interop.NaughtyAttributes; -using SCHIZO.Sounds.Collections; +using SCHIZO.Sounds.Collections; using UnityEngine; namespace SCHIZO.Sounds { [CreateAssetMenu(menuName = "SCHIZO/Sounds/Item Sounds")] - public sealed partial class ItemSounds : NaughtyScriptableObject + public sealed partial class ItemSounds : ScriptableObject { public SoundCollectionInstance pickupSounds; public SoundCollectionInstance dropSounds; diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Players/InventoryAmbientSoundPlayer.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Players/InventoryAmbientSoundPlayer.cs index 606b7f51..67c5c363 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Players/InventoryAmbientSoundPlayer.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Players/InventoryAmbientSoundPlayer.cs @@ -1,8 +1,8 @@ using System.Linq; using JetBrains.Annotations; -using NaughtyAttributes; +using SCHIZO.Attributes; using SCHIZO.Options.Float; -using SCHIZO.Attributes.Typing; +using TriInspector; using UnityEngine; namespace SCHIZO.Sounds.Players @@ -19,11 +19,16 @@ public partial class InventoryAmbientSoundPlayer : SoundPlayer [Space] - [SerializeField, ExposedType("Pickupable"), Required, UsedImplicitly, ValidateInput(nameof(Validate_pickupable), "Pickupable component must be on the same GameObject as the sound player!")] + [SerializeField, ExposedType("Pickupable"), Required, UsedImplicitly, ValidateInput(nameof(Validate_pickupable))] private MonoBehaviour pickupable; protected override bool Is3D => false; - private bool Validate_pickupable() => !pickupable || pickupable.GetComponentsInChildren().Contains(this); + private TriValidationResult Validate_pickupable() + { + if (!pickupable) return TriValidationResult.Error("Pickupable is required!"); + if (!pickupable.GetComponentsInChildren().Contains(this)) return TriValidationResult.Error("Pickupable component must be a parent of this sound player!"); + return TriValidationResult.Valid; + } } } diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Players/SoundPlayer.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Players/SoundPlayer.cs index bd20d028..84f0df4c 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Players/SoundPlayer.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Players/SoundPlayer.cs @@ -1,7 +1,7 @@ using JetBrains.Annotations; -using NaughtyAttributes; using SCHIZO.Interop.Subnautica; using SCHIZO.Sounds.Collections; +using TriInspector; using UnityEngine; using UnityEngine.Serialization; diff --git a/Unity/Assets/Scripts/SCHIZO/Sounds/Players/WorldAmbientSoundPlayer.cs b/Unity/Assets/Scripts/SCHIZO/Sounds/Players/WorldAmbientSoundPlayer.cs index 03db1b92..5677e31e 100644 --- a/Unity/Assets/Scripts/SCHIZO/Sounds/Players/WorldAmbientSoundPlayer.cs +++ b/Unity/Assets/Scripts/SCHIZO/Sounds/Players/WorldAmbientSoundPlayer.cs @@ -1,6 +1,6 @@ using JetBrains.Annotations; +using SCHIZO.Attributes; using SCHIZO.Options.Float; -using SCHIZO.Attributes.Typing; using UnityEngine; namespace SCHIZO.Sounds.Players diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector.meta b/Unity/Assets/Scripts/SCHIZO/TriInspector.meta new file mode 100644 index 00000000..ecdf1fca --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a5ba2e02c8164297a1778fa4c6515df2 +timeCreated: 1699156663 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector/DeclareUnexploredGroupAttribute.cs b/Unity/Assets/Scripts/SCHIZO/TriInspector/DeclareUnexploredGroupAttribute.cs new file mode 100644 index 00000000..37c88bda --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector/DeclareUnexploredGroupAttribute.cs @@ -0,0 +1,19 @@ +using TriInspector; + +namespace SCHIZO.TriInspector +{ + internal class DeclareUnexploredGroupAttribute : DeclareFoldoutGroupAttribute + { + public DeclareUnexploredGroupAttribute(string insideof) : base(insideof + "/unexplored") + { + base.Title = "Unexplored (These fields have not been explored yet and their functionality is unknown)"; + } + + public DeclareUnexploredGroupAttribute() : base("unexplored") + { + base.Title = "Unexplored (These fields have not been explored yet and their functionality is unknown)"; + } + + public new string Title => base.Title; + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector/DeclareUnexploredGroupAttribute.cs.meta b/Unity/Assets/Scripts/SCHIZO/TriInspector/DeclareUnexploredGroupAttribute.cs.meta new file mode 100644 index 00000000..ddd72443 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector/DeclareUnexploredGroupAttribute.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5bd434322fb247b7a1e8fbdce766c556 +timeCreated: 1699160925 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector/TriMonoBehaviour.cs b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriMonoBehaviour.cs new file mode 100644 index 00000000..bfc3a26b --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriMonoBehaviour.cs @@ -0,0 +1,48 @@ +using TriInspector; +using UnityEngine; + +namespace SCHIZO.TriInspector +{ + [DeclareFoldoutGroup("component-references", Title = "Component References")] + [DeclareUnexploredGroup] + public abstract class TriMonoBehaviour : MonoBehaviour + { + private protected class ComponentReferencesGroupAttribute : GroupAttribute + { + public ComponentReferencesGroupAttribute() : base("component-references") + { + } + } + + private protected class ComponentReferencesGroupNextAttribute : GroupNextAttribute + { + public ComponentReferencesGroupNextAttribute() : base("component-references") + { + } + } + + private protected class UnexploredGroupAttribute : GroupAttribute + { + public UnexploredGroupAttribute(string insideof) : base(insideof + "/unexplored") + { + } + + public UnexploredGroupAttribute() : base("unexplored") + { + } + } + + private protected class UnexploredGroupNextAttribute : GroupNextAttribute + { + public UnexploredGroupNextAttribute(string insideof) : base(insideof + "/unexplored") + { + } + + public UnexploredGroupNextAttribute() : base("unexplored") + { + } + } + + // TODO: RequiredAutoFixGetComponent thing + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector/TriMonoBehaviour.cs.meta b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriMonoBehaviour.cs.meta new file mode 100644 index 00000000..984bb0fa --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriMonoBehaviour.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a0f6a00c7ae84c339eb4e35a028cd1e7 +timeCreated: 1699156679 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector/TriScriptableObject.cs b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriScriptableObject.cs new file mode 100644 index 00000000..072cf63a --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriScriptableObject.cs @@ -0,0 +1,30 @@ +using TriInspector; +using UnityEngine; + +namespace SCHIZO.TriInspector +{ + public abstract class TriScriptableObject : ScriptableObject + { + private protected class UnexploredGroupAttribute : GroupAttribute + { + public UnexploredGroupAttribute(string insideof) : base(insideof + "/unexplored") + { + } + + public UnexploredGroupAttribute() : base("unexplored") + { + } + } + + private protected class UnexploredGroupNextAttribute : GroupNextAttribute + { + public UnexploredGroupNextAttribute(string insideof) : base(insideof + "/unexplored") + { + } + + public UnexploredGroupNextAttribute() : base("unexplored") + { + } + } + } +} diff --git a/Unity/Assets/Scripts/SCHIZO/TriInspector/TriScriptableObject.cs.meta b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriScriptableObject.cs.meta new file mode 100644 index 00000000..93ce477b --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/TriInspector/TriScriptableObject.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 99df3c25e6104ab1bec66b20fbb0f2ce +timeCreated: 1699161311 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Tweaks/ErmMoon.cs b/Unity/Assets/Scripts/SCHIZO/Tweaks/ErmMoon.cs index ba3993fd..6adfefdf 100644 --- a/Unity/Assets/Scripts/SCHIZO/Tweaks/ErmMoon.cs +++ b/Unity/Assets/Scripts/SCHIZO/Tweaks/ErmMoon.cs @@ -1,14 +1,19 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEngine; namespace SCHIZO.Tweaks { public sealed partial class ErmMoon : MonoBehaviour { - [SerializeField, Required, ValidateInput(nameof(ValidateErmText), "Erm texture must be readable!"), UsedImplicitly] + [SerializeField, ValidateInput(nameof(ValidateErmText)), UsedImplicitly] private Texture2D ermTexture; - private bool ValidateErmText(Texture2D input) => !input || input.isReadable; + private TriValidationResult ValidateErmText(Texture2D input) + { + if (!input) return TriValidationResult.Error("Texture is required"); + if (!input.isReadable) return TriValidationResult.Error("Texture must be readable"); + return TriValidationResult.Valid; + } } } diff --git a/Unity/Assets/Scripts/SCHIZO/Twitch/TwitchIntegration.cs b/Unity/Assets/Scripts/SCHIZO/Twitch/TwitchIntegration.cs index 44afbf6b..d740675c 100644 --- a/Unity/Assets/Scripts/SCHIZO/Twitch/TwitchIntegration.cs +++ b/Unity/Assets/Scripts/SCHIZO/Twitch/TwitchIntegration.cs @@ -1,16 +1,16 @@ using System.Collections.Generic; -using NaughtyAttributes; -using SCHIZO.Interop.NaughtyAttributes; +using JetBrains.Annotations; +using TriInspector; using UnityEngine; namespace SCHIZO.Twitch { - public sealed partial class TwitchIntegration : NaughyMonoBehaviour + public sealed partial class TwitchIntegration : MonoBehaviour { - [SerializeField, Required_string] private string targetChannel = "vedal987"; - [SerializeField, Required_string] private string commandPrefix = "pls "; - [SerializeField, ShowIf(nameof(prefixIsCaseSensitive_ShowIf))] private bool prefixIsCaseSensitive = false; - [SerializeField, ReorderableList] private List whitelistedUsers = new List { "alexejherodev" }; + [SerializeField, Required, UsedImplicitly] private string targetChannel = "vedal987"; + [SerializeField, Required, UsedImplicitly] private string commandPrefix = "pls "; + [SerializeField, ShowIf(nameof(prefixIsCaseSensitive_ShowIf)), UsedImplicitly] private bool prefixIsCaseSensitive = false; + [SerializeField, ListDrawerSettings, UsedImplicitly] private List whitelistedUsers = new List { "alexejherodev" }; private bool prefixIsCaseSensitive_ShowIf() { diff --git a/Unity/Assets/Scripts/SCHIZO/Utilities/ECCLIBRARY.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Utilities/ECCLIBRARY.Unity.cs deleted file mode 100644 index 9b18e4cb..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Utilities/ECCLIBRARY.Unity.cs +++ /dev/null @@ -1,20 +0,0 @@ -using UnityEngine; - -namespace SCHIZO.Utilities -{ - public static class ECCLIBRARY - { - public static AnimationCurve maxRangeMultiplierCurve = new AnimationCurve(new Keyframe[] - { - new Keyframe(0.0f, 1f, 0.0f, 0.0f, 0.333f, 0.333f), - new Keyframe(0.5f, 0.5f, 0.0f, 0.0f, 0.333f, 0.333f), - new Keyframe(1f, 1f, 0.0f, 0.0f, 0.333f, 0.333f) - }); - - public static AnimationCurve distanceAggressionMultiplierCurve = new AnimationCurve(new Keyframe[] - { - new Keyframe(0.0f, 1f, 0.0f, 0.0f, 0.333f, 0.333f), - new Keyframe(1f, 0.0f, -3f, -3f, 0.333f, 0.333f) - }); - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Utilities/ECCLIBRARY.Unity.cs.meta b/Unity/Assets/Scripts/SCHIZO/Utilities/ECCLIBRARY.Unity.cs.meta deleted file mode 100644 index a19e6f57..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Utilities/ECCLIBRARY.Unity.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: fee0c92b8f8c4dba85d37f86cc9bb6c7 -timeCreated: 1696614557 \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.Unity.cs index 2de15de9..3d5eae15 100644 --- a/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.Unity.cs +++ b/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.Unity.cs @@ -1,5 +1,5 @@ using JetBrains.Annotations; -using NaughtyAttributes; +using TriInspector; using UnityEditor; using UnityEngine; using UnityMeshSimplifier; @@ -9,11 +9,11 @@ namespace SCHIZO.Utilities partial class MeshCombiner { [SerializeField, Required] private GameObject model; - [SerializeField, ReorderableList] private MeshCollider[] meshColliders; + [SerializeField, ListDrawerSettings] private MeshCollider[] meshColliders; [SerializeField] private SimplificationOptions simplificationOptions = SimplificationOptions.Default; [SerializeField, Range(0, 1)] private float quality = 0.1f; - [SerializeField, HideInNormalInspector] private Mesh _combinedMesh; + [SerializeField, HideInInspector] private Mesh _combinedMesh; #if UNITY_EDITOR [Button("Generate Mesh Collider List"), UsedImplicitly] diff --git a/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.cs b/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.cs index 4887698c..75780cb4 100644 --- a/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.cs +++ b/Unity/Assets/Scripts/SCHIZO/Utilities/MeshCombiner.cs @@ -1,10 +1,10 @@ -using SCHIZO.Interop.NaughtyAttributes; +using SCHIZO.TriInspector; using UnityEngine; namespace SCHIZO.Utilities { [CreateAssetMenu(menuName = "SCHIZO/Utilities/Mesh Combiner")] - public sealed partial class MeshCombiner : NaughtyScriptableObject + public sealed partial class MeshCombiner : TriScriptableObject { } } diff --git a/Unity/Assets/Scripts/SCHIZO/Utilities/STRINGS.Unity.cs b/Unity/Assets/Scripts/SCHIZO/Utilities/STRINGS.Unity.cs deleted file mode 100644 index a42bf631..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Utilities/STRINGS.Unity.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace SCHIZO.Utilities -{ - public static class STRINGS - { - public const string COMPONENT_REFERENCES = "Component References"; - public const string UNCHANGED_BY_ECC = "Unchanged By ECC"; - public const string ASSIGNED_AT_RUNTIME = "Assigned At Runtime"; - } -} diff --git a/Unity/Assets/Scripts/SCHIZO/Utilities/STRINGS.Unity.cs.meta b/Unity/Assets/Scripts/SCHIZO/Utilities/STRINGS.Unity.cs.meta deleted file mode 100644 index 33da8d66..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Utilities/STRINGS.Unity.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: e442bfa03afd4b4f985d38bf91473d51 -timeCreated: 1696614302 \ No newline at end of file diff --git a/Unity/Assets/Scripts/Subnautica/AggressionCreatureTrait.cs b/Unity/Assets/Scripts/Subnautica/AggressionCreatureTrait.cs deleted file mode 100644 index c363a322..00000000 --- a/Unity/Assets/Scripts/Subnautica/AggressionCreatureTrait.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -[Serializable] -public class AggressionCreatureTrait : CreatureTrait -{ - public AggressionCreatureTrait(float value, float falloff) : base(value, falloff) - { - } -} diff --git a/Unity/Assets/Scripts/Subnautica/AggressionCreatureTrait.cs.meta b/Unity/Assets/Scripts/Subnautica/AggressionCreatureTrait.cs.meta deleted file mode 100644 index 7f4c909b..00000000 --- a/Unity/Assets/Scripts/Subnautica/AggressionCreatureTrait.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4ece42beaa83410f894c819417d08d18 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: c1fd612b90b20714aa76f9096a6d366e, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/Scripts/Subnautica/AggressiveToPilotingVehicle.cs b/Unity/Assets/Scripts/Subnautica/AggressiveToPilotingVehicle.cs index fc882ddd..32ceb55d 100644 --- a/Unity/Assets/Scripts/Subnautica/AggressiveToPilotingVehicle.cs +++ b/Unity/Assets/Scripts/Subnautica/AggressiveToPilotingVehicle.cs @@ -1,13 +1,15 @@ -using NaughtyAttributes; -using SCHIZO.Interop.Subnautica; -using SCHIZO.Utilities; -using UnityEngine; +using SCHIZO.Interop.Subnautica; +using SCHIZO.TriInspector; +using TriInspector; -public class AggressiveToPilotingVehicle : MonoBehaviour +public class AggressiveToPilotingVehicle : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public LastTarget lastTarget; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public _Creature creature; + [ComponentReferencesGroup, Required] public LastTarget lastTarget; + [ComponentReferencesGroup, Required] public _Creature creature; public float range = 20; public float aggressionPerSecond = 0.5f; public float targetPriority = 1; + + // ReSharper disable once Unity.RedundantEventFunction + private void Start() {} } diff --git a/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeePlayer.cs b/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeePlayer.cs index 4a218232..c8003742 100644 --- a/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeePlayer.cs +++ b/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeePlayer.cs @@ -1,7 +1,9 @@ -using NaughtyAttributes; +using SCHIZO.Interop.Subnautica.Enums; +using TriInspector; public class AggressiveWhenSeePlayer : AggressiveWhenSeeTarget { - [InfoBox("If Target Type is not set to None, other targets will be attacked if the player cannot be attacked.")] - public float playerAttackInterval; + [PropertyOrder(11)] public float playerAttackInterval; + + protected override bool ShowPlayerAttackInfobox() => targetType != EcoTargetType_All.None; } diff --git a/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeeTarget.cs b/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeeTarget.cs index 6c70fd30..508ea4cf 100644 --- a/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeeTarget.cs +++ b/Unity/Assets/Scripts/Subnautica/AggressiveWhenSeeTarget.cs @@ -1,18 +1,19 @@ -using NaughtyAttributes; -using SCHIZO.Interop.Subnautica; +using SCHIZO.Interop.Subnautica; using SCHIZO.Interop.Subnautica.Enums; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -[RequireComponent(typeof (LastTarget))] -[RequireComponent(typeof (CreatureFear))] -public class AggressiveWhenSeeTarget : MonoBehaviour +[RequireComponent(typeof(LastTarget))] +[RequireComponent(typeof(CreatureFear))] +public class AggressiveWhenSeeTarget : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public LastTarget lastTarget; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public _Creature creature; + [ComponentReferencesGroup, Required] public LastTarget lastTarget; + [ComponentReferencesGroup, Required] public _Creature creature; - public AnimationCurve maxRangeMultiplier = ECCLIBRARY.maxRangeMultiplierCurve; - public AnimationCurve distanceAggressionMultiplier = ECCLIBRARY.distanceAggressionMultiplierCurve; + public AnimationCurve maxRangeMultiplier = DefaultMaxRangeMultiplier; + public AnimationCurve distanceAggressionMultiplier = DefaultDistanceAggressionMultiplier; + [InfoBox("If Target Type is not set to None, other targets will be attacked if the player cannot be attacked.", visibleIf: nameof(ShowPlayerAttackInfobox))] public EcoTargetType_All targetType = EcoTargetType_All.Shark; public float aggressionPerSecond = 1; public float maxRangeScalar = 10; @@ -21,8 +22,23 @@ public class AggressiveWhenSeeTarget : MonoBehaviour public float minimumVelocity = 0; public float hungerThreshold = 0; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool ignoreFrozen = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float leashDistance = -1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float targetPriority = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset sightedSound; + [UnexploredGroup] public bool ignoreFrozen = false; + [UnexploredGroup] public float leashDistance = -1; + [UnexploredGroup] public float targetPriority = 1; + [UnexploredGroup] public _FMODAsset sightedSound; + + protected virtual bool ShowPlayerAttackInfobox() => false; + + private static AnimationCurve DefaultMaxRangeMultiplier => new AnimationCurve(new Keyframe[] + { + new Keyframe(0.0f, 1f, 0.0f, 0.0f, 0.333f, 0.333f), + new Keyframe(0.5f, 0.5f, 0.0f, 0.0f, 0.333f, 0.333f), + new Keyframe(1f, 1f, 0.0f, 0.0f, 0.333f, 0.333f) + }); + + private static AnimationCurve DefaultDistanceAggressionMultiplier => new AnimationCurve(new Keyframe[] + { + new Keyframe(0.0f, 1f, 0.0f, 0.0f, 0.333f, 0.333f), + new Keyframe(1f, 0.0f, -3f, -3f, 0.333f, 0.333f) + }); } diff --git a/Unity/Assets/Scripts/Subnautica/AnimateByVelocity.cs b/Unity/Assets/Scripts/Subnautica/AnimateByVelocity.cs index a89da6b3..03b54ad0 100644 --- a/Unity/Assets/Scripts/Subnautica/AnimateByVelocity.cs +++ b/Unity/Assets/Scripts/Subnautica/AnimateByVelocity.cs @@ -1,20 +1,19 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class AnimateByVelocity : MonoBehaviour +public class AnimateByVelocity : TriMonoBehaviour { - [Required] public GameObject rootGameObject; - [Required] public Animator animator; + [ComponentReferencesGroup, Required] public BehaviourLOD levelOfDetail; + [ComponentReferencesGroup, Required] public Animator animator; + [Required, SceneObjectsOnly] public GameObject rootGameObject; public float animationMoveMaxSpeed = 4; public float animationMaxPitch = 30; public float animationMaxTilt = 45; public bool useStrafeAnimation = false; public float dampTime = 0.5f; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public BehaviourLOD levelOfDetail; - // ReSharper disable once Unity.RedundantEventFunction private void OnEnable() {} } diff --git a/Unity/Assets/Scripts/Subnautica/AquariumFish.cs b/Unity/Assets/Scripts/Subnautica/AquariumFish.cs index 7d96a7d0..2757fa41 100644 --- a/Unity/Assets/Scripts/Subnautica/AquariumFish.cs +++ b/Unity/Assets/Scripts/Subnautica/AquariumFish.cs @@ -1,4 +1,4 @@ -using NaughtyAttributes; +using TriInspector; using UnityEngine; public class AquariumFish : MonoBehaviour diff --git a/Unity/Assets/Scripts/Subnautica/AttackCyclops.cs b/Unity/Assets/Scripts/Subnautica/AttackCyclops.cs index 8b188c24..d3f6bcb0 100644 --- a/Unity/Assets/Scripts/Subnautica/AttackCyclops.cs +++ b/Unity/Assets/Scripts/Subnautica/AttackCyclops.cs @@ -1,14 +1,14 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.Interop.Subnautica; +using TriInspector; public class AttackCyclops : CreatureAction { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public LastTarget lastTarget; + [ComponentReferencesGroup, Required] public LastTarget lastTarget; public float aggressPerSecond = 0.5f; public float attackAggressionThreshold = 0.75f; public float attackPause = 5; public float maxDistToLeash = 30; public float swimVelocity = 10; public float swimInterval = 0.8f; - public CreatureTrait aggressiveToNoise = new CreatureTrait(0, 0.06f); + public _CreatureTrait aggressiveToNoise = new _CreatureTrait(0, 0.06f); } diff --git a/Unity/Assets/Scripts/Subnautica/AttackLastTarget.cs b/Unity/Assets/Scripts/Subnautica/AttackLastTarget.cs index 0201400e..b29495b2 100644 --- a/Unity/Assets/Scripts/Subnautica/AttackLastTarget.cs +++ b/Unity/Assets/Scripts/Subnautica/AttackLastTarget.cs @@ -1,12 +1,12 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.Interop.Subnautica; +using TriInspector; using UnityEngine; [RequireComponent(typeof(LastTarget))] [RequireComponent(typeof(SwimBehaviour))] public class AttackLastTarget : CreatureAction { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public LastTarget lastTarget; + [ComponentReferencesGroup, Required] public LastTarget lastTarget; public float swimVelocity = 10; public float aggressionThreshold = 0.75f; @@ -16,13 +16,13 @@ public class AttackLastTarget : CreatureAction public bool resetAggressionOnTime = true; public float rememberTargetTime = 5; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float swimInterval = 0.8f; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float swimIntoPlayerViewMinDistance = 0; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool ignoreAboveWaterTargets = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool ignoreUnderWaterTargets = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool predictTargetMovement = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool attackStartRoar = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset _attackStartSound; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset _attackLoopSound; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset _attackStartFXcontrol; + [UnexploredGroup] public float swimInterval = 0.8f; + [UnexploredGroup] public float swimIntoPlayerViewMinDistance = 0; + [UnexploredGroup] public bool ignoreAboveWaterTargets = false; + [UnexploredGroup] public bool ignoreUnderWaterTargets = false; + [UnexploredGroup] public bool predictTargetMovement = false; + [UnexploredGroup] public bool attackStartRoar = false; + [UnexploredGroup] public _FMODAsset attackStartSound; + [UnexploredGroup] public _FMODAsset attackLoopSound; + [UnexploredGroup] public _FMODAsset attackStartFXcontrol; } diff --git a/Unity/Assets/Scripts/Subnautica/AvoidObstacles.cs b/Unity/Assets/Scripts/Subnautica/AvoidObstacles.cs index 5e280485..a507b4b2 100644 --- a/Unity/Assets/Scripts/Subnautica/AvoidObstacles.cs +++ b/Unity/Assets/Scripts/Subnautica/AvoidObstacles.cs @@ -1,11 +1,9 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; -using UnityEngine; +using UnityEngine; [RequireComponent(typeof(SwimBehaviour))] public class AvoidObstacles : CreatureAction { - [Foldout(STRINGS.COMPONENT_REFERENCES)] public LastTarget lastTarget; + [ComponentReferencesGroup] public LastTarget lastTarget; public bool avoidTerrainOnly = true; public float avoidanceIterations = 10; diff --git a/Unity/Assets/Scripts/Subnautica/Constructable.cs b/Unity/Assets/Scripts/Subnautica/Constructable.cs index 38f0f4e4..078d086c 100644 --- a/Unity/Assets/Scripts/Subnautica/Constructable.cs +++ b/Unity/Assets/Scripts/Subnautica/Constructable.cs @@ -1,5 +1,4 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using TriInspector; using UnityEngine; public class Constructable : HandTarget @@ -17,19 +16,19 @@ public class Constructable : HandTarget public bool rotationEnabled = false; public VFXSurfaceTypes surfaceType; - [Foldout("Unchanged by Nautilus")] public bool controlModelState = true; - [Foldout("Unchanged by Nautilus")] public MonoBehaviour[] controlledBehaviours; - [Foldout("Unchanged by Nautilus")] public bool deconstructionAllowed = true; - [Foldout("Unchanged by Nautilus")] public bool alignWithSurface = false; - [Foldout("Unchanged by Nautilus")] public bool forceUpright = false; - [Foldout("Unchanged by Nautilus")] public bool attachedToBase = false; - [Foldout("Unchanged by Nautilus")] public float placeMaxDistance = 5; - [Foldout("Unchanged by Nautilus")] public float placeMinDistance = 1.2f; - [Foldout("Unchanged by Nautilus")] public float placeDefaultDistance = 2; - [Foldout("Unchanged by Nautilus")] public GameObject builtBoxFX; + [UnexploredGroup] public bool controlModelState = true; + [UnexploredGroup] public MonoBehaviour[] controlledBehaviours; + [UnexploredGroup] public bool deconstructionAllowed = true; + [UnexploredGroup] public bool alignWithSurface = false; + [UnexploredGroup] public bool forceUpright = false; + [UnexploredGroup] public bool attachedToBase = false; + [UnexploredGroup] public float placeMaxDistance = 5; + [UnexploredGroup] public float placeMinDistance = 1.2f; + [UnexploredGroup] public float placeDefaultDistance = 2; + [UnexploredGroup] public GameObject builtBoxFX; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Object _techType; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Material ghostMaterial; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Texture _EmissiveTex; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Texture _NoiseTex; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public TechType_All techType; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Material ghostMaterial; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Texture EmissiveTex; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public Texture NoiseTex; } diff --git a/Unity/Assets/Scripts/Subnautica/CreatureDeath.cs b/Unity/Assets/Scripts/Subnautica/CreatureDeath.cs index 12c4828d..808b28ef 100644 --- a/Unity/Assets/Scripts/Subnautica/CreatureDeath.cs +++ b/Unity/Assets/Scripts/Subnautica/CreatureDeath.cs @@ -1,21 +1,20 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; [RequireComponent(typeof(Rigidbody))] [DisallowMultipleComponent] -public class CreatureDeath : MonoBehaviour +public class CreatureDeath : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public LiveMixin liveMixin; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody useRigidbody; - [Foldout(STRINGS.COMPONENT_REFERENCES)] public Eatable eatable; + [ComponentReferencesGroup, Required] public LiveMixin liveMixin; + [ComponentReferencesGroup, Required] public Rigidbody useRigidbody; + [ComponentReferencesGroup] public Eatable eatable; public float removeCorpseAfterSeconds = -1; public bool respawn = true; [ShowIf(nameof(respawn))] public bool respawnOnlyIfKilledByCreature = false; [ShowIf(nameof(respawn))] public float respawnInterval = 300; + public bool sink = true; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject respawnerPrefab; - - [HideInInspector] public bool sink = true; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject respawnerPrefab; } diff --git a/Unity/Assets/Scripts/Subnautica/CreatureFlinch.cs b/Unity/Assets/Scripts/Subnautica/CreatureFlinch.cs index 9c152ff9..d6c057c0 100644 --- a/Unity/Assets/Scripts/Subnautica/CreatureFlinch.cs +++ b/Unity/Assets/Scripts/Subnautica/CreatureFlinch.cs @@ -1,9 +1,10 @@ -using NaughtyAttributes; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class CreatureFlinch : MonoBehaviour +public class CreatureFlinch : TriMonoBehaviour { - [Required] public Animator animator; + [ComponentReferencesGroup, Required] public Animator animator; public float interval = 1; public float damageThreshold = 10; diff --git a/Unity/Assets/Scripts/Subnautica/CreatureTrait.cs b/Unity/Assets/Scripts/Subnautica/CreatureTrait.cs deleted file mode 100644 index f1ae5133..00000000 --- a/Unity/Assets/Scripts/Subnautica/CreatureTrait.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -[Serializable] -public class CreatureTrait -{ - public float value; - public float falloff; - - public CreatureTrait(float value, float falloff) - { - this.value = value; - this.falloff = falloff; - } -} diff --git a/Unity/Assets/Scripts/Subnautica/CreatureTrait.cs.meta b/Unity/Assets/Scripts/Subnautica/CreatureTrait.cs.meta deleted file mode 100644 index f2a10c24..00000000 --- a/Unity/Assets/Scripts/Subnautica/CreatureTrait.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 06a1c11d1e024e63af08a10550b7ef03 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: c1fd612b90b20714aa76f9096a6d366e, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/Scripts/Subnautica/DeadAnimationOnEnable.cs b/Unity/Assets/Scripts/Subnautica/DeadAnimationOnEnable.cs index 2311fc6b..8d1b4d36 100644 --- a/Unity/Assets/Scripts/Subnautica/DeadAnimationOnEnable.cs +++ b/Unity/Assets/Scripts/Subnautica/DeadAnimationOnEnable.cs @@ -1,10 +1,10 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class DeadAnimationOnEnable : MonoBehaviour +public class DeadAnimationOnEnable : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public LiveMixin liveMixin; + [ComponentReferencesGroup, Required] public LiveMixin liveMixin; [Required] public Animator animator; public bool disableAnimatorInstead; diff --git a/Unity/Assets/Scripts/Subnautica/Eatable.cs b/Unity/Assets/Scripts/Subnautica/Eatable.cs index ac7a88d0..93530239 100644 --- a/Unity/Assets/Scripts/Subnautica/Eatable.cs +++ b/Unity/Assets/Scripts/Subnautica/Eatable.cs @@ -1,18 +1,21 @@ -using NaughtyAttributes; +using TriInspector; using UnityEngine; +[DeclareBoxGroup("Nutrition")] +[DeclareToggleGroup("Decomposes")] public class Eatable : MonoBehaviour { - [BoxGroup("Nutrition")] public float foodValue; - [BoxGroup("Nutrition")] public float waterValue; - [BoxGroup("Nutrition"), Label("Health Value (BZ only)")] public float healthValue; - [BoxGroup("Nutrition"), Label("Cold Meter Value (BZ only)")] public float coldMeterValue; + [Group("Nutrition")] public float foodValue; + [Group("Nutrition")] public float waterValue; + [Title("BZ only")] + [Group("Nutrition")] public float healthValue; + [Group("Nutrition")] public float coldMeterValue; - [BoxGroup("Decomposing")] public bool decomposes = false; - [BoxGroup("Decomposing"), ShowIf(nameof(decomposes))] public float kDecayRate = 0.015f; + [Group("Decomposes")] public bool decomposes = false; + [Group("Decomposes")] public float kDecayRate = 0.015f; [InfoBox("Only rotten food can despawn")] - [BoxGroup("Decomposing"), ShowIf(nameof(decomposes))] public bool despawns = true; - [BoxGroup("Decomposing"), ShowIf(EConditionOperator.And, nameof(decomposes), nameof(despawns))] public float despawnDelay = 300; + [Group("Decomposes")] public bool despawns = true; + [Group("Decomposes"), ShowIf(nameof(despawns))] public float despawnDelay = 300; [HideInInspector] public bool removeOnUse = true; [HideInInspector] public int charges = -1; diff --git a/Unity/Assets/Scripts/Subnautica/FMOD_CustomLoopingEmitter.cs b/Unity/Assets/Scripts/Subnautica/FMOD_CustomLoopingEmitter.cs index f48a2aa4..609a7804 100644 --- a/Unity/Assets/Scripts/Subnautica/FMOD_CustomLoopingEmitter.cs +++ b/Unity/Assets/Scripts/Subnautica/FMOD_CustomLoopingEmitter.cs @@ -1,6 +1,8 @@ -public class FMOD_CustomLoopingEmitter : FMOD_CustomEmitter +using SCHIZO.Interop.Subnautica; + +public class FMOD_CustomLoopingEmitter : FMOD_CustomEmitter { - public FMODAsset assetStart; - public FMODAsset assetStop; + public _FMODAsset assetStart; + public _FMODAsset assetStop; public float stopSoundInterval; } diff --git a/Unity/Assets/Scripts/Subnautica/FleeOnDamage.cs b/Unity/Assets/Scripts/Subnautica/FleeOnDamage.cs index e5ae3e8f..f9422fff 100644 --- a/Unity/Assets/Scripts/Subnautica/FleeOnDamage.cs +++ b/Unity/Assets/Scripts/Subnautica/FleeOnDamage.cs @@ -1,6 +1,4 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; -using UnityEngine; +using UnityEngine; [RequireComponent(typeof(SwimBehaviour))] public class FleeOnDamage : CreatureAction @@ -11,5 +9,5 @@ public class FleeOnDamage : CreatureAction public float swimVelocity = 10; public float swimInterval = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool breakLeash = true; + [UnexploredGroup] public bool breakLeash = true; } diff --git a/Unity/Assets/Scripts/Subnautica/FleeWhenScared.cs b/Unity/Assets/Scripts/Subnautica/FleeWhenScared.cs index d9fe00ca..6265c1bf 100644 --- a/Unity/Assets/Scripts/Subnautica/FleeWhenScared.cs +++ b/Unity/Assets/Scripts/Subnautica/FleeWhenScared.cs @@ -1,12 +1,12 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.Interop.Subnautica; +using TriInspector; using UnityEngine; [RequireComponent(typeof(SwimBehaviour))] [RequireComponent(typeof(CreatureFear))] public class FleeWhenScared : CreatureAction { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public CreatureFear creatureFear; + [ComponentReferencesGroup, Required] public CreatureFear creatureFear; public float swimVelocity = 10; public float swimInterval = 1; @@ -15,9 +15,9 @@ public class FleeWhenScared : CreatureAction public float swimTiredness = 0.2f; public float tiredVelocity = 3; - public CreatureTrait exhausted = new CreatureTrait(0, 0.05f); + public _CreatureTrait exhausted = new _CreatureTrait(0, 0.05f); public float swimExhaustion = 0.25f; public float exhaustedVelocity = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset scaredSound; + [UnexploredGroup] public _FMODAsset scaredSound; } diff --git a/Unity/Assets/Scripts/Subnautica/HandTarget.cs b/Unity/Assets/Scripts/Subnautica/HandTarget.cs index c5cf5d63..cb78889c 100644 --- a/Unity/Assets/Scripts/Subnautica/HandTarget.cs +++ b/Unity/Assets/Scripts/Subnautica/HandTarget.cs @@ -1,5 +1,5 @@ -using UnityEngine; +using SCHIZO.TriInspector; -public class HandTarget : MonoBehaviour +public class HandTarget : TriMonoBehaviour { } diff --git a/Unity/Assets/Scripts/Subnautica/LiveMixin.cs b/Unity/Assets/Scripts/Subnautica/LiveMixin.cs index 9a1f2fe8..640c41fb 100644 --- a/Unity/Assets/Scripts/Subnautica/LiveMixin.cs +++ b/Unity/Assets/Scripts/Subnautica/LiveMixin.cs @@ -1,14 +1,13 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; -using UnityEngine; +using SCHIZO.TriInspector; +using TriInspector; -public class LiveMixin : MonoBehaviour +public class LiveMixin : TriMonoBehaviour { - [Required, Expandable] public LiveMixinData data; + [Required, InlineEditor] public LiveMixinData data; public float health; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset damageSound; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset deathSound; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset damageClip; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public FMODAsset deathClip; + [UnexploredGroup] public FMODAsset damageSound; + [UnexploredGroup] public FMODAsset deathSound; + [UnexploredGroup] public FMODAsset damageClip; + [UnexploredGroup] public FMODAsset deathClip; } diff --git a/Unity/Assets/Scripts/Subnautica/LiveMixinData.cs b/Unity/Assets/Scripts/Subnautica/LiveMixinData.cs index 50bb18c0..c885455d 100644 --- a/Unity/Assets/Scripts/Subnautica/LiveMixinData.cs +++ b/Unity/Assets/Scripts/Subnautica/LiveMixinData.cs @@ -1,23 +1,22 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; using UnityEngine; -[CreateAssetMenu(fileName = "LiveMixinData.asset", menuName = "Subnautica/Live Mixin Data")] -public class LiveMixinData : ScriptableObject +[CreateAssetMenu(menuName = "Subnautica/Live Mixin Data")] +public class LiveMixinData : TriScriptableObject { public float maxHealth = 100; public bool passDamageDataOnDeath; public bool broadcastKillOnDeath = true; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool weldable = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool knifeable = true; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool destroyOnDeath = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float minDamageForSound = 0; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float loopEffectBelowPercent = 0; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public GameObject loopingDamageEffect = null; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool canResurrect; + [UnexploredGroup] public bool weldable = false; + [UnexploredGroup] public bool knifeable = true; + [UnexploredGroup] public bool destroyOnDeath = false; + [UnexploredGroup] public float minDamageForSound = 0; + [UnexploredGroup] public float loopEffectBelowPercent = 0; + [UnexploredGroup] public GameObject loopingDamageEffect = null; + [UnexploredGroup] public bool canResurrect; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject damageEffect = null; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject deathEffect = null; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject electricalDamageEffect = null; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject damageEffect = null; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject deathEffect = null; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public GameObject electricalDamageEffect = null; } diff --git a/Unity/Assets/Scripts/Subnautica/Locomotion.cs b/Unity/Assets/Scripts/Subnautica/Locomotion.cs index 85543e7b..d0f4fc9e 100644 --- a/Unity/Assets/Scripts/Subnautica/Locomotion.cs +++ b/Unity/Assets/Scripts/Subnautica/Locomotion.cs @@ -1,11 +1,11 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class Locomotion : MonoBehaviour +public class Locomotion : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public BehaviourLOD levelOfDetail; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody useRigidbody; + [ComponentReferencesGroup, Required] public BehaviourLOD levelOfDetail; + [ComponentReferencesGroup, Required] public Rigidbody useRigidbody; public float maxAcceleration = 10; public float forwardRotationSpeed = 0.6f; @@ -15,6 +15,6 @@ public class Locomotion : MonoBehaviour public bool canWalkOnSurface = false; public bool freezeHorizontalRotation = false; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float maxVelocity = 10; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool rotateToSurfaceNormal = true; + [UnexploredGroup] public float maxVelocity = 10; + [UnexploredGroup] public bool rotateToSurfaceNormal = true; } diff --git a/Unity/Assets/Scripts/Subnautica/MoveOnSurface.cs b/Unity/Assets/Scripts/Subnautica/MoveOnSurface.cs index ea070d80..36717e80 100644 --- a/Unity/Assets/Scripts/Subnautica/MoveOnSurface.cs +++ b/Unity/Assets/Scripts/Subnautica/MoveOnSurface.cs @@ -1,14 +1,13 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using TriInspector; public class MoveOnSurface : CreatureAction { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public OnSurfaceTracker onSurfaceTracker; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public WalkBehaviour walkBehaviour; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public OnSurfaceMovement onSurfaceMovement; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float updateTargetInterval = 5; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float updateTargetRandomInterval = 6; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float moveVelocity = 13; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float moveRadius = 7; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool moveOnWalls; + [ComponentReferencesGroup, Required] public OnSurfaceTracker onSurfaceTracker; + [ComponentReferencesGroup, Required] public WalkBehaviour walkBehaviour; + [ComponentReferencesGroup, Required] public OnSurfaceMovement onSurfaceMovement; + [UnexploredGroup] public float updateTargetInterval = 5; + [UnexploredGroup] public float updateTargetRandomInterval = 6; + [UnexploredGroup] public float moveVelocity = 13; + [UnexploredGroup] public float moveRadius = 7; + [UnexploredGroup] public bool moveOnWalls; } diff --git a/Unity/Assets/Scripts/Subnautica/OnSurfaceMovement.cs b/Unity/Assets/Scripts/Subnautica/OnSurfaceMovement.cs index 45ab74f9..38b60faa 100644 --- a/Unity/Assets/Scripts/Subnautica/OnSurfaceMovement.cs +++ b/Unity/Assets/Scripts/Subnautica/OnSurfaceMovement.cs @@ -1,11 +1,10 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; -using UnityEngine; +using SCHIZO.TriInspector; +using TriInspector; -public class OnSurfaceMovement : MonoBehaviour +public class OnSurfaceMovement : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public OnSurfaceTracker onSurfaceTracker; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Locomotion locomotion; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float targetRange = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float onSurfaceDelay; + [ComponentReferencesGroup, Required] public OnSurfaceTracker onSurfaceTracker; + [ComponentReferencesGroup, Required] public Locomotion locomotion; + [UnexploredGroup] public float targetRange = 1; + [UnexploredGroup] public float onSurfaceDelay; } diff --git a/Unity/Assets/Scripts/Subnautica/OnTouch.cs b/Unity/Assets/Scripts/Subnautica/OnTouch.cs index dc9e1a4b..957b2ba5 100644 --- a/Unity/Assets/Scripts/Subnautica/OnTouch.cs +++ b/Unity/Assets/Scripts/Subnautica/OnTouch.cs @@ -2,7 +2,7 @@ using UnityEngine; using UnityEngine.Events; -[RequireComponent(typeof (Collider))] +[RequireComponent(typeof(Collider))] public class OnTouch : MonoBehaviour { public string tagFilter; diff --git a/Unity/Assets/Scripts/Subnautica/ResourceTracker.cs b/Unity/Assets/Scripts/Subnautica/ResourceTracker.cs index 5d9a1ca2..9e6fab89 100644 --- a/Unity/Assets/Scripts/Subnautica/ResourceTracker.cs +++ b/Unity/Assets/Scripts/Subnautica/ResourceTracker.cs @@ -1,10 +1,10 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class ResourceTracker : MonoBehaviour +public class ResourceTracker : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody rb; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public PrefabIdentifier prefabIdentifier; - [Foldout(STRINGS.COMPONENT_REFERENCES)] public Pickupable pickupable; + [ComponentReferencesGroup, Required] public Rigidbody rb; + [ComponentReferencesGroup, Required] public PrefabIdentifier prefabIdentifier; + [ComponentReferencesGroup] public Pickupable pickupable; } diff --git a/Unity/Assets/Scripts/Subnautica/Scareable.cs b/Unity/Assets/Scripts/Subnautica/Scareable.cs index ff9bc6fe..e842bd9a 100644 --- a/Unity/Assets/Scripts/Subnautica/Scareable.cs +++ b/Unity/Assets/Scripts/Subnautica/Scareable.cs @@ -1,13 +1,13 @@ -using NaughtyAttributes; -using SCHIZO.Interop.Subnautica; +using SCHIZO.Interop.Subnautica; using SCHIZO.Interop.Subnautica.Enums; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class Scareable : MonoBehaviour +public class Scareable : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public CreatureFear creatureFear; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public _Creature creature; + [ComponentReferencesGroup, Required] public CreatureFear creatureFear; + [ComponentReferencesGroup, Required] public _Creature creature; public EcoTargetType_All targetType = EcoTargetType_All.Shark; public CreatureAction fleeAction; @@ -17,5 +17,5 @@ public class Scareable : MonoBehaviour public float updateTargetInterval = 1; public float updateRange = 100; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public AnimationCurve daynightRangeMultiplier; + [UnexploredGroup] public AnimationCurve daynightRangeMultiplier; } diff --git a/Unity/Assets/Scripts/Subnautica/SoundOnDamage.cs b/Unity/Assets/Scripts/Subnautica/SoundOnDamage.cs index 9ebde4ef..ab964672 100644 --- a/Unity/Assets/Scripts/Subnautica/SoundOnDamage.cs +++ b/Unity/Assets/Scripts/Subnautica/SoundOnDamage.cs @@ -1,10 +1,12 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using TriInspector; using UnityEngine; +// Note: this class is only used to provide the collision sound that plays when ramming into a fish with a seamoth or another vehicle +// currently there is no functionality for any other types of damage public class SoundOnDamage : MonoBehaviour { + [ReadOnly] public DamageType damageType = DamageType.Collide; - [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public FMODAsset sound; + // [Foldout(STRINGS.ASSIGNED_AT_RUNTIME), ReadOnly] public FMODAsset sound; } diff --git a/Unity/Assets/Scripts/Subnautica/SplineFollowing.cs b/Unity/Assets/Scripts/Subnautica/SplineFollowing.cs index 1733b6c9..aee5cd22 100644 --- a/Unity/Assets/Scripts/Subnautica/SplineFollowing.cs +++ b/Unity/Assets/Scripts/Subnautica/SplineFollowing.cs @@ -1,16 +1,16 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class SplineFollowing : MonoBehaviour +public class SplineFollowing : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Locomotion locomotion; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody useRigidbody; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public BehaviourLOD levelOfDetail; + [ComponentReferencesGroup, Required] public Locomotion locomotion; + [ComponentReferencesGroup, Required] public Rigidbody useRigidbody; + [ComponentReferencesGroup, Required] public BehaviourLOD levelOfDetail; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float targetRange = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public float lookAhead = 1; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public bool respectLOD = true; + [UnexploredGroup] public float targetRange = 1; + [UnexploredGroup] public float lookAhead = 1; + [UnexploredGroup] public bool respectLOD = true; [HideInInspector] public float inertia = 1; } diff --git a/Unity/Assets/Scripts/Subnautica/StayAtLeashPosition.cs b/Unity/Assets/Scripts/Subnautica/StayAtLeashPosition.cs index 994fcf6b..73a8478e 100644 --- a/Unity/Assets/Scripts/Subnautica/StayAtLeashPosition.cs +++ b/Unity/Assets/Scripts/Subnautica/StayAtLeashPosition.cs @@ -1,6 +1,4 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; -using UnityEngine; +using UnityEngine; [RequireComponent(typeof(SwimBehaviour))] public class StayAtLeashPosition : CreatureAction @@ -10,5 +8,5 @@ public class StayAtLeashPosition : CreatureAction public float swimInterval = 1; public float minSwimDuration = 3; - [Foldout(STRINGS.UNCHANGED_BY_ECC)] public Vector3 directionDistanceMultiplier = Vector3.one; + [UnexploredGroup] public Vector3 directionDistanceMultiplier = Vector3.one; } diff --git a/Unity/Assets/Scripts/Subnautica/SwimBehaviour.cs b/Unity/Assets/Scripts/Subnautica/SwimBehaviour.cs index 8810bc10..04dbef72 100644 --- a/Unity/Assets/Scripts/Subnautica/SwimBehaviour.cs +++ b/Unity/Assets/Scripts/Subnautica/SwimBehaviour.cs @@ -1,10 +1,10 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class SwimBehaviour : MonoBehaviour +public class SwimBehaviour : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public SplineFollowing splineFollowing; + [ComponentReferencesGroup, Required] public SplineFollowing splineFollowing; [Range(0.0f, 1f)] public float turnSpeed = 1; } diff --git a/Unity/Assets/Scripts/Subnautica/TrailManager.cs b/Unity/Assets/Scripts/Subnautica/TrailManager.cs index 3b268012..73b7910b 100644 --- a/Unity/Assets/Scripts/Subnautica/TrailManager.cs +++ b/Unity/Assets/Scripts/Subnautica/TrailManager.cs @@ -1,11 +1,12 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class TrailManager : MonoBehaviour +public class TrailManager : TriMonoBehaviour { - [Required] public Transform rootTransform; + [ComponentReferencesGroup, Required] public BehaviourLOD levelOfDetail; + [Required] public Transform rootTransform; public Transform rootSegment; public Transform[] trails; public AnimationCurve pitchMultiplier; @@ -14,6 +15,4 @@ public class TrailManager : MonoBehaviour public float segmentSnapSpeed; public float maxSegmentOffset; public bool allowDisableOnScreen; - - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public BehaviourLOD levelOfDetail; } diff --git a/Unity/Assets/Scripts/Subnautica/VFXFabricating.cs b/Unity/Assets/Scripts/Subnautica/VFXFabricating.cs index 3087c94f..4016c2d8 100644 --- a/Unity/Assets/Scripts/Subnautica/VFXFabricating.cs +++ b/Unity/Assets/Scripts/Subnautica/VFXFabricating.cs @@ -12,7 +12,7 @@ public class VFXFabricating : MonoBehaviour [SerializeField, HideInInspector] private Mesh _fabricatorMesh; [SerializeField, HideInInspector] private Transform _fabricatorPrefab; - [SerializeField, HideInInspector] private string _spawnPointPath = "submarine_fabricator_01/printBed/spawnPoint"; + private const string _spawnPointPath = "submarine_fabricator_01/printBed/spawnPoint"; // ReSharper disable once Unity.RedundantEventFunction private void OnEnable() {} diff --git a/Unity/Assets/Scripts/Subnautica/WalkBehaviour.cs b/Unity/Assets/Scripts/Subnautica/WalkBehaviour.cs index 4c5a2f83..8539065d 100644 --- a/Unity/Assets/Scripts/Subnautica/WalkBehaviour.cs +++ b/Unity/Assets/Scripts/Subnautica/WalkBehaviour.cs @@ -1,11 +1,10 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using TriInspector; using UnityEngine; [RequireComponent(typeof(OnSurfaceMovement))] public class WalkBehaviour : SwimBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public OnSurfaceTracker onSurfaceTracker; - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public OnSurfaceMovement onSurfaceMovement; + [ComponentReferencesGroup, Required] public OnSurfaceTracker onSurfaceTracker; + [ComponentReferencesGroup, Required] public OnSurfaceMovement onSurfaceMovement; public bool allowSwimming; } diff --git a/Unity/Assets/Scripts/Subnautica/WorldForces.cs b/Unity/Assets/Scripts/Subnautica/WorldForces.cs index 11901875..58d23e15 100644 --- a/Unity/Assets/Scripts/Subnautica/WorldForces.cs +++ b/Unity/Assets/Scripts/Subnautica/WorldForces.cs @@ -1,21 +1,24 @@ -using NaughtyAttributes; -using SCHIZO.Utilities; +using SCHIZO.TriInspector; +using TriInspector; using UnityEngine; -public class WorldForces : MonoBehaviour +[DeclareToggleGroup("gravity", Title = "Gravity")] +[DeclareToggleGroup("drag", Title = "Drag")] +[DeclareToggleGroup("wind", Title = "Wind (BZ only)")] +public class WorldForces : TriMonoBehaviour { - [Foldout(STRINGS.COMPONENT_REFERENCES), Required] public Rigidbody useRigidbody; + [ComponentReferencesGroup, Required] public Rigidbody useRigidbody; public bool moveWithPlatform; - [BoxGroup("Gravity")] public bool handleGravity = true; - [BoxGroup("Gravity"), ShowIf(nameof(handleGravity))] public float aboveWaterGravity = 9.81f; - [BoxGroup("Gravity"), ShowIf(nameof(handleGravity))] public float underwaterGravity = 0.0f; + [Group("gravity")] public bool handleGravity = true; + [Group("gravity")] public float aboveWaterGravity = 9.81f; + [Group("gravity")] public float underwaterGravity = 0.0f; - [BoxGroup("Drag")] public bool handleDrag = true; - [BoxGroup("Drag"), ShowIf(nameof(handleDrag))] public float aboveWaterDrag = 0.0f; // Base-game default: 0.1f - [BoxGroup("Drag"), ShowIf(nameof(handleDrag))] public float underwaterDrag = 0.1f; // Base-game default: 1.0f + [Group("drag")] public bool handleDrag = true; + [Group("drag")] public float aboveWaterDrag = 0.0f; // Base-game default: 0.1f + [Group("drag")] public float underwaterDrag = 0.1f; // Base-game default: 1.0f - [BoxGroup("Wind (BZ only)")] public bool handleWind = false; - [BoxGroup("Wind (BZ only)"), ShowIf(nameof(handleWind))] public float windScalar = 1f; + [Group("wind")] public bool handleWind = false; + [Group("wind")] public float windScalar = 1f; } diff --git a/Unity/Packages/Tri-Inspector b/Unity/Packages/Tri-Inspector new file mode 160000 index 00000000..91e56c6c --- /dev/null +++ b/Unity/Packages/Tri-Inspector @@ -0,0 +1 @@ +Subproject commit 91e56c6c0646cde585442ee2d07523a59c10ffbd diff --git a/Unity/Packages/manifest.json b/Unity/Packages/manifest.json index edf5c341..d595cee3 100644 --- a/Unity/Packages/manifest.json +++ b/Unity/Packages/manifest.json @@ -1,12 +1,12 @@ { "dependencies": { "com.coffee.csharp-compiler-settings": "https://github.com/mob-sakai/CSharpCompilerSettingsForUnity.git", - "com.dbrizov.naughtyattributes": "https://github.com/dbrizov/NaughtyAttributes.git#upm", "com.unity.2d.sprite": "1.0.0", "com.unity.assetbundlebrowser": "https://github.com/Unity-Technologies/AssetBundles-Browser.git", "com.unity.ide.rider": "1.2.1", - "com.unity.ide.visualstudio": "2.0.21", + "com.unity.ide.visualstudio": "2.0.22", "com.unity.ide.vscode": "1.2.5", + "com.unity.localization": "https://github.com/codewriter-packages/Unity-Localization-Stub-for-Tri-Inspector.git", "com.unity.ugui": "1.0.0", "com.whinarn.unitymeshsimplifier": "https://github.com/Whinarn/UnityMeshSimplifier.git", "com.unity.modules.animation": "1.0.0", diff --git a/Unity/Packages/packages-lock.json b/Unity/Packages/packages-lock.json index e31165d3..2e33d2df 100644 --- a/Unity/Packages/packages-lock.json +++ b/Unity/Packages/packages-lock.json @@ -6,6 +6,14 @@ "source": "embedded", "dependencies": {} }, + "com.codewriter.triinspector": { + "version": "file:Tri-Inspector", + "depth": 0, + "source": "embedded", + "dependencies": { + "com.unity.localization": "1.0.0" + } + }, "com.coffee.csharp-compiler-settings": { "version": "https://github.com/mob-sakai/CSharpCompilerSettingsForUnity.git", "depth": 0, @@ -13,13 +21,6 @@ "dependencies": {}, "hash": "7b73d99d06f565e759c830d1974430feee014b86" }, - "com.dbrizov.naughtyattributes": { - "version": "https://github.com/dbrizov/NaughtyAttributes.git#upm", - "depth": 0, - "source": "git", - "dependencies": {}, - "hash": "8a8fa5a9659a6d63f196391c71e06c4286c8acd7" - }, "com.unity.2d.sprite": { "version": "1.0.0", "depth": 0, @@ -50,7 +51,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.21", + "version": "2.0.22", "depth": 0, "source": "registry", "dependencies": { @@ -65,6 +66,13 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.localization": { + "version": "https://github.com/codewriter-packages/Unity-Localization-Stub-for-Tri-Inspector.git", + "depth": 0, + "source": "git", + "dependencies": {}, + "hash": "184244fa1721e8e5da6aff2aca29b92f0a1e5ec7" + }, "com.unity.test-framework": { "version": "1.1.30", "depth": 1,