Esempio n. 1
0
 /// <summary>
 ///  提交状态 刷新
 /// </summary>
 /// <param name="transform">不为null,则指定一个Transform刷新.不然则刷新当前Window.Transform</param>
 protected void CommitProps(Transform transform = null)
 {
     if (transform)
     {
         UFluxUtils.SetComponentProps(transform, this.Props);
     }
     else
     {
         UFluxUtils.SetComponentProps(this.Transform, this.Props);
     }
 }
Esempio n. 2
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;
            }

            UFluxUtils.SetComponentProps(transform, props);
        }
Esempio n. 3
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)
                {
                    UFluxUtils.SetComponentProps(transform.GetChild(idx), props);
                }
            });
        }
Esempio n. 4
0
 /// <summary>
 /// 提交状态
 /// </summary>
 protected void CommitProps()
 {
     UFluxUtils.SetComponentProps(this.Transform, this.Props);
 }