LiuQilin 8 years ago
parent
commit
cc58ced241

BIN
.vs/MyLovelyGarden/v14/.suo


BIN
Assets/Resource/Prefab/Object/DebugMode.prefab


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

@@ -1,8 +1,8 @@
 <PlayerConfig>
-  <Version value="426" />
+  <Version value="429" />
 
   <ID value="Default" />
-////  <TutorialA value="1" />
+////  <TutorialA value="0" />
 ////  <TutorialB value="1" />
 ////  <TutorialC value="1" />
   <TutorialIndexA value="1" />

+ 27 - 11
Assets/Script/Manage/ManaData.cs

@@ -38,7 +38,6 @@ public class ManaData
 
                 XmlNode node;
                 XmlDocument nativeDoc = new XmlDocument();
-                XmlDocument bundleDoc = new XmlDocument();
 
                 string configPath = Application.persistentDataPath + "/PlayerConfig.xml";
 
@@ -56,9 +55,9 @@ public class ManaData
                     
                     TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
 
-                    bundleDoc.LoadXml(textAsset.text);
+                    DefaultDoc.LoadXml(textAsset.text);
                     
-                    version = int.Parse(bundleDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
+                    version = int.Parse(DefaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value);
                     
                     node = nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version");
 
@@ -66,11 +65,11 @@ public class ManaData
                     {
                         StreamWriter sw = new StreamWriter(Application.persistentDataPath + "/PlayerConfig.xml");
 
-                        sw.Write(bundleDoc.OuterXml);
+                        sw.Write(DefaultDoc.OuterXml);
 
                         sw.Close();
 
-                        PlayerDoc_ = bundleDoc;
+                        PlayerDoc_ = DefaultDoc;
                     }
                     else
                     {
@@ -80,11 +79,11 @@ public class ManaData
                         {
                             StreamWriter sw = new StreamWriter(Application.persistentDataPath + "/PlayerConfig.xml");
 
-                            sw.Write(bundleDoc.OuterXml);
+                            sw.Write(DefaultDoc.OuterXml);
 
                             sw.Close();
 
-                            PlayerDoc_ = bundleDoc;
+                            PlayerDoc_ = DefaultDoc;
                         }
                         else
                         {
@@ -112,11 +111,23 @@ public class ManaData
                 {
                     TextAsset textAsset = ManaReso.Load<TextAsset>("PlayerConfig", Folder.Config);
 
-                    PlayerDoc_ = new XmlDocument();
+                    DefaultDoc.LoadXml(textAsset.text);
 
-                    PlayerDoc_.LoadXml(textAsset.text);
-                    
-                    PlayerDoc_.SelectSingleNode("PlayerConfig").SelectSingleNode("QuitTime").Attributes[0].Value = DateTime.Now.ToString();
+                    if (!string.IsNullOrEmpty(PlayerPrefs.GetString("id")))
+                    {
+                        Debug.LogWarning("Damage");
+                        ManaDebug.Log("Damage");
+
+                        DamageLock = true;
+
+                        ManaServer.Download(PlayerPrefs.GetString("id"), RecoveXml);
+
+                        return null;
+                    }
+                    else
+                    {
+                        PlayerDoc_ = DefaultDoc;
+                    }
                 }
             }
 
@@ -129,6 +140,7 @@ public class ManaData
     public static XmlDocument PlayerDoc_;
 
     public static bool DamageLock;
+    public static XmlDocument DefaultDoc = new XmlDocument();
 
     #endregion
 
@@ -163,6 +175,8 @@ public class ManaData
             PlayerDoc_ = new XmlDocument();
 
             PlayerDoc_.LoadXml(jsonData["l"].ToString());
+            
+            SavePlayerInt("Version", int.Parse(DefaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value));
         }
         else
         {
@@ -414,6 +428,8 @@ public class ManaData
 
     public static void ResetPlayerConfig()
     {
+        PlayerPrefs.SetString("id", "");
+
         PlayerNode.SelectSingleNode("Version").Attributes[0].Value = "0";
 
         SavePlayerConfig();

+ 10 - 11
Assets/Script/Manage/ManaVisit.cs

@@ -36,9 +36,9 @@ public class ManaVisit
     public static XmlNode Node;
     public static XmlDocument Document;
 
-    public static bool Bird;
-    public static bool Tree;
-    public static bool Rainbow;
+    public static bool OriginBird;
+    public static bool OriginTree;
+    public static bool OriginRainbow;
     public static List<Slot> VisitPlantList;
     public static List<Slot> OriginPlantList;
     public static List<ObjType> OriginElfList;
@@ -126,6 +126,7 @@ public class ManaVisit
 
     public static void Exit()
     {
+        Debug.LogError("A");
         ManaReso.Get("I_BlackMask").TweenForCG();
 
         ManaReso.SetActive("C_Visit", true);
@@ -187,7 +188,7 @@ public class ManaVisit
 
         #region Bird Tree Rainbow
 
-        if (Bird)
+        if (OriginBird)
         {
             ManaReso.Get("Bird0").GetTweenSr().InDestination = true;
         }
@@ -196,7 +197,7 @@ public class ManaVisit
             ManaReso.Get("Bird0").GetTweenSr().InOrigin = true;
         }
 
-        if (Tree)
+        if (OriginTree)
         {
             ManaReso.Get("Tree1").GetTweenSr().InDestination = true;
             ManaReso.Get("Tree2").GetTweenSr().InDestination = true;
@@ -207,7 +208,7 @@ public class ManaVisit
             ManaReso.Get("Tree2").GetTweenSr().InOrigin = true;
         }
 
-        if (Rainbow)
+        if (OriginRainbow)
         {
             ManaReso.Get("Rainbow").GetTweenSr().InDestination = true;
         }
@@ -274,17 +275,17 @@ public class ManaVisit
         {
             if (ManaReso.Get("Bird0").gameObject.activeSelf)
             {
-                Bird = true;
+                OriginBird = true;
             }
 
             if (ManaReso.Get("Tree1").gameObject.activeSelf)
             {
-                Tree = true;
+                OriginTree = true;
             }
 
             if (ManaReso.Get("Rainbow").gameObject.activeSelf)
             {
-                Rainbow = true;
+                OriginRainbow = true;
             }
         }
 
@@ -301,8 +302,6 @@ public class ManaVisit
 
         if (!InVisit)
         {
-            ManaData.SavePlantList();
-
             OriginElfList = new List<ObjType>(ManaGarden.ElfList);
         }
 

+ 4 - 0
Assets/Script/Tool/Anim/TweenVec.cs

@@ -56,6 +56,8 @@ public class TweenVec : TweenRoot
                 {
                     Target.position = Origin;
                 }
+
+                BackwardFinish();
             }
         }
     }
@@ -109,6 +111,8 @@ public class TweenVec : TweenRoot
                 {
                     Target.position = Destination;
                 }
+
+                ForwardFinish();
             }
         }
     }

+ 1 - 7
ToList.txt

@@ -1,16 +1,10 @@
-注册Bug
-
-存花的Bug
+种花、存花的Bug (参观时切换后台 参观时退出游戏)
 
 
 分享图片报错
 
 从Hierrarchy视图中检查是否有Bug
 
-清空存档时也要清空PlayerPreb中的ID
-
-如果存档被删除了就重新下载一次(检查PlayerPreb中的ID来判断是否是第一次登录)
-
 发布前把服务器中的存档清理一次