0.2.0: Moved into inspector drawer from module.toolbox to module.inspector

This commit is contained in:
Anders Ejlersen 2021-09-18 15:48:14 +02:00
parent 5671c2c754
commit ffec2abdf4
227 changed files with 5306 additions and 29 deletions

View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class EnumFlag : DrawerPropertyAttribute
{
[Preserve]
public EnumFlag()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7a13196e6dff9404d81a3911bb06cc55
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class FilePath : DrawerPropertyAttribute
{
public readonly bool useAbsolute;
public readonly string extension = "*";
public FilePath(bool useAbsolute = false)
{
this.useAbsolute = useAbsolute;
}
public FilePath(string extension, bool useAbsolute = false)
{
this.extension = extension;
this.useAbsolute = useAbsolute;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8d62b72f20cb29b4f9ba3774c21ea275
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,15 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class FolderPath : DrawerPropertyAttribute
{
public readonly bool useAbsolute;
public FolderPath(bool useAbsolute = false)
{
this.useAbsolute = useAbsolute;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 19f4936da040eda458dad2d7ac69efcb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,48 @@
using System;
using Module.Inspector.Utilities;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class IntToEnum : DrawerPropertyAttribute
{
private Type type;
private readonly string strTypeReplaceWith;
private bool hasTriedFetchReplaceType;
[Preserve]
public IntToEnum(Type type)
{
this.type = type;
hasTriedFetchReplaceType = true;
}
[Preserve]
public IntToEnum(Type type, string strTypeReplaceWith)
{
this.type = type;
this.strTypeReplaceWith = strTypeReplaceWith;
}
public Type GetValidType()
{
if (hasTriedFetchReplaceType)
return type;
#if UNITY_EDITOR
Type replaceType = ReflectionUtility.GetAnyTypeWithName(strTypeReplaceWith);
#else
Type replaceType = null;
#endif
hasTriedFetchReplaceType = true;
if (replaceType != null)
type = replaceType;
return type;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d54a749b500e802439618671a142c976
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class IntToLayer : DrawerPropertyAttribute
{
[Preserve]
public IntToLayer()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 210d910f4eeed444e876bfedd8f6967b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,21 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class MethodButton: DrawerMethodAttribute
{
public readonly string name;
[Preserve]
public MethodButton()
{
}
public MethodButton(string name)
{
this.name = name;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aa939647376a39e4dae0c9e54bba3133
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

43
Runtime/Drawers/Naming.cs Normal file
View file

@ -0,0 +1,43 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class Naming : DrawerPropertyAttribute
{
public enum EPatternType : byte
{
/// <summary>
/// Camel casing: thisIsCamelCasing
/// </summary>
CamelCasing,
/// <summary>
/// Pascal casing: ThisIsPascalCasing
/// </summary>
PascalCasing,
/// <summary>
/// Snake casing: this_is_snake_casing
/// </summary>
SnakeCasing,
/// <summary>
/// Snake casing: THIS_IS_SNAKE_CASING_WITH_ALL_CAPS
/// </summary>
SnakeCasingAllCaps,
/// <summary>
/// Kebab casing: this-is-kebab-casing
/// </summary>
KebabCasing,
/// <summary>
/// Kebab casing: THIS_IS_KEBAB_CASING_WITH_ALL_CAPS
/// </summary>
KebabCasingAllCaps
}
public readonly EPatternType type;
public Naming(EPatternType type)
{
this.type = type;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6f99c4aa6447ed24787b1d125c4ae6bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class Percentage : DrawerPropertyAttribute
{
[Preserve]
public Percentage()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dfe545e7a0cb02148bd45f51f9474a43
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,15 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class PopupFromConst : DrawerPropertyAttribute
{
public readonly Type type;
public PopupFromConst(Type type)
{
this.type = type;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d8559005b0cb44438da12adccfcaa5a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class QuaternionToEuler : DrawerPropertyAttribute
{
[Preserve]
public QuaternionToEuler()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5639ab9888faa7943b8675eb61fa7f1f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class SceneDropdown : DrawerPropertyAttribute
{
[Preserve]
public SceneDropdown()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: adc159b87625ef3468b0877d5c1e88d9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

14
Runtime/Drawers/Slider.cs Normal file
View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class Slider : DrawerPropertyAttribute
{
[Preserve]
public Slider()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ac2ff972f40468140919d5b8706cabff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,15 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class StringToField : DrawerPropertyAttribute
{
public readonly Type type;
public StringToField(Type type)
{
this.type = type;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dbd081def12467742a3bf05946dc5d40
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,15 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class StringToType : DrawerPropertyAttribute
{
public readonly Type assignableFrom;
public StringToType(Type assignableFrom)
{
this.assignableFrom = assignableFrom;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7870b2ad7f2ad67469d6787848cc70de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,14 @@
using System;
using UnityEngine.Scripting;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class UrlGoTo : DrawerPropertyAttribute
{
[Preserve]
public UrlGoTo()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ac9efabc5f0547f43921c2804bb85220
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: