Ver Fonte

更新龙骨动画

jet há 8 anos atrás
pai
commit
0565bbe081

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
Assets/Resource/Animations/人物动画/stand_ske.json


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
Assets/Resource/Animations/人物动画/stand_tex.json


BIN
Assets/Resource/Animations/人物动画/stand_texture.png


Diff do ficheiro suprimidas por serem muito extensas
+ 247 - 175
Assets/Resource/Animations/人物动画/stand_texture.png.meta


+ 2 - 0
Assets/Resource/DragonBones/DragonBones/src/DragonBones/armature/Armature.cs

@@ -15,6 +15,8 @@ namespace DragonBones
      */
     public class Armature : BaseObject, IAnimateble
     {
+		public UnityEngine.Transform UnityTransform;
+
         private static int _onSortSlots(Slot a, Slot b)
         {
             return a._zOrder > b._zOrder ? 1 : -1;

+ 2 - 0
Assets/Resource/DragonBones/Unity/src/DragonBones/unity/UnityFactory.cs

@@ -109,6 +109,8 @@ namespace DragonBones
 
             _armatureGameObject = null;
 
+			armature.UnityTransform = _gameObject.transform;
+
             return armature;
         }
         /**

+ 2 - 2
Assets/Resource/XML/PlayerConfig.xml

@@ -1,5 +1,5 @@
 <PlayerConfig>
-  <Version value="3" />
+  <Version value="4" />
 
   <ID value="Default" />
   <SerialNumber value="Default" />
@@ -38,7 +38,7 @@
   <DressList value =""/>
   <FlowerList value="1" />
   <AchieveList value="" />
-  <DressData Head="" Dress="" Shoe="" HeadWear="" Top="" Eye="" Mouse="" Wing="Empty"/>
+  <DressData Head="" Dress="" Shoe="" HeadWear="" Top="" Eye="" Mouse="" Wing="Empty" LeftLongSleeveSlot="Empty" LeftShortSleeveSlot="Empty" RightLongSleeveSlot="Empty" RightShortSleeveSlot="Empty"/>
   <AchieveData AD="0" Skill="0" Sign="0" Share="0" ElfLevel="0" MiniGame="0" FlowerCoin="0" TotalPerson="0" CostDiamond="0"/>
 
   <SkillList>

+ 106 - 1
Assets/Script/Manage/ManaData.cs

@@ -603,7 +603,7 @@ public class ManaData : Regist
 
         List<string> dataList = new List<string>();
 
-        if (xmlNode != null && xmlNode.Attributes.Count == 8)
+        if (xmlNode != null && xmlNode.Attributes.Count == 12)
         {
             dataList.Add(xmlNode.Attributes[0].Value);
             dataList.Add(xmlNode.Attributes[1].Value);
@@ -613,7 +613,23 @@ public class ManaData : Regist
             dataList.Add(xmlNode.Attributes[5].Value);
             dataList.Add(xmlNode.Attributes[6].Value);
             dataList.Add(xmlNode.Attributes[7].Value);
+			dataList.Add(xmlNode.Attributes[8].Value);
+			dataList.Add(xmlNode.Attributes[9].Value);
+			dataList.Add(xmlNode.Attributes[10].Value);
+			dataList.Add(xmlNode.Attributes[11].Value);
         }
+		else if(xmlNode != null && xmlNode.Attributes.Count == 8)
+		{
+			dataList.Add(xmlNode.Attributes[0].Value);
+			dataList.Add(xmlNode.Attributes[1].Value);
+			dataList.Add(xmlNode.Attributes[2].Value);
+			dataList.Add(xmlNode.Attributes[3].Value);
+			dataList.Add(xmlNode.Attributes[4].Value);
+			dataList.Add(xmlNode.Attributes[5].Value);
+			dataList.Add(xmlNode.Attributes[6].Value);
+			dataList.Add(xmlNode.Attributes[7].Value);
+			dataList.AddRange (GetSleeveListByTop(xmlNode.Attributes[4].Value));
+		}
         else
         {
             float rate = Random.Range(0f, 1f);
@@ -628,6 +644,10 @@ public class ManaData : Regist
                 dataList.Add("眼睛1");
                 dataList.Add("嘴巴1");
                 dataList.Add("Empty");
+				dataList.Add("Empty");
+				dataList.Add("短袖1左");
+				dataList.Add("Empty");
+				dataList.Add("短袖1右");
             }
             else if (rate < 0.66f)
             {
@@ -639,6 +659,10 @@ public class ManaData : Regist
                 dataList.Add("眼睛2");
                 dataList.Add("嘴巴2");
                 dataList.Add("Empty");
+				dataList.Add("Empty");
+				dataList.Add("短袖2左");
+				dataList.Add("Empty");
+				dataList.Add("短袖2右");
             }
             else
             {
@@ -650,6 +674,10 @@ public class ManaData : Regist
                 dataList.Add("眼睛3");
                 dataList.Add("嘴巴3");
                 dataList.Add("Empty");
+				dataList.Add("Empty");
+				dataList.Add("短袖2左");
+				dataList.Add("Empty");
+				dataList.Add("短袖2右");
             }
         }
 
@@ -985,6 +1013,13 @@ public class ManaData : Regist
             To3(nativeDoc, defaultDoc);
         }
 
+		if (nativeVersion < 4)
+		{
+			Debug.LogWarning("UpdateArchive to 4");
+
+			To4(nativeDoc, defaultDoc);
+		}
+
         return nativeDoc;
     }
 
@@ -1031,4 +1066,74 @@ public class ManaData : Regist
 
         return nativeDoc;
     }
+
+	public static XmlDocument To4(XmlDocument nativeDoc, XmlDocument defaultDoc)
+	{
+		nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 4.ToString();
+
+		XmlNode xmlNode = nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("DressData");
+
+		XmlAttribute attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("LeftLongSleeveSlot"));
+		attribute.Value="Empty";
+
+		attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("LeftShortSleeveSlot"));
+		attribute.Value="Empty";
+
+		attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("RightLongSleeveSlot"));
+		attribute.Value="Empty";
+
+		attribute = xmlNode.Attributes.Append (nativeDoc.CreateAttribute ("RightShortSleeveSlot"));
+		attribute.Value="Empty";
+
+		List<string> sleeveList = GetSleeveListByTop (xmlNode.Attributes [4].Value);
+
+		xmlNode.Attributes [8].Value = sleeveList[0];
+		xmlNode.Attributes [9].Value = sleeveList[1];
+		xmlNode.Attributes [10].Value = sleeveList[2];
+		xmlNode.Attributes [11].Value = sleeveList[3];
+
+		return nativeDoc;
+	}
+
+	public static List<string> GetSleeveListByTop(string topName)
+	{
+		List<string> sleeveList = new List<string> (){ "Empty", "Empty", "Empty", "Empty" };
+
+		if (topName == "上衣1") {
+			sleeveList [1] = "短袖1左";
+			sleeveList [3] = "短袖1右";
+		} else if (topName == "上衣2") {
+			sleeveList [1] = "短袖2左";
+			sleeveList [3] = "短袖2右";
+		} else if (topName == "上衣3") {
+			sleeveList [1] = "短袖2左";
+			sleeveList [3] = "短袖2右";
+		} else if (topName == "上衣5") {
+			sleeveList [1] = "短袖2左";
+			sleeveList [3] = "短袖2右";
+		} else if (topName == "上衣6") {
+			sleeveList [1] = "短袖6左";
+			sleeveList [3] = "短袖6右";
+		} else if (topName == "上衣7") {
+			sleeveList [1] = "短袖7左";
+			sleeveList [3] = "短袖7右";
+		} else if (topName == "上衣7(粉)") {
+			sleeveList [1] = "短袖7粉左";
+			sleeveList [3] = "短袖7粉右";
+		} else if (topName == "上衣12") {
+			sleeveList [1] = "短袖12左";
+			sleeveList [3] = "短袖12右";
+		} else if (topName == "上衣13") {
+			sleeveList [1] = "短袖13左";
+			sleeveList [3] = "短袖13右";
+		} else if (topName == "上衣13(紫)") {
+			sleeveList [1] = "短袖13蓝左";
+			sleeveList [3] = "短袖13蓝右";
+		} else {
+			sleeveList [0] = "长袖9左";
+			sleeveList [2] = "长袖9右";
+		}
+	
+		return sleeveList;
+	}
 }

+ 5 - 0
Assets/Script/Manage/ManaPlayer.cs

@@ -215,5 +215,10 @@ public class ManaPlayer : Regist
         Player.ChangeClose(BodyPart.Eye, dressData[5]);
         Player.ChangeClose(BodyPart.Mouse, dressData[6]);
         Player.ChangeClose(BodyPart.Wing, dressData[7]);
+
+		Player.ChangeClose(BodyPart.LeftLongSleeve, dressData[8]);
+		Player.ChangeClose(BodyPart.LeftShortSleeve, dressData[9]);
+		Player.ChangeClose(BodyPart.RightLongSleeve, dressData[10]);
+		Player.ChangeClose(BodyPart.RightShortSleeve, dressData[11]);
     }
 }

+ 35 - 0
Assets/Script/Object/Player.cs

@@ -19,6 +19,10 @@ public enum BodyPart
     Leg,
     LeftHand,
     RightHand,
+	LeftLongSleeve,
+	LeftShortSleeve,
+	RightLongSleeve,
+	RightShortSleeve,
     Neck,
     Eye,
     Top,
@@ -397,6 +401,10 @@ public class Player : Regist , IPointerClickHandler
     public DragonBones.Slot RightHandSlot;
     public DragonBones.Slot LeftLegSlot;
     public DragonBones.Slot RightLegSlot;
+	public DragonBones.Slot LeftLongSleeveSlot;
+	public DragonBones.Slot LeftShortSleeveSlot;
+	public DragonBones.Slot RightLongSleeveSlot;
+	public DragonBones.Slot RightShortSleeveSlot;
 
     public DragonBones.Slot EyeSlot;
     public DragonBones.Slot TopSlot;
@@ -804,6 +812,11 @@ public class Player : Regist , IPointerClickHandler
         LeftLegSlot = UAC.armature.GetSlot("左腿");
         RightLegSlot = UAC.armature.GetSlot("右腿");
 
+		LeftLongSleeveSlot = UAC.armature.GetSlot("长袖左9");
+		LeftShortSleeveSlot = UAC.armature.GetSlot("上衣1袖子左");
+		RightLongSleeveSlot = UAC.armature.GetSlot("长袖右9");
+		RightShortSleeveSlot = UAC.armature.GetSlot("上衣1袖子右");
+		//Debug.Log (LeftLongSleeveSlot);
         EyeSlot = UAC.armature.GetSlot("眼睛");
         TopSlot = UAC.armature.GetSlot("上衣");
         HeadSlot = UAC.armature.GetSlot("脑壳");
@@ -814,6 +827,11 @@ public class Player : Regist , IPointerClickHandler
         RightShoeSlot = UAC.armature.GetSlot("鞋子右");
         HeadWearSlot = UAC.armature.GetSlot("头饰品");
 
+		ChangeClose(BodyPart.LeftLongSleeve, "Empty", false);
+		ChangeClose(BodyPart.LeftShortSleeve, "Empty", false);
+		ChangeClose(BodyPart.RightLongSleeve, "Empty", false);
+		ChangeClose(BodyPart.RightShortSleeve, "Empty", false);
+
         ChangeClose(BodyPart.Eye, "眼睛1", false);
         ChangeClose(BodyPart.Top, "上衣1", false);
         ChangeClose(BodyPart.Shoe, "鞋子1", false);
@@ -922,6 +940,7 @@ public class Player : Regist , IPointerClickHandler
 
     public void ChangeClose(BodyPart bodyPart, string armatureName, bool setDepth = true)
     {
+//		Debug.Log (bodyPart);
         List<DragonBones.Slot> slotList = new List<DragonBones.Slot>();
 
         if (bodyPart == BodyPart.Eye)
@@ -997,6 +1016,22 @@ public class Player : Regist , IPointerClickHandler
         {
             slotList.Add(NeckSlot);
         }
+		else if (bodyPart == BodyPart.LeftLongSleeve)
+		{
+			slotList.Add(LeftLongSleeveSlot);
+		}
+		else if (bodyPart == BodyPart.LeftShortSleeve)
+		{
+			slotList.Add(LeftShortSleeveSlot);
+		}
+		else if (bodyPart == BodyPart.RightLongSleeve)
+		{
+			slotList.Add(RightLongSleeveSlot);
+		}
+		else if (bodyPart == BodyPart.RightShortSleeve)
+		{
+			slotList.Add(RightShortSleeveSlot);
+		}
         else
         {
             throw new Exception();

+ 2 - 0
Assets/Script/Tool/Auxiliary.cs

@@ -140,6 +140,8 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.Z))
         {
+			ManaPlayer.Player.ChangeClose(BodyPart.LeftShortSleeve, "Empty");
+
 //			Dictionary<string,SkinSlotData> slots = ManaPlayer.Player.LeftLegSlot.armature.armatureData.GetSkin("__default").slots;
 //
 //			foreach(var skinSlotData in slots){

+ 3 - 1
ToDoList.txt

@@ -1,3 +1,5 @@
+服装在UI上的显示(试衣间 抽奖)
+
 通过服务器来设置昵称
 
 暂时关闭了修改昵称功能
@@ -6,7 +8,7 @@
 
 教程A的技能切换后台联网就不行了?
 
-DragonBone换装 动画事件 给Armature添加Transform
+给Armature添加Transform
 
 
 访问未解锁时点击排行榜和评论的访问按钮

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff