1.8.0: Added AssetsOnly, SceneObjectsOnly, AssignAssetIfNull, AssignComponentIfNull
- Attributes: Added AssetsOnly, SceneObjectsOnly, AssignAssetIfNull, AssignComponentIfNull - Attributes: Replaced AssignIfNull with AssignComponentIfNull
This commit is contained in:
parent
070b82767f
commit
eb19150d98
23 changed files with 302 additions and 73 deletions
39
Runtime/ValueModifiers/AssignAssetIfNullAttribute.cs
Normal file
39
Runtime/ValueModifiers/AssignAssetIfNullAttribute.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Module.Inspector
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class AssignAssetIfNullAttribute : ValueModifierPropertyAttribute
|
||||
{
|
||||
public readonly bool useType;
|
||||
public readonly Type type;
|
||||
public readonly string filter;
|
||||
public readonly string[] searchFolders;
|
||||
|
||||
public AssignAssetIfNullAttribute(string[] searchFolders = null)
|
||||
{
|
||||
this.searchFolders = searchFolders;
|
||||
}
|
||||
|
||||
public AssignAssetIfNullAttribute(string filter, string[] searchFolders = null)
|
||||
{
|
||||
this.filter = filter;
|
||||
this.searchFolders = searchFolders;
|
||||
}
|
||||
|
||||
public AssignAssetIfNullAttribute(Type type, string[] searchFolders = null)
|
||||
{
|
||||
this.type = type;
|
||||
this.searchFolders = searchFolders;
|
||||
useType = true;
|
||||
}
|
||||
|
||||
public AssignAssetIfNullAttribute(Type type, string filter, string[] searchFolders = null)
|
||||
{
|
||||
this.type = type;
|
||||
this.filter = filter;
|
||||
this.searchFolders = searchFolders;
|
||||
useType = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue