Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 void OnEnable()
 {
     _attribute = target as AttributeAgent;
 }
Example #4
0
 public List <AttributeAgent> CollectAttribute()
 {
     return(AttributeAgent.CollectAttribute(transform));
 }