Ejemplo n.º 1
0
    private IEnumerator SetDatas()
    {
        //yield return new WaitForSeconds(2);
        yield return(null);

        if (null != mScrollView)
        {
            List <UIItemData> datas = new List <UIItemData>();
            for (int i = 0; i < 30; i++)
            {
                List <UIHandlerData> data = new List <UIHandlerData>();
                data.Add(new UIHandlerData("SetTextString", 0, "Item" + i));
                var d = new UIItemData(data);
                //d.Info = "Item" + i;
                datas.Add(d);
            }
            mScrollView.SetData(datas);
            //foreach (var item in new int[] { 40, 38, 28, 15, 5, 0 })
            //{

            //    yield return new WaitForSeconds(5);
            //    Debug.LogWarning(item);
            //    mScrollView.SetCurIndex(item);
            //}
        }
    }
Ejemplo n.º 2
0
        public static async Task <T> ShowUIItemAsync <T>(this EntityComponent entityCompoennt, int typeID, Transform parent, string pathFormat) where T : BaseItem
        {
            int    serialId    = GameEntry.Entity.GenerateSerialId();
            string entityGroup = typeof(T).Name.Split('_')[0];

            UIItemData uiItemData = UIItemData.Create(serialId, typeID, parent);

            T entity = await entityCompoennt.ShowEntityAsync <T>(entityGroup, Constant.AssetPriority.UIItemAsset, uiItemData, pathFormat);

            return(entity);
        }
Ejemplo n.º 3
0
 public static UIItemData Clone(UIItemData instance)
 {
     var tmp = new UIItemData ();
     tmp.ID = instance.ID;
     tmp.Name = instance.Name;
     tmp.Description = instance.Description;
     tmp.GameType = instance.GameType;
     tmp.Amount = instance.Amount;
     tmp.Icon = instance.Icon;
     tmp.ItemType = instance.ItemType;
     tmp.Owner = instance.Owner;
     tmp.EffectPath = instance.EffectPath;
     return tmp;
 }
Ejemplo n.º 4
0
 public static UIItemData operator +(UIItemData lh, UIItemData rh)
 {
     var tmp = new UIItemData ();
     tmp.ID = lh.ID;
     tmp.Name = lh.Name;
     tmp.GameType = lh.GameType;
     tmp.Description = lh.Description;
     tmp.Amount = lh.Amount + rh.Amount;
     tmp.Icon = lh.Icon;
     tmp.ItemType = lh.ItemType;
     tmp.Owner = lh.Owner;
     tmp.EffectPath = lh.EffectPath;
     return tmp;
 }
    public UIItemController(UIItemData data)
    {
        m_Data = data;
        m_GameManager = TDCGameManager.GetInstance();
        m_Inventory = UIInventory.GetInstance();

        m_EffectManager = new EffectManager();
        m_EffectManager.LoadEffect(m_Data.EffectPath);
        m_EffectManager.RegisterCondition("CanActiveEffect", CanActiveEffect);

        m_EffectManager.RegisterExcuteMethod("PrintDebug", PrintDebug);
        m_EffectManager.RegisterExcuteMethod("CreateObjectEffect", CreateObjectEffect);
        m_EffectManager.RegisterExcuteMethod("DropItSelfEffect", DropItSelfEffect);
        m_EffectManager.RegisterExcuteMethod("AddValueEffect", AddValueEffect);
        m_EffectManager.RegisterExcuteMethod("SubtractValueEffect", SubtractValueEffect);
    }
Ejemplo n.º 6
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_UIItemData = userData as UIItemData;
            if (m_UIItemData == null)
            {
                Log.Error("Bullet data is invalid.");
                return;
            }

            if (m_UIItemData.Parent != null)
            {
                CachedTransform.SetParent(m_UIItemData.Parent);
                CachedTransform.localPosition = m_UIItemData.Position;
            }
        }
 public UIItemController()
 {
     m_Data = null;
     m_EffectManager = null;
 }