private void InitDollData() { m_CategoryList = new List <CocoDressupCategoryData> (); CocoDressupCategoryData categoryData = new CocoDressupCategoryData(); categoryData.CategoryID = "body"; categoryData.m_IconNormalPath = "Sprite/Category/pattern"; categoryData.m_IconSelectedPath = "Sprite/Category/pattern_xz"; categoryData.m_BGNormalPath = "Category/Label_bg"; categoryData.m_BGSelectPath = "Category/Label_bg_xz"; categoryData.m_ItemPrefabsPath = "prefabs/Dressup_Item"; categoryData.m_ItemGridInfo = GetGridInfo(categoryData.CategoryID); categoryData.m_Animation = CA_Dressup_body; m_CategoryList.Add(categoryData); categoryData = new CocoDressupCategoryData(); categoryData.CategoryID = "ear"; categoryData.m_IconNormalPath = "Sprite/Category/Ears"; categoryData.m_IconSelectedPath = "Sprite/Category/Ears_xz"; categoryData.m_BGNormalPath = "Category/Label_bg"; categoryData.m_BGSelectPath = "Category/Label_bg_xz"; categoryData.m_ItemPrefabsPath = "prefabs/Dressup_Item"; categoryData.m_ItemGridInfo = GetGridInfo(categoryData.CategoryID); categoryData.m_Animation = CA_Dressup_ear; m_CategoryList.Add(categoryData); categoryData = new CocoDressupCategoryData(); categoryData.CategoryID = "eye"; categoryData.m_IconNormalPath = "Sprite/Category/eyes"; categoryData.m_IconSelectedPath = "Sprite/Category/eyes_xz"; categoryData.m_BGNormalPath = "Category/Label_bg"; categoryData.m_BGSelectPath = "Category/Label_bg_xz"; categoryData.m_ItemPrefabsPath = "prefabs/Dressup_Item"; categoryData.m_ItemGridInfo = GetGridInfo(categoryData.CategoryID); categoryData.m_Animation = CA_Dressup_ear; m_CategoryList.Add(categoryData); categoryData = new CocoDressupCategoryData(); categoryData.CategoryID = "nose"; categoryData.m_IconNormalPath = "Sprite/Category/mouth"; categoryData.m_IconSelectedPath = "Sprite/Category/mouth_xz"; categoryData.m_BGNormalPath = "Category/Label_bg"; categoryData.m_BGSelectPath = "Category/Label_bg_xz"; categoryData.m_ItemPrefabsPath = "prefabs/Dressup_Item"; categoryData.m_ItemGridInfo = GetGridInfo(categoryData.CategoryID); categoryData.m_Animation = CA_Dressup_ear; m_CategoryList.Add(categoryData); categoryData = new CocoDressupCategoryData(); categoryData.CategoryID = "tail"; categoryData.m_IconNormalPath = "Sprite/Category/tails"; categoryData.m_IconSelectedPath = "Sprite/Category/tails_xz"; categoryData.m_BGNormalPath = "Category/Label_bg"; categoryData.m_BGSelectPath = "Category/Label_bg_xz"; categoryData.m_ItemPrefabsPath = "prefabs/Dressup_Item"; categoryData.m_ItemGridInfo = GetGridInfo(categoryData.CategoryID); categoryData.m_Animation = CA_Dressup_ear; m_CategoryList.Add(categoryData); }
void InitInfo(string catergoryID) { m_DressupCategoryData = DressupData.GetCategoryData(catergoryID); this.name = m_DressupCategoryData.CategoryID; ChangeStatus(); }
void InitCategoryItems(CocoDressupCategoryData data) { m_ItemScroll.GridGroup.SetInfo(data.m_ItemGridInfo); List <CocoRoleDressItemHolder> itemDataList = m_CategoryItemDic [data.CategoryID]; itemDataList = GetItemList(itemDataList, data.CategoryID); m_ButtonList.Clear(); if (itemDataList != null) { for (int i = 0; i < itemDataList.Count; i++) { #region fix CocoRoleDressItemHolder itemHolder = itemDataList[i]; // Debug.LogError ("itemHolder id : " + itemHolder.id); // int index = i-1; // if (index> 0) { // switch (index % 3) { // case 0: // itemHolder.lockType = CocoLockType.Non; // break; // case 1: // itemHolder.lockType = CocoLockType.RV; // break; // case 2: // itemHolder.lockType = CocoLockType.IAP; // break; // default: // itemHolder.lockType = CocoLockType.Non; // break; // } // } else { // itemHolder.lockType = CocoLockType.Non; // } // // if (data.m_LockType == CocoLockType.RV){ // itemHolder.lockType = CocoLockType.Non; // } itemHolder.order = i; #endregion GameDollItemButton button = GameDollItemButton.Create(data.m_ItemPrefabsPath, itemHolder, m_ItemScroll.GridGroup.transform, data.CategoryID); m_ButtonList.Add(button.gameObject); } } m_ItemScroll.InitSize(); m_ItemScroll.SetGridEnable(true); }
IEnumerator UpdateItemList(CocoDressupCategoryData data) { CocoMainController.Instance.TouchEnable = false; m_ItemScroll.ScrollRect.enabled = false; RectTransform rectTrans = m_ItemScroll.GridGroup.GetComponent <RectTransform> (); CCAction.MoveLocalY(m_ItemScroll.GridGroup.gameObject, -768, 0.3f); yield return(new WaitForSeconds(0.3f)); m_ItemScroll.Clear(); yield return(new WaitForEndOfFrame()); InitCategoryItems(data); yield return(new WaitForEndOfFrame()); m_ItemScroll.ScrollRect.enabled = true; CocoMainController.Instance.TouchEnable = true; }