public void UpdataList() { mMyGift.Clear(); List <ItemSlotData> dataList = ItemDataManager.Instance.GetItemDataList(ItemSlotType.CLOTH_BAG); dataList.Sort(MySort); // dataList.Sort(delegate(ItemSlotData ItemSlotData0,ItemSlotData ItemSlotDat1) // { // if(ItemSlotData0.MItemData == null || ItemSlotDat1.MItemData == null) // return 0; // if(ItemSlotData0.MItemData.BasicData.SuitSex != ItemSlotDat1.MItemData.BasicData.SuitSex)//性别排序// // return ItemSlotData0.MItemData.BasicData.SuitSex > ItemSlotDat1.MItemData.BasicData.SuitSex ? 1 : -1; // else // { // if(ItemSlotData0.MItemData.BasicData.LogicID != ItemSlotDat1.MItemData.BasicData.LogicID)//LogicID排序// // { // return ItemSlotData0.MItemData.BasicData.LogicID > ItemSlotDat1.MItemData.BasicData.LogicID? 1 :-1; // } // else // { // return ItemSlotData0.MItemData.BasicData.Count > ItemSlotDat1.MItemData.BasicData.Count? -1 ://数量排序// // (ItemSlotData0.MItemData.BasicData.Count == ItemSlotDat1.MItemData.BasicData.Count ? 0 : 1); // } // } // return 0; // }); foreach (var item in dataList) { if (null != item.MItemData) { ClothType temp = (ClothType)item.MItemData.BasicData.SuitSex; if (item.MItemData.BasicData.Count <= 0) { continue; } //Debug.Log("Name = " + item.MItemData.BasicData.Name + "Num = " + item.MItemData.BasicData.Count.ToString() ); if (mMyGift.ContainsKey(temp)) { mMyGift[temp].Add(item); } else { List <ItemSlotData> TempList = new List <ItemSlotData>(); TempList.Add(item); mMyGift.Add(temp, TempList); } } } for (int i = 0; i <= (int)ClothType.OTHER; ++i) { if (mMyGift.ContainsKey((ClothType)i)) { mMyGift[(ClothType)i].Sort(MySort); } } }
public Item(Item _data) { itemID = _data.itemID; itemName = _data.itemName; itemGraphic = _data.itemGraphic; itemType = _data.itemType; clothType = _data.clothType; furnitureType = _data.furnitureType; itemOffset = _data.itemOffset; itemPrice = _data.itemPrice; }
public static bool hasCustomClothLists(string sGamePath, ClothType ct) { string sPath = sGamePath + @".LPLauncher\" + getListName(ct); if (!File.Exists(sPath)) { return(false); } return(true); }
void DestroyWithType(ClothType t) { for (int i = 0; i < cloth.Length; i++) { if (cloth[i].type == t) { if (cloth[i].entity) { GameObject.Destroy(cloth[i].entity); } } } }
public Cloth(string clothName, Sprite firstPic, ClothType thisType, string thisOwner, string atbs) { name = clothName; spritesInScenes[0] = firstPic; type = thisType; owner = thisOwner; state = ClothState.None; string[] splited = atbs.Split(' '); for (int i = 0; i < attributes.Length; i++) { attributes[i] = Int32.Parse(splited[i + 1]); } }
public static List <ClothType> ToClothTypes(this DataTable dt) { var result = new List <ClothType>(); if (dt == null || dt.Rows.Count == 0) { return(result); } foreach (DataRow row in dt.Rows) { var model = new ClothType(); model.type = reurnSafeStr(row["type"]); model.id = Convert.ToInt32(row["id"]); result.Add(model); } return(result); }
void Awake() { Instance = this; ClothType hair = new ClothType(WearPosConst.WAER_POS_HAIR, "头发"); cloths.Add(hair); ClothType cloth = new ClothType(WearPosConst.WAER_POS_CLOTH, "衣服"); cloths.Add(cloth); ClothType pant = new ClothType(WearPosConst.WEAR_POS_PANT, "裤子"); cloths.Add(pant); ClothType shoe = new ClothType(WearPosConst.WEAR_POS_SHOE, "鞋"); cloths.Add(shoe); ClothType suit = new ClothType(WearPosConst.WEAR_POS_SUIT, "套装"); cloths.Add(suit); }
void IniClothType() { patch.transform.GetComponent <RectTransform>().sizeDelta = new Vector2(400, 80 * (cloths.Count)); for (int i = 0; i < cloths.Count; i++) { ClothType ct = cloths[i]; GameObject g = Resources.Load <GameObject>("UI/patchItem"); GameObject go = GameObject.Instantiate(g); patchItem pi = go.GetComponent <patchItem>(); pi.Ini(ct); go.transform.parent = patch.transform; go.transform.localScale = Vector3.one; EventTriggerListener.Get(go).onClicks.Add(() => { currentPatch = ct.value; IniatializeScroll(); }); } }
public void DisplayClothList(ClothType Type, int goupNum = 0) { mClothType = Type; _goupNum = 0; SetTweenActive(CLFMove, true, null); SetTweenActive(CMFMove, false, null); HelpUtil.DelListInfo(CLFTable.transform); if (!mMyGift.ContainsKey(Type)) { NGUITools.SetActive(CLFLabel.gameObject, true); return; } NGUITools.SetActive(CLFLabel.gameObject, false); int i = 0; int iLogicID = -1; int iNum = -1; //int Flag = 0; List <ItemSlotData> MyGiftList = mMyGift[Type]; mGoupNum = goupNum; }
private static string getListName(ClothType ct) { string sPath = "clothList"; switch (ct) { case ClothType.ctCasual: sPath += "_Casual"; break; case ClothType.ctSport: sPath += "_Sport"; break; case ClothType.ctWork: sPath += "_Work"; break; } sPath += ".txt"; return(sPath); }
private void ChangeCurrentCloth(ClothType type, int value) { switch (type) { case ClothType.Head: CurrentHead = value; break; case ClothType.Body: CurrentBody = value; break; case ClothType.Pants: CurrentPants = value; break; case ClothType.Shoes: CurrentShoes = value; break; } }
private int CurrentCloth(ClothType type) { switch (type) { case ClothType.Head: return CurrentHead; case ClothType.Body: return CurrentBody; case ClothType.Pants: return CurrentPants; case ClothType.Shoes: return CurrentShoes; } throw new ArgumentException (); }
public async void SwitchCloth(ClothType type, int direction) { if(ClothView(type).Content != null) { Arrow (type, -1).Disable (); Arrow (type, 1).Disable (); ContentView disappearingCloth = new ContentView { VerticalOptions = ClothView(type).VerticalOptions }; AbsoluteLayout.SetLayoutBounds (disappearingCloth, AbsoluteLayout.GetLayoutBounds (ClothView(type))); AbsoluteLayout.SetLayoutFlags (disappearingCloth, AbsoluteLayout.GetLayoutFlags (ClothView(type))); disappearingCloth.Content = new CWCloth { SvgPath = ((CWCloth)(ClothView(type).Content)).SvgPath, Color = ((CWCloth)(ClothView(type).Content)).Color, HeightRequest = ((CWCloth)(ClothView(type).Content)).HeightRequest }; ClothSlider(type).Children.Add (disappearingCloth); await Task.Delay (10); // mad sheet int dx = App.ScreenWidth / 2 + (int)ClothView(type).Content.Width / 2; ClothView(type).TranslationX = - direction * dx; SwitchClothPath (type); ClothView(type).TranslateTo (0, 0, 700, Easing.CubicInOut); await disappearingCloth.TranslateTo (direction * dx, 0, 700, Easing.CubicInOut); ClothesCanvas.Children.Remove (disappearingCloth); Arrow (type, -1).Enable (); Arrow (type, 1).Enable (); } else { SwitchClothPath (type); } }
public void SwitchClothToEmpty(ClothType type) { ClothView (type).Content = new AbsoluteLayout (); }
public void SwitchClothPath(ClothType type) { ClothView (type).Content = new CWCloth { SvgPath = "ClothesAndWeather.Images.ClothesDB." + DBClothes(type) [CurrentCloth(type)].Image, Color = DBClothes(type) [CurrentCloth(type)].DefaultColor, HeightRequest = App.CanvasHeight }; }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.GetComponent <ClothType>() != null) { ClothType name = collision.gameObject.GetComponent <ClothType>(); if (name.clothType == "Bandana" && !played[0]) { aud.PlayOneShot(bandana); played[0] = true; return; } if (name.clothType == "Jeans" && !played[1]) { aud.PlayOneShot(jeans); played[1] = true; return; } if (name.clothType == "Leggings" && !played[2]) { aud.PlayOneShot(leggings); played[2] = true; return; } if (name.clothType == "Splatter Dress" && !played[3]) { aud.PlayOneShot(splatter); played[3] = true; return; } if (name.clothType == "Ugly" && !played[4]) { aud.PlayOneShot(ugly); played[4] = true; return; } if (name.clothType == "Romper" && !played[5]) { aud.PlayOneShot(romper); played[5] = true; return; } if (name.clothType == "UglyW" && !played[6]) { aud.PlayOneShot(uglyW); played[6] = true; return; } if (name.clothType == "Shirt" && !played[7]) { aud.PlayOneShot(basicOkay); played[7] = true; return; } if (name.clothType == "Cute" && !played[8]) { aud.PlayOneShot(cute); played[8] = true; return; } if (name.clothType == "Skirt" && !played[9]) { aud.PlayOneShot(skirt); played[9] = true; return; } } }
public CClothLists(string sGamePath, ClothType ct) { m_sPath = sGamePath; m_ClothType = ct; }
private ContentView ClothView(ClothType type) { switch (type) { case ClothType.Head: return Head; case ClothType.Body: return Body; case ClothType.Pants: return Pants; case ClothType.Shoes: return Shoes; } throw new ArgumentException (); }
private List<Cloth> DBClothes(ClothType type) { switch (type) { case ClothType.Head: return DBHeads; case ClothType.Body: return DBBodies; case ClothType.Pants: return DBPants; case ClothType.Shoes: return DBShoes; } throw new ArgumentException (); }
//public void TakeOff(string clothName) //{ // for (int i = 0; i < cloth.Length; i++) // { // if (cloth[i].entity && cloth[i].name == clothName) // GameObject.Destroy(cloth[i].entity); // } //} public void Wear(string clothName) { if (clothName == "none") { return; } //Debug.Log(clothName); int prefabIndex = 0, i; ClothType type = DetermineType(clothName); if (type == ClothType.none) { Debug.Log("debil"); return; } if (type == ClothType.material) { for (i = 0; i < textures.Length; i++) { if (clothName == textures[i].name) { prefabIndex = i; } } for (i = 0; i < cloth.Length; i++) { if (cloth[i].name == clothName) { gameObject.transform.Find(rendererParent).renderer.material.mainTexture = textures[prefabIndex]; break; } } } else { DestroyWithType(type); for (i = 0; i < prefabs.Length; i++) { if (clothName == prefabs[i].name) { prefabIndex = i; } } for (i = 0; i < cloth.Length; i++) { if (cloth[i].name == clothName) { cloth[i].entity = NGUITools.AddChild(gameObject.transform.Find(cloth[i].parent).gameObject, prefabs[prefabIndex]); //cloth[i].entity = GameObject.Instantiate(prefabs[prefabIndex]) as GameObject; break; } } //cloth[i].entity.transform.parent = gameObject.transform.Find(cloth[i].parent); //cloth[i].entity.transform.localPosition = cloth[i].pos; cloth[i].entity.transform.localScale = prefabs[prefabIndex].transform.localScale; cloth[i].entity.transform.localRotation = prefabs[prefabIndex].transform.rotation; } }
private AbsoluteLayout ClothSlider(ClothType type) { switch (type) { case ClothType.Head: return HeadSlider; case ClothType.Body: return BodySlider; case ClothType.Pants: return PantsSlider; case ClothType.Shoes: return ShoesSlider; } throw new ArgumentException (); }
public void CreateClothType(ClothType clothType) { throw new NotImplementedException(); }
private CWArrow Arrow(ClothType type, int direction) { switch (type) { case ClothType.Head: return direction == -1 ? HeadLeft : HeadRight; case ClothType.Body: return direction == -1 ? BodyLeft : BodyRight; case ClothType.Pants: return direction == -1 ? PantsLeft : PantsRight; case ClothType.Shoes: return direction == -1 ? ShoesLeft : ShoesRight; } throw new ArgumentException (); }
public void Ini(ClothType type) { text.text = type.name; gameObject.name = type.name; }