Пример #1
0
        /// <summary>
        /// 改变Item
        /// </summary>
        /// <param name="pageItem"></param>
        /// <param name="data"></param>
        public virtual void ChangeChildItem(YxPageItem pageItem, YxData data)
        {
            pageItem.UpdateView(data);
            var index = ItemViews.FindIndex(item => item != null && item == pageItem);

            if (index > -1)
            {
                ItemDatas[index] = data;
                if (gameObject.activeInHierarchy)
                {
                    StartCoroutine(OnItemChangeAction.WaitExcuteCalls());
                }
            }
        }
Пример #2
0
        protected virtual Dictionary <string, YxData> GetDatas(Dictionary <string, object> dic)
        {
            bool canChange = typeof(YxData).IsAssignableFrom(Type);
            var  datas     = new Dictionary <string, YxData>();

            if (canChange)
            {
                foreach (var item in dic)
                {
                    YxData data = (YxData)Activator.CreateInstance(
                        Type, new object[]
                    {
                        item.Value
                    });
                    datas.Add(item.Key, data);
                }
            }
            return(datas);
        }
Пример #3
0
        protected virtual List <YxData> GetDatas(List <object> list)
        {
            bool          canChange = typeof(YxData).IsAssignableFrom(Type);
            List <YxData> datas     = new List <YxData>();

            if (canChange)
            {
                for (int i = 0, count = list.Count; i < count; i++)
                {
                    var    paramData = list[i];
                    YxData data      = (YxData)Activator.CreateInstance(Type, new object[]
                    {
                        paramData
                    });
                    datas.Add(data);
                }
            }
            return(datas);
        }