Esempio n. 1
0
        public void Init(UIBindRoot root, BaseUIBindContainer parent = null, int arrayIndex = -1)
        {
            this.root = root;

            DataSet container = this.GetContainer(parent, arrayIndex);

            Init(container);
        }
Esempio n. 2
0
        private DataSet GetContainer(BaseUIBindContainer parent = null, int arrayIndex = -1)
        {
            if (parent != null)
            {
                return(parent.GetContainer(arrayIndex));
            }

            return(this.root.BindView);
        }
Esempio n. 3
0
        private void InitBindDatas(Transform transform, BaseUIBindContainer parent = null, int arrayIndex = 0)
        {
            if (transform.GetComponent <UIBindArrayTemplate>() != null)
            {
                return;
            }

            var sNodes = StaticObject <List <BaseUINode> > .Instance;

            transform.GetComponents <BaseUINode>(sNodes);
            foreach (var component in sNodes)
            {
                component.InitOnGroup(root, this, arrayIndex);
            }
            sNodes.Clear();

            //注册数组
            BaseUIBindArray bindArray = transform.GetComponent <BaseUIBindArray>();

            if (bindArray)
            {
                bindArray.Init(this.root, this, arrayIndex);
            }

            //注册Group
            BaseUIBindGroup bindGroup = transform.GetComponent <BaseUIBindGroup>();

            if (bindGroup && bindGroup != this)
            {
                bindGroup.Init(this.root, this, arrayIndex);
                return;
            }

            for (int i = 0; i < transform.childCount; i++)
            {
                InitBindDatas(transform.GetChild(i), parent, arrayIndex);
            }
        }