LiuQilin преди 8 години
родител
ревизия
0ffdea6a45

+ 3 - 2
Assets/Resource/Logo.unity

@@ -470,8 +470,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: f1828554d8ffa12449b221fe29b2c32c, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  DebugMode: 0
-  DebugModeGo: {fileID: 0}
+  DebugMode: 1
+  DebugModeGo: {fileID: 1264531325540048, guid: b22fd2d9abc702d43ac62a412537d4e9,
+    type: 2}
 --- !u!4 &1833966245
 Transform:
   m_ObjectHideFlags: 0

+ 1 - 1
Assets/Resource/Prefab/PrefabUI/GroupB.prefab

@@ -13262,7 +13262,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: 0.0000000030486, y: 88.5}
+  m_AnchoredPosition: {x: 0.0000000030486, y: 86.77}
   m_SizeDelta: {x: 133.4, y: 15.1}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!224 &224842771224356480

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

@@ -1,5 +1,5 @@
 <PlayerConfig>
-  <Version value="4" />
+  <Version value="5" />
 
   <ID value="Default" />
   <SerialNumber value="Default" />

+ 2 - 2
Assets/Resource/XML/lan/English.xml

@@ -126,8 +126,8 @@ Program 水怪
     <T_Tit desc=""><![CDATA[Enter your nickname]]></T_Tit>
     <T_TooLong desc=""><![CDATA[Nickname too long]]></T_TooLong>
     <T_AllWhiteSpace desc=""><![CDATA[Nickname can not be null]]></T_AllWhiteSpace>
-    <T_Checking desc=""><![CDATA[]]></T_Checking>
-    <T_RepeatName desc=""><![CDATA[]]></T_RepeatName>
+    <T_Checking desc=""><![CDATA[Checking]]></T_Checking>
+    <T_RepeatName desc=""><![CDATA[Repeat]]></T_RepeatName>
     <热卖 desc=""><![CDATA[Most Popular]]></热卖>
     <超值 desc=""><![CDATA[Highest Value]]></超值>
   </UI>

BIN
Assets/Resource/Xlsx/language_config.xlsx


+ 2 - 0
Assets/Script/Manage/Initializer.cs

@@ -95,6 +95,8 @@ public class Initializer : MonoBehaviour
 
     public static void Initialize()
     {
+        //Debug.Log(Application.persistentDataPath);
+
         GameObject.Find("I_Lab").GetComponent<Text>().text = "Error code : 1";
 
         ManaTutorial.TutorialA = ManaData.GetPlayerBool("TutorialA");

+ 35 - 0
Assets/Script/Manage/ManaAudio.cs

@@ -125,6 +125,18 @@ public class ManaAudio : Regist
         #endregion
 
         MusicTheme.TweenForAudio();
+
+        if (!Music)
+        {
+            ManaReso.SetActive("L_MusicOn", false);
+            ManaReso.SetActive("L_MusicOff", true);
+        }
+
+        if (!Audio)
+        {
+            ManaReso.SetActive("L_AudioOn", false);
+            ManaReso.SetActive("L_AudioOff", true);
+        }
     }
 
     public override void RegistReference()
@@ -148,6 +160,21 @@ public class ManaAudio : Regist
     }
 
 
+    public static void InitAudioSettingFromPlayerPrefs()
+    {
+        Audio = PlayerPrefs.GetInt("AudioOn", 1).ToBool();
+        Music = PlayerPrefs.GetInt("MusicOn", 1).ToBool();
+    }
+
+    public static void SetLogoVolume()
+    {
+        if (!Audio || !Music)
+        {
+            GameObject.Find("LOGO0005").GetComponent<AudioSource>().volume = 0;
+        }
+    }
+
+
     public void MusicSwitch()
     {
         if (Music)
@@ -159,6 +186,8 @@ public class ManaAudio : Regist
             
             MusicMini.Pause();
             MusicTheme.Pause();
+
+            PlayerPrefs.SetInt("MusicOn", 0);
         }
         else
         {
@@ -169,6 +198,8 @@ public class ManaAudio : Regist
 
             MusicMini.UnPause();
             MusicTheme.UnPause();
+
+            PlayerPrefs.SetInt("MusicOn", 1);
         }
     }
 
@@ -180,6 +211,8 @@ public class ManaAudio : Regist
 
             ManaReso.SetActive("L_AudioOn", false);
             ManaReso.SetActive("L_AudioOff", true);
+
+            PlayerPrefs.SetInt("AudioOn", 0);
         }
         else
         {
@@ -187,6 +220,8 @@ public class ManaAudio : Regist
 
             ManaReso.SetActive("L_AudioOn", true);
             ManaReso.SetActive("L_AudioOff", false);
+
+            PlayerPrefs.SetInt("AudioOn", 1);
         }
     }
 

+ 73 - 24
Assets/Script/Manage/ManaData.cs

@@ -43,16 +43,28 @@ public class ManaData : Regist
 
                 string configPath = Application.persistentDataPath + "/PlayerConfig.xml";
 
-
                 if (File.Exists(configPath))
                 {
-                    StreamReader sr = new StreamReader(configPath);
-                    
-                    nativeDoc.LoadXml(sr.ReadToEnd());
+                    try
+                    {
+                        StreamReader sr = new StreamReader(configPath);
 
-                    sr.Close();
-                    
-                    Auxiliary.DecryptXml(nativeDoc);
+                        nativeDoc.LoadXml(sr.ReadToEnd());
+
+                        sr.Close();
+
+                        Auxiliary.DecryptXml(nativeDoc);
+                    }
+                    catch (Exception)
+                    {
+                        Debug.LogWarning("Download Archive : MD5 doesn't match");
+                        ManaDebug.Log("Download Archive");
+
+                        DamageLock = true;
+                        DownloadLock = false;
+
+                        return null;
+                    }
 
                     
                     TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
@@ -79,9 +91,35 @@ public class ManaData : Regist
                         
                         if (nativeVersion < defaultVersion)
                         {
-                            PlayerDoc_ = MergeXML(nativeVersion, nativeDoc, DefaultDoc);
+                            byte[] bytes;
+
+                            MD5 md5 = new MD5CryptoServiceProvider();
+
+                            if (nativeVersion <= 4)
+                            {
+                                bytes = Encoding.UTF8.GetBytes(nativeDoc.OuterXml);
+                            }
+                            else
+                            {
+                                bytes = File.ReadAllBytes(configPath);
+                            }
+
+                            if (PlayerPrefs.GetString("config") != Auxiliary.ToString(md5.ComputeHash(bytes)))
+                            {
+                                Debug.LogWarning("Download Archive : MD5 doesn't match");
+                                ManaDebug.Log("Download Archive");
+
+                                DamageLock = true;
+                                DownloadLock = false;
+
+                                return null;
+                            }
+                            else
+                            {
+                                PlayerDoc_ = MergeXML(nativeVersion, nativeDoc, DefaultDoc);
 
-                            ManaServer.Save();
+                                ManaServer.Save();
+                            }
                         }
                         else if (nativeVersion > defaultVersion)
                         {
@@ -89,13 +127,13 @@ public class ManaData : Regist
                         }
                         else
                         {
-                            byte[] bytes = Encoding.UTF8.GetBytes(nativeDoc.OuterXml);
+                            byte[] bytes = File.ReadAllBytes(configPath);
 
                             MD5 md5 = new MD5CryptoServiceProvider();
 
                             if (PlayerPrefs.GetString("config") != Auxiliary.ToString(md5.ComputeHash(bytes)))
                             {
-                                Debug.LogWarning("Download Archive");
+                                Debug.LogWarning("Download Archive : MD5 doesn't match");
                                 ManaDebug.Log("Download Archive");
 
                                 DamageLock = true;
@@ -103,7 +141,7 @@ public class ManaData : Regist
 
                                 return null;
                             }
-                            
+
                             PlayerDoc_ = nativeDoc;
                         }
                     }
@@ -187,14 +225,6 @@ public class ManaData : Regist
     {
         if (Initializer.Complete)
         {
-            byte[] bytes = Encoding.UTF8.GetBytes(PlayerDoc.OuterXml);
-
-            MD5 md5 = new MD5CryptoServiceProvider();
-
-            PlayerPrefs.SetString("id", ManaServer.ID);
-            PlayerPrefs.SetString("config", Auxiliary.ToString(md5.ComputeHash(bytes)));
-
-
             XmlDocument doc = new XmlDocument();
 
             doc.LoadXml(PlayerDoc.OuterXml);
@@ -206,6 +236,13 @@ public class ManaData : Regist
             sw.Write(doc.OuterXml);
 
             sw.Close();
+
+            byte[] bytes = File.ReadAllBytes(Application.persistentDataPath + "/PlayerConfig.xml");
+            //byte[] bytes = Encoding.UTF8.GetBytes(PlayerDoc.OuterXml);
+
+            MD5 md5 = new MD5CryptoServiceProvider();
+
+            PlayerPrefs.SetString("config", Auxiliary.ToString(md5.ComputeHash(bytes)));
         }
     }
 
@@ -231,8 +268,8 @@ public class ManaData : Regist
 
             int nativeVersion = int.Parse(PlayerDoc_.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
             int defaultVersion = int.Parse(DefaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
-            Debug.Log(nativeVersion + " " + defaultVersion);
-            ManaDebug.Log(nativeVersion + " " + defaultVersion);
+            //Debug.Log(nativeVersion + " " + defaultVersion);
+            //ManaDebug.Log(nativeVersion + " " + defaultVersion);
             if (nativeVersion < defaultVersion)
             {
                 MergeXML(nativeVersion, PlayerDoc_, DefaultDoc);
@@ -516,8 +553,6 @@ public class ManaData : Regist
 
     public static void ResetPlayerConfig()
     {
-        PlayerPrefs.SetString("id", "");
-
         PlayerNode.SelectSingleNode("Version").Attributes[0].Value = "10000";
 
         SavePlayerConfig();
@@ -1024,6 +1059,13 @@ public class ManaData : Regist
 			To4(nativeDoc, defaultDoc);
 		}
 
+        if (nativeVersion < 5)
+        {
+            Debug.LogWarning("UpdateArchive to 5");
+
+            To5(nativeDoc, defaultDoc);
+        }
+
         return nativeDoc;
     }
 
@@ -1140,4 +1182,11 @@ public class ManaData : Regist
 	
 		return sleeveList;
 	}
+
+    public static XmlDocument To5(XmlDocument nativeDoc, XmlDocument defaultDoc)
+    {
+        nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 5.ToString();
+
+        return nativeDoc;
+    }
 }

+ 10 - 21
Assets/Script/Manage/ManaGarden.cs

@@ -143,6 +143,8 @@ public class ManaGarden : Regist
 
     public static Dictionary<int, FlowerInfo> FlowerInfoDic = new Dictionary<int, FlowerInfo>();
 
+    public static TweenMatFloat FlowerCardMatTween;
+
     #endregion
 
     public void Update()
@@ -284,24 +286,6 @@ public class ManaGarden : Regist
     }
 
 
-    //public static void LockSlot()
-    //{
-    //    for (int i = 0; i < SlotList.Count; i++)
-    //    {
-    //        if (SlotList[i].Lock)
-    //        {
-    //            Slot--;
-
-    //            SlotList[i].Lock = false;
-    //            SlotList[i].Available = false;
-
-    //            return;
-    //        }
-    //    }
-
-    //    throw new Exception();
-    //}
-
     public static void UnlockSlot()
     {
         for (int i = 0; i < SlotList.Count; i++)
@@ -404,6 +388,11 @@ public class ManaGarden : Regist
         ManaReso.SetText("H_Lab", flowerInfo.Name);
 
 
+        if (FlowerCardMatTween != null)
+        {
+            FlowerCardMatTween.Pause();
+        }
+
         Image image = ManaReso.Get<Image>("H_Icon2");
 
         image.material = Lib.GrayMat;
@@ -461,14 +450,14 @@ public class ManaGarden : Regist
                                         }
                                         );
 
-                                    TweenMatFloat tweenMatFloat = materialUnit.CreateTweenMatFloat(1, 0, 1, true, true, Curve.EaseOutQuad, false);
+                                    FlowerCardMatTween = materialUnit.CreateTweenMatFloat(1, 0, 1, true, true, Curve.EaseOutQuad, false);
 
-                                    tweenMatFloat.OnForwardStart = () =>
+                                    FlowerCardMatTween.OnForwardStart = () =>
                                     {
                                         materialUnit.Transform.GetComponent<Image>().material = materialUnit.Material;
                                     };
 
-                                    tweenMatFloat.OnForwardFinish = () =>
+                                    FlowerCardMatTween.OnForwardFinish = () =>
                                     {
                                         ManaReso.Get<Image>("H_Icon2").material = null;
                                     };

+ 4 - 13
Assets/Script/Manage/ManaServer.cs

@@ -64,16 +64,7 @@ public class ManaServer : Regist
             }
             else
             {
-                if (ManaTutorial.ConnectExemptAmt > 0)
-                {
-                    ManaTutorial.ConnectExemptAmt--;
-
-                    return true;
-                }
-                else
-                {
-                    return false;
-                }
+                return ManaTutorial.ConnectExempt;
             }
         }
         set { Connect_ = value; }
@@ -142,9 +133,9 @@ public class ManaServer : Regist
 
         //URLRequestData urlData = new URLRequestData();
 
-        //urlData.Add("u", "1704189794672324513");
+        //urlData.Add("u", "D8G4W5");
 
-        //URLRequest.CreateStrURLRequest(NewBaseURL + "/user/load", urlData, Debug.Log, URLRequest.Method.POST);
+        //URLRequest.CreateStrURLRequest(BaseURL + "/user/load", urlData, Debug.Log, URLRequest.Method.POST);
 
 
         //URLRequestData urlData = new URLRequestData();
@@ -256,7 +247,7 @@ public class ManaServer : Regist
         (
             BaseURL + "/user/nickname",
             urlData,
-            (data) =>
+            data =>
             {
                 if (data == "{\"error\":0}")
                 {

+ 10 - 2
Assets/Script/Manage/ManaTutorial.cs

@@ -84,6 +84,14 @@ public class ManaTutorial : Regist
 
     #endregion
 
+    public void Update()
+    {
+        if (Input.GetKeyDown(KeyCode.Space))
+        {
+            Debug.Log(ConnectExemptAmt);
+        }
+    }
+
     public override void Instantiate()
     {
         if (TutorialA)
@@ -266,7 +274,7 @@ public class ManaTutorial : Regist
         ManaPlayer.Player.SetAllCollider(true);
 
         PayExemptAmt = 0;
-        ConnectExemptAmt = 0;
+        ConnectExempt = false;
     }
 
 
@@ -714,7 +722,7 @@ public class ManaTutorial : Regist
             EventType.BackwardFinish,
             () =>
             {
-                ConnectExemptAmt = 1;
+                ConnectExempt = true;
 
                 Tutorial.HightScreen(ManaReso.Get("F_Arrow0"), ManaReso.Get("F_Skill1"));
             }

+ 8 - 8
Assets/Script/Manage/ManaVisit.cs

@@ -888,17 +888,17 @@ public class ManaVisit : Regist
                 ShowFailPanel();
             }
         }
-        else
-        {
-            LoadComplete = true;
+        //else
+        //{
+        //    LoadComplete = true;
 
-            XmlStr = CreateArchive();
+        //    XmlStr = CreateArchive();
 
-            Document = new XmlDocument();
-            Document.LoadXml(XmlStr);
+        //    Document = new XmlDocument();
+        //    Document.LoadXml(XmlStr);
 
-            EnterVisiteeGarden();
-        }
+        //    EnterVisiteeGarden();
+        //}
     }
 
     public static void PullArchiveCallback(JsonData jsonData, Action failed, Action<JsonData> succeed)

+ 35 - 29
Assets/Script/Tool/Auxiliary.cs

@@ -140,34 +140,40 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.Z))
         {
-			//ManaPlayer.Player.LeftHandSlot._displayDirty
-
-//			Dictionary<string,SkinSlotData> slots = ManaPlayer.Player.LeftLegSlot.armature.armatureData.GetSkin("__default").slots;
-//
-//			foreach(var skinSlotData in slots){
-//				Debug.Log(skinSlotData.Key+" "+skinSlotData.Value);			
-//			}
-
-//			MeshData meshdata = ManaPlayer.Player.LeftLegSlot.armature.armatureData.GetSkin("__default").slots["左腿"].meshs["腿2个提供1个"];
-//
-//			for(int i = 0; i < meshdata.uvs.Count; i++){
-//				meshdata.uvs[i] += 0.1f;
-//			}
-
-//			ManaPlayer.Player.LeftLegSlot._displayData.texture = UnityFactory.factory.GetTextureAtlasData("stand_ske")[0].textures["脑壳1"];
-//
-//			ManaPlayer.Player.LeftLegSlot._updateDisplayData();
-//			ManaPlayer.Player.LeftLegSlot._displayDirty=true;
-
-//			Mesh mesh = ManaPlayer.Player.transform.FindChild("Armature/左腿").GetComponent<MeshFilter>().mesh;
-//
-//			Vector2[] newUV = mesh.uv;
-//
-//			for(int i = 0; i < newUV.Length; i++){
-//				newUV[i] += new Vector2(-0.1f,-0.1f);
-//			}
-//				
-//			mesh.uv = newUV;
+            byte[] bytes = Encoding.UTF8.GetBytes(ManaData.PlayerDoc.OuterXml);
+
+            MD5 md5 = new MD5CryptoServiceProvider();
+
+            PlayerPrefs.SetString("config", ToString(md5.ComputeHash(bytes)));
+
+            //ManaPlayer.Player.LeftHandSlot._displayDirty
+
+            //			Dictionary<string,SkinSlotData> slots = ManaPlayer.Player.LeftLegSlot.armature.armatureData.GetSkin("__default").slots;
+            //
+            //			foreach(var skinSlotData in slots){
+            //				Debug.Log(skinSlotData.Key+" "+skinSlotData.Value);			
+            //			}
+
+            //			MeshData meshdata = ManaPlayer.Player.LeftLegSlot.armature.armatureData.GetSkin("__default").slots["左腿"].meshs["腿2个提供1个"];
+            //
+            //			for(int i = 0; i < meshdata.uvs.Count; i++){
+            //				meshdata.uvs[i] += 0.1f;
+            //			}
+
+            //			ManaPlayer.Player.LeftLegSlot._displayData.texture = UnityFactory.factory.GetTextureAtlasData("stand_ske")[0].textures["脑壳1"];
+            //
+            //			ManaPlayer.Player.LeftLegSlot._updateDisplayData();
+            //			ManaPlayer.Player.LeftLegSlot._displayDirty=true;
+
+            //			Mesh mesh = ManaPlayer.Player.transform.FindChild("Armature/左腿").GetComponent<MeshFilter>().mesh;
+            //
+            //			Vector2[] newUV = mesh.uv;
+            //
+            //			for(int i = 0; i < newUV.Length; i++){
+            //				newUV[i] += new Vector2(-0.1f,-0.1f);
+            //			}
+            //				
+            //			mesh.uv = newUV;
 
             //ManaReso.Get("C_Group").TweenBacCG();
 
@@ -201,7 +207,7 @@ public class Auxiliary : Regist
 
             ManaMiniGame.Score += 400;
 
-            ManaSign.SignTime = new DateTime(2007, 1, 1);
+            //ManaSign.SignTime = new DateTime(2007, 1, 1);
         }
 
         //if (Input.GetKeyDown(KeyCode.M))

+ 3 - 0
Assets/Script/Tool/DashGame/Logo.cs

@@ -17,6 +17,9 @@ public class Logo : MonoBehaviour
     public void Awake()
     {
         Camera = GameObject.Find("Main Camera");
+        
+        ManaAudio.InitAudioSettingFromPlayerPrefs();
+        ManaAudio.SetLogoVolume();
     }
 
     public void Begin()

+ 3 - 3
ProjectSettings/GraphicsSettings.asset

@@ -43,13 +43,13 @@ GraphicsSettings:
     type: 0}
   m_TierSettings_Tier1:
     renderingPath: 1
-    useCascadedShadowMaps: 0
+    useCascadedShadowMaps: 1
   m_TierSettings_Tier2:
     renderingPath: 1
-    useCascadedShadowMaps: 0
+    useCascadedShadowMaps: 1
   m_TierSettings_Tier3:
     renderingPath: 1
-    useCascadedShadowMaps: 0
+    useCascadedShadowMaps: 1
   m_DefaultRenderingPath: 1
   m_DefaultMobileRenderingPath: 1
   m_TierSettings: []

+ 3 - 8
ToDoList.txt

@@ -1,16 +1,11 @@
-教程A的Bug
-
-新旧版存取档交叉
-
-每过段时间就要在本地存一次档
-
 开一次游戏音乐Bgm都会自动开起来
 
-在别人花园点击访问时红色桃心马上被刷白了
 
 访问点赞延迟的情况
 
-用短码取不到最新存档
+在别人花园点击访问时红色桃心马上被刷白了
+
+服务器新旧版存取档兼容
 
 
 关闭调试模式