Autowrited.cs 705 B

12345678910111213141516171819202122232425
  1. using System;
  2. using UnityEngine;
  3. namespace Rokid.UXR
  4. {
  5. /// <summary>
  6. /// 自动注入特性,name 为空则使用字段名匹配,需要配合AutoInjectComponent 或 基础AutoInjectBehaviour 使用
  7. /// Tip1: 字符串匹配不区分大小写
  8. /// Tip2: 字段为空的情况下才会激活自动注入的匹配
  9. /// </summary>
  10. [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)]
  11. public class Autowrited : PropertyAttribute
  12. {
  13. public readonly string targertObjName;
  14. public Autowrited(string targetObjName)
  15. {
  16. this.targertObjName = targetObjName;
  17. }
  18. public Autowrited()
  19. {
  20. }
  21. }
  22. }