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
25
Runtime/ValueModifiers/AssignComponentIfNullAttribute.cs
Normal file
25
Runtime/ValueModifiers/AssignComponentIfNullAttribute.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
namespace Module.Inspector
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class AssignComponentIfNullAttribute : ValueModifierPropertyAttribute
|
||||
{
|
||||
public readonly bool includeChildren;
|
||||
public readonly bool useType;
|
||||
public readonly Type type;
|
||||
|
||||
public AssignComponentIfNullAttribute(bool includeChildren = false)
|
||||
{
|
||||
this.includeChildren = includeChildren;
|
||||
useType = false;
|
||||
}
|
||||
|
||||
public AssignComponentIfNullAttribute(Type type, bool includeChildren = false)
|
||||
{
|
||||
this.type = type;
|
||||
this.includeChildren = includeChildren;
|
||||
useType = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue