public ECS_ComponentInfo(Type type) { ComponentNameAttribute cna = type.GetCustomAttribute <ComponentNameAttribute>(); Name = string.Format("{0} ({1})", cna != null ? cna.Name : "未命名", type.FullName); ComponentType = type; IsExist = false; }
private void Awake() { Entity = GetComponent <ECS_Entity>(); Entity.AppendComponent(this); #if UNITY_EDITOR ComponentNameAttribute cna = GetType().GetCustomAttribute <ComponentNameAttribute>(); Name = string.Format("{0} ({1})", cna != null ? cna.Name : "未命名", GetType().FullName); #endif }