Przeglądaj źródła

Update 3.25 10:43

LiuQilin 8 lat temu
rodzic
commit
567aeb4091

BIN
.vs/MyLovelyGarden/v14/.suo


+ 46 - 0
Assets/Resources/XML/Config/PlayerConfig.xml

@@ -0,0 +1,46 @@
+<PlayerConfig>
+  <Sign value="0" />
+  <Coin value="0" />
+  <Level value="0" />
+  <Person value="0" />
+  <Diamond value="0" />
+  <QuitTime value="3/24/2017 10:40:04 PM" />
+  <CoinPerson value="0" />
+  <CircleTimer value="0" />
+  <PlantList FlowerTraA1="1" FlowerTraA2="2" FlowerTraA3="3" FlowerTraA4="4" FlowerTraA5="5" FlowerTraA6="6" FlowerTraA7="7" FlowerTraA8="8" FlowerTraA9="9" />
+  <FlowerList ID="1 2 3 4 5 6 7 8 9 10" />
+  <SkillList>
+    <免费获取金币 SkillType="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
+    <免费获取钻石 SkillType="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
+    <技能冷却 SkillType="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <花园 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <繁花似锦 SkillType="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
+    <黄色小蜜蜂 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <人潮涌动 SkillType="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <紫色小蜜蜂 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="金币大礼包" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="新手礼包" ItemStatus="Lock" Level="0" />
+    <大亨光临 SkillType="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <礼包 SkillType="Pack" Name="天赐大礼包" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="中级礼包" ItemStatus="Lock" Level="0" />
+    <蓝色小蜜蜂 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="高级礼包" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="花神大礼包" ItemStatus="Lock" Level="0" />
+    <红色小蜜蜂 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <花之祝福 SkillType="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <白色小蜜蜂 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <缤纷彩虹 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="钻石100" ItemStatus="Lock" Level="0" />
+    <黄色小蝴蝶 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="钻石500 赠送50" ItemStatus="Lock" Level="0" />
+    <玉树樱花 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <紫色小蝴蝶 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="钻石2000 赠送500" ItemStatus="Lock" Level="0" />
+    <滴哩哩的小黄鹂 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <蓝色小蝴蝶 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="钻石6000 赠送600" ItemStatus="Lock" Level="0" />
+    <红色小蝴蝶 SkillType="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillType="Pack" Name="钻石10000 赠送2000" ItemStatus="Lock" Level="0" />
+    <白色小蝴蝶 SkillType="Ability" ItemStatus="Lock" Level="0" />
+  </SkillList>
+</PlayerConfig>

+ 8 - 0
Assets/Resources/XML/Config/PlayerConfig.xml.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: bebfbae5c4c7bf2428d24381bef74d56
+timeCreated: 1490407010
+licenseType: Pro
+TextScriptImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -20,58 +20,6 @@ public class Initializer : MonoBehaviour
 
     private void Start()
     {
-        StartCoroutine(IStart());
-    }
-
-    private IEnumerator IStart()
-    {
-        string path;
-        WWW www;
-
-        FileInfo fileInfo = new FileInfo(Application.persistentDataPath + "/PlayerConfig.xml");
-
-        if (fileInfo.Exists)
-        {
-            if (Application.platform == RuntimePlatform.Android)
-            {
-                path = "file://" + Application.persistentDataPath + "/PlayerConfig.xml";
-            }
-            else
-            {
-                path = "file:///" + Application.persistentDataPath + "/PlayerConfig.xml";
-            }
-
-            www = new WWW(path);
-
-            yield return www;
-        }
-        else
-        {
-            if (Application.platform == RuntimePlatform.Android)
-            {
-                path = Application.streamingAssetsPath + "/PlayerConfig.xml";
-            }
-            else
-            {
-                path = "file:///" + Application.streamingAssetsPath + "/PlayerConfig.xml";
-            }
-
-            www = new WWW(path);
-
-            yield return www;
-
-            StreamWriter sw = new StreamWriter(Application.persistentDataPath + "/PlayerConfig.xml");
-
-            sw.Write(www.text);
-
-            sw.Close();
-        }
-
-        Data.PlayerDoc = new XmlDocument();
-        Data.PlayerDoc.LoadXml(www.text);
-
-        Data.PlayerNode = Data.PlayerDoc.SelectSingleNode("PlayerConfig");
-
         RegistList = new List<Regist>();
 
         gameObject.AddScript<ManaReso>();

+ 34 - 4
Assets/Script/Tool/DashGame/Logo.cs

@@ -1,10 +1,40 @@
-using UnityEngine;
+using System;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
 using System.Collections;
 
-public class Logo : MonoBehaviour {
+public class Logo : MonoBehaviour
+{
+    #region
+
+    public bool LoadComplete;
+
+    #endregion
+
+    private void Start()
+    {
+        StartCoroutine(Load());
+    }
+
+
+    private IEnumerator Load()
+    {
+        AsyncOperation async = SceneManager.LoadSceneAsync(1);
+
+        async.allowSceneActivation = false;
+
+        while (!LoadComplete || Math.Abs(async.progress - 0.9f) > 0.0005f)
+        {
+            yield return null;
+        }
+
+        async.allowSceneActivation = true;
+    }
+
 
     public void complete()
     {
-        UnityEngine.SceneManagement.SceneManager.LoadScene("Garden");
+        LoadComplete = true;
     }
-}
+}

+ 54 - 4
Assets/Script/Tool/Data.cs

@@ -11,8 +11,58 @@ public class Data
 {
     #region
 
-    public static XmlNode PlayerNode;
-    public static XmlDocument PlayerDoc;
+    public static XmlNode PlayerNode
+    {
+        get
+        {
+            if (_PlayerNode == null)
+            {
+                _PlayerNode = PlayerDoc.SelectSingleNode("PlayerConfig");
+            }
+
+            return _PlayerNode;
+        }
+        set { _PlayerNode = value; }
+    }
+    public static XmlDocument PlayerDoc
+    {
+        get
+        {
+            if (_PlayerDoc == null)
+            {
+                FileInfo fileInfo = new FileInfo(Application.persistentDataPath + "/PlayerConfig.xml");
+
+                if (fileInfo.Exists)
+                {
+                    StreamReader sr = new StreamReader(Application.persistentDataPath + "/PlayerConfig.xml");
+
+                    _PlayerDoc = new XmlDocument();
+                    _PlayerDoc.LoadXml(sr.ReadToEnd());
+
+                    sr.Close();
+                }
+                else
+                {
+                    TextAsset textAsset = (TextAsset)Resources.Load(@"XML\Config\PlayerConfig");
+
+                    _PlayerDoc = new XmlDocument();
+                    _PlayerDoc.LoadXml(textAsset.text);
+
+                    StreamWriter sw = new StreamWriter(Application.persistentDataPath + "/PlayerConfig.xml");
+
+                    sw.Write(_PlayerDoc.OuterXml);
+
+                    sw.Close();
+                }
+            }
+
+            return _PlayerDoc;
+        }
+        set { _PlayerDoc = value; }
+    }
+
+    public static XmlNode _PlayerNode;
+    public static XmlDocument _PlayerDoc;
 
     #endregion
 
@@ -339,10 +389,10 @@ public class Data
         PlayerNode.SelectSingleNode("Sign").Attributes[0].Value = "0";
         PlayerNode.SelectSingleNode("Coin").Attributes[0].Value = "0";
         PlayerNode.SelectSingleNode("Level").Attributes[0].Value = "0";
-        PlayerNode.SelectSingleNode("Person").Attributes[0].Value = "1";
+        PlayerNode.SelectSingleNode("Person").Attributes[0].Value = "0";
         PlayerNode.SelectSingleNode("Diamond").Attributes[0].Value = "0";
         PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value = DateTime.Now.ToString();
-        PlayerNode.SelectSingleNode("CoinPerson").Attributes[0].Value = "1";
+        PlayerNode.SelectSingleNode("CoinPerson").Attributes[0].Value = "0";
         PlayerNode.SelectSingleNode("CircleTimer").Attributes[0].Value = "0";
     }
 

+ 1 - 1
MyLovelyGarden.Editor.csproj

@@ -158,6 +158,7 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\Resources\Shader\Gray.shader" />
+    <None Include="Assets\Resources\XML\Config\PlayerConfig.xml" />
     <None Include="Assets\Resources\XML\Config\XMLFile1.xml" />
     <None Include="Assets\Resources\XML\Config\ability_config.xml" />
     <None Include="Assets\Resources\XML\Config\flower_config.xml" />
@@ -169,7 +170,6 @@
     <None Include="Assets\Resources\XML\lan\ChineseSimplified.xml" />
     <None Include="Assets\Resources\XML\lan\ChineseTraditional.xml" />
     <None Include="Assets\Resources\XML\lan\English.xml" />
-    <None Include="Assets\StreamingAssets\PlayerConfig.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />

+ 1 - 1
MyLovelyGarden.csproj

@@ -152,6 +152,7 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\Resources\Shader\Gray.shader" />
+    <None Include="Assets\Resources\XML\Config\PlayerConfig.xml" />
     <None Include="Assets\Resources\XML\Config\XMLFile1.xml" />
     <None Include="Assets\Resources\XML\Config\ability_config.xml" />
     <None Include="Assets\Resources\XML\Config\flower_config.xml" />
@@ -163,7 +164,6 @@
     <None Include="Assets\Resources\XML\lan\ChineseSimplified.xml" />
     <None Include="Assets\Resources\XML\lan\ChineseTraditional.xml" />
     <None Include="Assets\Resources\XML\lan\English.xml" />
-    <None Include="Assets\StreamingAssets\PlayerConfig.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />

+ 1 - 5
MyLovelyGarden.txt

@@ -1,8 +1,4 @@
-异步加载场景
-
-找不到存档时怎么办
-
-不同设备下的存档
+优化
 
 技能使用时间处在边缘时有Bug
 

BIN
ProjectSettings/ProjectSettings.asset