public override Container GetContainer(GameObject target) { List <Container> containers = new List <Container> (); List <AttributeAgent> attributes = AttributeAgent.CollectAttribute(gameObject.transform); foreach (AttributeAgent att in attributes) { containers.Add(att.GetContainer(target)); } Arrange p = new Arrange(target, _type, containers, _repeat); return(p); }
public static List <AttributeAgent> CollectAttribute(Transform target) { List <AttributeAgent> attributes = new List <AttributeAgent> (); int cnt = target.childCount; for (int i = 0; i < cnt; ++i) { Transform t = target.GetChild(i); for (int j = 0; j < s_attributeTypes.Length; ++j) { AttributeAgent attribute = t.GetComponent(s_attributeTypes[j]) as AttributeAgent; if (attribute != null) { attributes.Add(attribute); break; } } } return(attributes); }
void OnEnable() { _attribute = target as AttributeAgent; }
public List <AttributeAgent> CollectAttribute() { return(AttributeAgent.CollectAttribute(transform)); }