using System;
namespace EasyInject.Attributes
{
///
/// author: spyn
/// description: 标记在场景一开始就存在的MonoBehaviour上的特性,标明是一个Bean
///
[AttributeUsage(AttributeTargets.Class)]
public class GameObjectBeanAttribute : Attribute
{
public string Name { get; }
public ENameType NameType { get; }
public GameObjectBeanAttribute(string name)
{
Name = name;
NameType = ENameType.Custom;
}
public GameObjectBeanAttribute()
{
Name = string.Empty;
NameType = ENameType.Custom;
}
public GameObjectBeanAttribute(ENameType nameType)
{
NameType = nameType;
}
}
public enum ENameType
{
///
/// 通过自定义名字作为Bean名
///
Custom,
///
/// 通过类名作为Bean名
///
ClassName,
///
/// 通过物体名作为Bean名
///
GameObjectName,
///
/// 通过字段的值作为Bean名
///
FieldValue
}
}