1.9.5: Modified FilePathAttribute to take RelativeToProjectFolder, RelativeToStreamingFolder and Absolute
This commit is contained in:
parent
764027b615
commit
ea527c9b33
5 changed files with 60 additions and 14 deletions
|
|
@ -5,18 +5,18 @@ namespace Module.Inspector
|
|||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class FilePathAttribute : DrawerPropertyAttribute
|
||||
{
|
||||
public readonly bool useAbsolute;
|
||||
public readonly EFilePathType pathType;
|
||||
public readonly string extension = "*";
|
||||
|
||||
public FilePathAttribute(bool useAbsolute = false)
|
||||
public FilePathAttribute(EFilePathType pathType = EFilePathType.RelativeToProjectFolder)
|
||||
{
|
||||
this.useAbsolute = useAbsolute;
|
||||
this.pathType = pathType;
|
||||
}
|
||||
|
||||
public FilePathAttribute(string extension, bool useAbsolute = false)
|
||||
public FilePathAttribute(string extension, EFilePathType pathType = EFilePathType.RelativeToProjectFolder)
|
||||
{
|
||||
this.extension = extension;
|
||||
this.useAbsolute = useAbsolute;
|
||||
this.pathType = pathType;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Runtime/Enums/EFilePathType.cs
Normal file
9
Runtime/Enums/EFilePathType.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
namespace Module.Inspector
|
||||
{
|
||||
public enum EFilePathType
|
||||
{
|
||||
RelativeToProjectFolder,
|
||||
RelativeToStreamingFolder,
|
||||
Absolute
|
||||
}
|
||||
}
|
||||
3
Runtime/Enums/EFilePathType.cs.meta
Normal file
3
Runtime/Enums/EFilePathType.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7b865edb300f46409da22acb64876969
|
||||
timeCreated: 1725182290
|
||||
Loading…
Add table
Add a link
Reference in a new issue