Esempio n. 1
0
        /// <summary>
        /// 绑定单个节点
        /// </summary>
        /// <param name="transform"></param>
        /// <param name="value"></param>
        private void BindChild(Transform transform, object value)
        {
            var props = value as APropsBase;

            if (props == null)
            {
                Debug.LogError("类型不是props:" + value.GetType().Name);
                return;
            }

            UFlux.SetComponentProps(transform, props);
        }
Esempio n. 2
0
        /// <summary>
        /// 绑定多个节点
        /// </summary>
        /// <param name="transform"></param>
        /// <param name="value">Value必须为集合类型</param>
        private void BindChildren(Transform transform, object value)
        {
            IPropsList propsList = value as IPropsList;

            if (!propsList.IsChanged)
            {
                return;
            }

            //绑定子节点
            propsList.Foreach((idx, props) =>
            {
                if (idx < transform.childCount)
                {
                    UFlux.SetComponentProps(transform.GetChild(idx), props);
                }
            });
        }
Esempio n. 3
0
 /// <summary>
 /// 提交状态
 /// </summary>
 protected void CommitProps()
 {
     UFlux.SetComponentProps(this.Transform, this.Props);
 }