Ejemplo n.º 1
0
    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);
            }
        }
    }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        public static bool hasCustomClothLists(string sGamePath, ClothType ct)
        {
            string sPath = sGamePath + @".LPLauncher\" + getListName(ct);

            if (!File.Exists(sPath))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
 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);
             }
         }
     }
 }
Ejemplo n.º 5
0
    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]);
        }
    }
Ejemplo n.º 6
0
    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);
    }
Ejemplo n.º 7
0
    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);
    }
Ejemplo n.º 8
0
    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();
            });
        }
    }
Ejemplo n.º 9
0
    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;
    }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
		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;
			}
		}
Ejemplo n.º 12
0
		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 ();
		}
Ejemplo n.º 13
0
		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);
			}
		}
Ejemplo n.º 14
0
		public void SwitchClothToEmpty(ClothType type)
		{
			ClothView (type).Content = new AbsoluteLayout ();
		}
Ejemplo n.º 15
0
		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
			};
		}
Ejemplo n.º 16
0
 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;
         }
     }
 }
Ejemplo n.º 17
0
 public CClothLists(string sGamePath, ClothType ct)
 {
     m_sPath     = sGamePath;
     m_ClothType = ct;
 }
Ejemplo n.º 18
0
		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 ();
		}
Ejemplo n.º 19
0
		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 ();
		}
Ejemplo n.º 20
0
    //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;
        }
    }
Ejemplo n.º 21
0
		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 ();
		}
Ejemplo n.º 22
0
 public void CreateClothType(ClothType clothType)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 23
0
		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 ();
		}
Ejemplo n.º 24
0
 public void Ini(ClothType type)
 {
     text.text       = type.name;
     gameObject.name = type.name;
 }