LiuQilin 8 anos atrás
pai
commit
7067fb7051

BIN
.vs/MyLovelyGarden/v14/.suo


BIN
Assets/Resources/Prefab/PrefabUI/Canvas.prefab


+ 2 - 2
Assets/Resources/Sprite/SpriteUI/领取按钮.png.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: d190acd69d12a114c851133dbcb7c5f7
-timeCreated: 1489398582
+timeCreated: 1489460413
 licenseType: Pro
 TextureImporter:
   fileIDToRecycleName: {}
@@ -39,7 +39,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spriteBorder: {x: 70, y: 0, z: 70, w: 0}
+  spriteBorder: {x: 70, y: 65, z: 70, w: 65}
   spritePixelsToUnits: 100
   alphaUsage: 1
   alphaIsTransparency: 1

+ 0 - 9
Assets/Resources/Temp.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 0dcf62c8561c02f479195703efe90da2
-folderAsset: yes
-timeCreated: 1486173350
-licenseType: Pro
-DefaultImporter:
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 19 - 31
Assets/Resources/XML/Config/PlayerConfig.xml

@@ -1,24 +1,12 @@
 <PlayerConfig>
-  <Coin value="50" />
+  <Coin value="0" />
   <Level value="0" />
   <Person value="1" />
-  <Diamond value="4000" />
-  <QuitTime value="3/13/2017 5:42:29 PM" />
+  <Diamond value="0" />
+  <QuitTime value="3/14/2017 10:56:16 AM" />
   <CoinPerson value="1" />
-  <PlantList>
-    <FlowerTraA1 Id="1" />
-    <FlowerTraA2 Id="2" />
-    <FlowerTraA3 Id="3" />
-    <FlowerTraA4 Id="4" />
-    <FlowerTraA5 Id="5" />
-    <FlowerTraA6 Id="6" />
-    <FlowerTraA7 Id="7" />
-    <FlowerTraA8 Id="8" />
-    <FlowerTraA9 Id="9" />
-    <FlowerTraB1 Id="10" />
-    <FlowerTraB2 Id="11" />
-    <FlowerTraB3 Id="12" />
-  </PlantList>
+  <CircleTimer value="0" />
+  <PlantList FlowerTraA1="1" FlowerTraA2="2" FlowerTraA3="3" FlowerTraA4="4" FlowerTraA5="5" FlowerTraA6="6" FlowerTraA7="7" FlowerTraA8="8" FlowerTraA9="9" FlowerTraB1="0" FlowerTraB2="0" FlowerTraB3="0" FlowerTraB4="0" FlowerTraB5="0" FlowerTraB6="0" FlowerTraB7="0" FlowerTraB8="0" FlowerTraB9="0"/>
   <FlowerList>
     <Flower Id="1" />
     <Flower Id="2" />
@@ -34,37 +22,37 @@
     <Flower Id="12" />
   </FlowerList>
   <SkillList>
-    <免费获取金币 SkillCato="Skill" ItemStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
-    <免费获取钻石 SkillCato="Skill" ItemStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <免费获取金币 SkillCato="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
+    <免费获取钻石 SkillCato="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
     <技能冷却 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
-    <花园 SkillCato="Ability" ItemStatus="Upgrade" Level="0" />
+    <花园 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <繁花似锦 SkillCato="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
     <黄色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <人潮涌动 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
     <紫色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="金币大礼包" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="金币大礼包" ItemStatus="Lock" Level="0" />
     <礼包 SkillCato="Pack" Name="新手礼包" ItemStatus="Lock" Level="0" />
     <大亨光临 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
-    <礼包 SkillCato="Pack" Name="天赐大礼包" ItemStatus="Buy" Level="0" />
-    <礼包 SkillCato="Pack" Name="中级礼包" ItemStatus="Buy" Level="2" />
+    <礼包 SkillCato="Pack" Name="天赐大礼包" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="中级礼包" ItemStatus="Lock" Level="0" />
     <蓝色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="高级礼包" ItemStatus="Buy" Level="0" />
-    <礼包 SkillCato="Pack" Name="花神大礼包" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="高级礼包" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="花神大礼包" ItemStatus="Lock" Level="0" />
     <红色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <花之祝福 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
     <白色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <炼金石 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石100" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石100" ItemStatus="Lock" Level="0" />
     <黄色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石500 赠送50" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石500 赠送50" ItemStatus="Lock" Level="0" />
     <神秘灌木 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <紫色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石2000 赠送500" ItemStatus="Buy" Level="0" />
-    <滴哩哩的小黄鹂 SkillCato="Ability" ItemStatus="Upgrade" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石2000 赠送500" ItemStatus="Lock" Level="0" />
+    <滴哩哩的小黄鹂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <蓝色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石6000 赠送600" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石6000 赠送600" ItemStatus="Lock" Level="0" />
     <红色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石10000 赠送2000" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石10000 赠送2000" ItemStatus="Lock" Level="0" />
     <白色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
   </SkillList>
 </PlayerConfig>

+ 68 - 25
Assets/Script/Manage/ManaData.cs

@@ -18,6 +18,8 @@ public class ManaData : MonoBehaviour
 
             UpdateSkillStatus();
 
+            Data.SaveConfig("Level", _Level.ToString());
+
             ManaLog.Log(string.Format("已升级 花园等级 : <color=red>{0}</color>", _Level));
         }
     }
@@ -29,6 +31,8 @@ public class ManaData : MonoBehaviour
             _Person = value;
 
             ManaReso.SetText("F_PersonLab", _Person.ToString("0"));
+
+            Data.SaveConfig("Person", _Person.ToString("0"));
         }
     }
     public static float CoinPerson
@@ -39,6 +43,8 @@ public class ManaData : MonoBehaviour
             _CoinPerson = value;
 
             ManaReso.SetText("F_CoinPersonLab", _CoinPerson.ToString("0"));
+
+            Data.SaveConfig("CoinPerson", _CoinPerson.ToString("0"));
         }
     }
     public static double Coin
@@ -50,6 +56,8 @@ public class ManaData : MonoBehaviour
 
             ManaReso.SetText("F_CoinLab", _Coin.ToString("0"));
             ManaReso.SetText("C_CoinLab", _Coin.ToString("0"));
+
+            Data.SaveConfig("Coin", _Coin.ToString("0"));
         }
     }
     public static double Diamond
@@ -60,6 +68,8 @@ public class ManaData : MonoBehaviour
             _Diamond = value;
 
             ManaReso.SetText("F_DiamondLab", _Diamond.ToString("0"));
+
+            Data.SaveConfig("Diamond", _Diamond.ToString("0"));
         }
     }
 
@@ -69,20 +79,21 @@ public class ManaData : MonoBehaviour
     private static double _Coin;
     private static double _Diamond;
 
-    public static float Circle; //收入周期
     public static bool SkillBarValid; //是否有已解锁的大技能
+    public static double Circle; //收入周期
+    public static double CircleTimer;
+    public static double OfflineCoin; //离线收入
     public static List<Skill> CoolList; //冷却中的技能
     public static List<SkillRoot> SkillList;
     public static List<SkillRoot> ProcessList; //正在使用的技能
     public static Dictionary<string, SkillRoot> SkillDic;
 
-    public static float SkillPlus;
     public static float SkillPerson; //技能增益
+    public static float SkillPlusPerm; //技能增益
+    public static float SkillPlusTemp; //技能增益
     public static float SkillPersonBuff; //技能增益
     public static float SkillCoinPerson; //技能增益
-    public static float SkillCoinPersonBuff; //技能增益
 
-    private static float Timer;
     private static float NewPerson;
     private static float NewCoinPerson;
 
@@ -158,19 +169,21 @@ public class ManaData : MonoBehaviour
     {
         #region 计算参观收益
 
-        Timer += Time.deltaTime;
+        CircleTimer -= Time.deltaTime;
 
-        if (Timer >= Circle)
+        if (CircleTimer < 0)
         {
-            Timer = 0;
+            CircleTimer = Circle;
 
             NewPerson = Person*(1 + SkillPersonBuff) + SkillPerson;
-            NewCoinPerson = CoinPerson*(1 + SkillCoinPersonBuff) + SkillCoinPerson;
+            NewCoinPerson = CoinPerson + SkillCoinPerson;
             
-            float income = (NewPerson*NewCoinPerson*Circle)*(1 + SkillPlus);
+            double income = (NewPerson*NewCoinPerson*Circle)*(1 + SkillPlusPerm);
             Coin += income;
 
-            ManaLog.Log(string.Format("参观收益<color=red>{0}</color> = <color=red>{1}</color> * <color=red>{2}</color> * <color=red>{3}</color> * <color=red>{4}</color> (人次*金币*时间*加成)", income, NewPerson, NewCoinPerson, Circle, 1 + SkillPlus));
+            Data.SaveConfig("QuitTime", DateTime.Now.ToString());
+
+            ManaLog.Log(string.Format("参观收益<color=red>{0}</color> = <color=red>{1}</color> * <color=red>{2}</color> * <color=red>{3}</color> * <color=red>{4}</color> (人次*金币*时间*加成)", income, NewPerson, NewCoinPerson, Circle, 1 + SkillPlusPerm));
         }
 
         #endregion
@@ -219,6 +232,16 @@ public class ManaData : MonoBehaviour
                 skill.EffectTimer = float.Parse(xmlNodeList[i].Attributes[4].Value);
                 skill.ItemSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value);
             }
+            else if (xmlNodeList[i].Attributes[0].Value == SkillCato.BigSkill.ToString())
+            {
+                BigSkill bigSkill = (BigSkill)SkillDic[xmlNodeList[i].Name];
+
+                bigSkill.Level = int.Parse(xmlNodeList[i].Attributes[3].Value);
+                bigSkill.CdTimer = float.Parse(xmlNodeList[i].Attributes[4].Value);
+                bigSkill.EffectTimer = float.Parse(xmlNodeList[i].Attributes[5].Value);
+                bigSkill.ItemSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value); //Sa0
+                bigSkill.BarSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[2].Value); //Sa1
+            }
             else if (xmlNodeList[i].Attributes[0].Value == SkillCato.Pack.ToString())
             {
                 Pack pack = (Pack)SkillDic[xmlNodeList[i].Attributes[1].Value];
@@ -233,16 +256,6 @@ public class ManaData : MonoBehaviour
                 ability.Level = int.Parse(xmlNodeList[i].Attributes[2].Value);
                 ability.ItemSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value);
             }
-            else if (xmlNodeList[i].Attributes[0].Value == SkillCato.BigSkill.ToString())
-            {
-                BigSkill bigSkill = (BigSkill)SkillDic[xmlNodeList[i].Name];
-
-                bigSkill.Level = int.Parse(xmlNodeList[i].Attributes[3].Value);
-                bigSkill.CdTimer = float.Parse(xmlNodeList[i].Attributes[4].Value);
-                bigSkill.EffectTimer = float.Parse(xmlNodeList[i].Attributes[5].Value);
-                bigSkill.ItemSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value); //Sa0
-                bigSkill.BarSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[2].Value); //Sa1
-            }
             else
             {
                 throw new Exception();
@@ -258,12 +271,15 @@ public class ManaData : MonoBehaviour
 
         #region 读取已种植的花
 
-        xmlNodeList = Data.PlayerNode.SelectSingleNode("PlantList").ChildNodes;
-        for (int i = 0; i < xmlNodeList.Count; i++)
+        XmlAttributeCollection attributes = Data.PlayerNode.SelectSingleNode("PlantList").Attributes;
+        for (int i = 0; i < attributes.Count; i++)
         {
-            int id = int.Parse(xmlNodeList[i].Attributes[0].Value);
+            int id = int.Parse(attributes[i].Value);
 
-            ManaGarden.PlaceFlower(id, ManaReso.Get(xmlNodeList[i].Name));
+            if (id != 0)
+            {
+                ManaGarden.PlaceFlower(id, ManaReso.Get(attributes[i].Name));
+            }
         }
 
         #endregion
@@ -290,10 +306,37 @@ public class ManaData : MonoBehaviour
         #endregion
 
         Coin = double.Parse(Data.PlayerNode.SelectSingleNode("Coin").Attributes[0].Value);
+        Level = int.Parse(Data.PlayerNode.SelectSingleNode("Level").Attributes[0].Value);
         Circle = 10;
         Diamond = double.Parse(Data.PlayerNode.SelectSingleNode("Diamond").Attributes[0].Value);
+        OfflineCoin = 0;
 
-        Level = int.Parse(Data.PlayerNode.SelectSingleNode("Level").Attributes[0].Value);
+        #region 离线期间的收入
+        
+        double elapse = DateTime.Now.Subtract(DateTime.Parse(Data.PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value)).TotalSeconds; //离开时间
+
+        if (elapse > CircleTimer)
+        {
+            elapse -= CircleTimer;
+
+            int offlineCircle = 1 + Mathf.FloorToInt((float) (elapse/Circle)); //离线周期
+            
+            for (int i = 0; i < SkillList.Count; i++)
+            {
+                SkillList[i].CollectOfflineCoin(offlineCircle);
+            }
+
+            OfflineCoin += (Person * CoinPerson * Circle * offlineCircle) * (1 + SkillPlusPerm);
+        }
+        else
+        {
+            CircleTimer -= elapse;
+        }
+
+        Coin += OfflineCoin;
+        ManaReso.SetText("A_IconLab", OfflineCoin.ToString("0"));
+        
+        #endregion
     }
 
     private void RegistReference()

+ 2 - 3
Assets/Script/Manage/ManaUI.cs

@@ -56,7 +56,7 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("B_Info", true);
                 ManaReso.SetActive("B_Confirm", true);
 
-                ManaUI.SeleDateItem.GetChild(1).SetActive(true);
+                SeleDateItem.GetChild(1).SetActive(true);
                 ManaData.Coin += 1500;
             }
         );
@@ -69,7 +69,7 @@ public class ManaUI : MonoBehaviour
 
         Transform tra = ManaReso.Get("B_Grid");
 
-        ManaReso.GetDateItem(tra);
+        SeleDateItem = ManaReso.GetDateItem(tra);
         ManaReso.GetDateItem(tra);
         ManaReso.GetDateItem(tra);
         ManaReso.GetDateItem(tra);
@@ -86,7 +86,6 @@ public class ManaUI : MonoBehaviour
             "B_Confirm",
             () =>
             {
-
                 ManaReso.Get("Game").Forward(TweenType.CG);
                 ManaReso.Get("B_SignIn").Backward(TweenType.CG);
             }

+ 22 - 16
Assets/Script/Object/Skill/Ability.cs

@@ -132,33 +132,39 @@ public class Ability : SkillRoot
         NewCoinPerson = CoinPerson;
         NewUpgradeAmt = UpgradeAmt;
 
-        if (!string.IsNullOrEmpty(UpgradeFml))
+        if (ItemSkillStatus == SkillStatus.Upgrade)
         {
-            for (int i = 0; i < Level; i++)
+            if (!string.IsNullOrEmpty(UpgradeFml))
             {
-                NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+                for (int i = 0; i < Level; i++)
+                {
+                    NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+                }
             }
-        }
 
-        UpgradeValue(ref NewPlus, Plus, UpgradePlus, Level);
-        UpgradeValue(ref NewSkillCdBuff, UpgradeCD, Level);
-        UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, Level);
+            UpgradeValue(ref NewPlus, Plus, UpgradePlus, Level);
+            UpgradeValue(ref NewSkillCdBuff, UpgradeCD, Level);
+            UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, Level);
 
-        UpgradeValue(ref NewPerson, Person, UpgradePerson, Level);
-        UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
-        UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
+            UpgradeValue(ref NewPerson, Person, UpgradePerson, Level);
+            UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
+            UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
 
-        ItemTit.text = Name;
-        ItemLab.text = GetDescription(0);
-        ItemBtn.onClick.AddListener(OnClick);
+            ItemTit.text = Name;
+            ItemLab.text = GetDescription(0);
+            ItemBtn.onClick.AddListener(OnClick);
 
-        if (ItemSkillStatus == SkillStatus.Upgrade)
-        {
             Effect();
+
             ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
         }
     }
 
+    public override void CollectOfflineCoin(int offlineCircle)
+    {
+
+    }
+
     public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
     {
         
@@ -341,7 +347,7 @@ public class Ability : SkillRoot
             ManaData.SkillCoinPerson += CoinPerson;
         }
 
-        ManaData.SkillPlus += NewPlus;
+        ManaData.SkillPlusPerm += NewPlus;
         ManaData.SkillPersonBuff += NewPersonBuff;
 
         if (Math.Abs(NewSkillCD) > 0.0005f)

+ 2 - 2
Assets/Script/Object/Skill/BigSkill.cs

@@ -148,7 +148,7 @@ public class BigSkill : Skill
 
         BarLab.text = string.Format("{0} : {1}", timeSpan.Minutes, timeSpan.Seconds);
 
-        BarBk0.fillAmount = CdTimer / CD;
+        BarBk0.fillAmount = (float)CdTimer / CD;
 
         if (CdTimer <= 0)
         {
@@ -463,7 +463,7 @@ public class BigSkill : Skill
         BarLab.color = new Color(1, 1, 1, 1);
         BarSkillStatus = SkillStatus.CD;
 
-        ManaData.SkillPlus -= NewPlus;
+        ManaData.SkillPlusPerm -= NewPlus;
         ManaData.SkillPerson -= NewPerson;
         ManaData.SkillPersonBuff -= NewPersonBuff;
         ManaData.SkillCoinPerson -= NewCoinPerson;

+ 6 - 1
Assets/Script/Object/Skill/Pack.cs

@@ -107,6 +107,11 @@ public class Pack : SkillRoot
         }
     }
 
+    public override void CollectOfflineCoin(int offlineCircle)
+    {
+        
+    }
+
     public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
     {
         
@@ -244,7 +249,7 @@ public class Pack : SkillRoot
 
     protected void Effect()
     {
-        ManaData.SkillPlus += Plus;
+        ManaData.SkillPlusPerm += Plus;
         ManaData.SkillPerson += Person;
         ManaData.SkillPersonBuff += PersonBuff;
         ManaData.SkillCoinPerson += CoinPerson;

+ 13 - 4
Assets/Script/Object/Skill/Skill.cs

@@ -53,8 +53,8 @@ public class Skill : SkillRoot
 
     #endregion
 
-    public float CdTimer; //冷却计时
-    public float EffectTimer; //冷却计时
+    public double CdTimer; //冷却计时
+    public double EffectTimer; //冷却计时
 
     protected float NewPlus;
     protected float NewPerson;
@@ -210,6 +210,15 @@ public class Skill : SkillRoot
         }
     } //读取配置时调用
 
+    public override void CollectOfflineCoin(int offlineCircle)
+    {
+        float newPerson = ManaData.Person * NewPersonBuff + NewPerson;
+        float newCoinPerson = ManaData.CoinPerson + NewCoinPerson;
+        double income = (newPerson * newCoinPerson * offlineCircle * ManaData.Circle ) * (1 + NewPlus + ManaData.SkillPlusPerm);
+
+        ManaData.OfflineCoin += income;
+    }
+
     public virtual bool Cool()
     {
         CdTimer -= Time.deltaTime;
@@ -556,7 +565,7 @@ public class Skill : SkillRoot
         ItemBtnLab.color = new Color(1, 1, 1, 1);
         ItemSkillStatus = SkillStatus.CD;
 
-        ManaData.SkillPlus -= NewPlus;
+        ManaData.SkillPlusPerm -= NewPlus;
         ManaData.SkillPerson -= NewPerson;
         ManaData.SkillPersonBuff -= NewPersonBuff;
         ManaData.SkillCoinPerson -= NewCoinPerson;
@@ -598,8 +607,8 @@ public class Skill : SkillRoot
 
     protected void Effect()
     {
-        ManaData.SkillPlus += NewPlus;
         ManaData.SkillPerson += NewPerson;
+        ManaData.SkillPlusTemp += NewPlus;
         ManaData.SkillPersonBuff += NewPersonBuff;
         ManaData.SkillCoinPerson += NewCoinPerson;
 

+ 1 - 0
Assets/Script/Object/Skill/SkillRoot.cs

@@ -93,6 +93,7 @@ public abstract class SkillRoot : IComparable
     public abstract void Initialize();
     public abstract void ReceiveCool(float amt, bool isCurrent, bool isBuff); //接受技能冷却
     public abstract void OnLevelChange();
+    public abstract void CollectOfflineCoin(int offlineCircle);
     public abstract bool CountDown();
 
     #region 解读器

+ 44 - 12
Assets/Script/Tool/Auxiliary.cs

@@ -27,6 +27,7 @@ public class Auxiliary : MonoBehaviour
             if (_Des == null)
             {
                 _Des = new DESCryptoServiceProvider();
+                _Des.IV = Encoding.UTF8.GetBytes("12345678");
                 _Des.Key = Encoding.UTF8.GetBytes("12345678");
             }
 
@@ -79,22 +80,20 @@ public class Auxiliary : MonoBehaviour
 
     public static byte[] Encrypt(string str)
     {
-        byte[] rawData = Encoding.UTF8.GetBytes(str);
-        byte[] encryptData = Des.CreateEncryptor().TransformFinalBlock(rawData, 0, rawData.Length);
+        byte[] bytes = Encoding.UTF8.GetBytes(str);
+        byte[] encryptBytes = Des.CreateEncryptor().TransformFinalBlock(bytes, 0, bytes.Length);
 
-        FileStream fileStream = new FileStream(@"C:\Users\Administrator\Desktop\Test.txt", FileMode.Create);
-        fileStream.Write(encryptData, 0, encryptData.Length);
-        fileStream.Close();
-
-        return encryptData;
+        return encryptBytes;
     }
 
-    //public static string Decrypt()
-    //{
-    //    byte[] decryptData = Des.CreateDecryptor().TransformFinalBlock(encryptData, 0, encryptData.Length);
+    public static string Decrypt(string str)
+    {
+        byte[] encryptBytes = ToBytes(str);
+        byte[] decryptBytes = Des.CreateDecryptor().TransformFinalBlock(encryptBytes, 0, encryptBytes.Length);
+
+        return Encoding.UTF8.GetString(decryptBytes);
+    }
 
-    //    return Encoding.UTF8.GetString(decryptData);
-    //}
 
     public static void CompileDic(Transform tra, Dictionary<string, Transform> dic)
     {
@@ -112,4 +111,37 @@ public class Auxiliary : MonoBehaviour
             }
         }
     }
+
+    public static byte[] ToBytes(string str)
+    {
+        string[] strings = str.Split(' ');
+
+        byte[] bytes = new byte[strings.Length];
+
+        for (int i = 0; i < bytes.Length; i++)
+        {
+            bytes[i] = byte.Parse(strings[i]);
+        }
+
+        return bytes;
+    }
+
+    public static string ToString(byte[] bytes)
+    {
+        StringBuilder strB = new StringBuilder();
+
+        for (int i = 0; i < bytes.Length; i++)
+        {
+            if (i == bytes.Length - 1)
+            {
+                strB.Append(bytes[i]);
+            }
+            else
+            {
+                strB.Append(bytes[i] + " ");
+            }
+        }
+
+        return strB.ToString();
+    }
 }

+ 8 - 1
Assets/Script/Tool/Data.cs

@@ -45,6 +45,11 @@ public class Data
 
     #endregion
 
+    public static void SaveConfig(string nodeName, string value)
+    {
+        PlayerNode.SelectSingleNode(nodeName).Attributes[0].Value = value;
+    }
+
     public static void SavePlayerConfig()
     {
         XmlNode xmlNode;
@@ -58,6 +63,7 @@ public class Data
         PlayerNode.SelectSingleNode("Diamond").Attributes[0].Value = ManaData.Diamond.ToString();
         PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value = DateTime.Now.ToString();
         PlayerNode.SelectSingleNode("CoinPerson").Attributes[0].Value = ManaData.CoinPerson.ToString();
+        PlayerNode.SelectSingleNode("CircleTimer").Attributes[0].Value = ManaData.CircleTimer.ToString();
 
         #endregion
 
@@ -223,8 +229,9 @@ public class Data
         PlayerNode.SelectSingleNode("Level").Attributes[0].Value = "0";
         PlayerNode.SelectSingleNode("Person").Attributes[0].Value = "1";
         PlayerNode.SelectSingleNode("Diamond").Attributes[0].Value = "0";
-        PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value = "";
+        PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value = DateTime.Now.ToString();
         PlayerNode.SelectSingleNode("CoinPerson").Attributes[0].Value = "1";
+        PlayerNode.SelectSingleNode("CircleTimer").Attributes[0].Value = "0";
 
         #endregion
 

+ 1 - 1
MyLovelyGarden.csproj

@@ -98,6 +98,7 @@
   <ItemGroup>
     <Compile Include="Assets\Script\Manage\Initializer.cs" />
     <Compile Include="Assets\Script\Manage\Logo.cs" />
+    <Compile Include="Assets\Script\Manage\Main.cs" />
     <Compile Include="Assets\Script\Manage\ManaAnim.cs" />
     <Compile Include="Assets\Script\Manage\ManaData.cs" />
     <Compile Include="Assets\Script\Manage\ManaGarden.cs" />
@@ -117,7 +118,6 @@
     <Compile Include="Assets\Script\Object\Skill\BigSkill.cs" />
     <Compile Include="Assets\Script\Object\Skill\Pack.cs" />
     <Compile Include="Assets\Script\Object\Skill\Skill.cs" />
-    <Compile Include="Assets\Script\Object\Skill\SkillProcessor.cs" />
     <Compile Include="Assets\Script\Object\Skill\SkillRoot.cs" />
     <Compile Include="Assets\Script\Tool\Anim\Move.cs" />
     <Compile Include="Assets\Script\Tool\Anim\Tween.cs" />

+ 13 - 16
MyLovelyGarden.sln

@@ -1,9 +1,9 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2008
-
-Project("{8A8BB0A8-D809-F2DF-89D6-F26151FFF558}") = "MyLovelyGarden", "Assembly-CSharp.csproj", "{21BB93BC-2239-D8F5-1219-201F8DCBAF49}"
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2015
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLovelyGarden", "MyLovelyGarden.csproj", "{9F3A3259-D53B-F6C8-8878-C5B99621035A}"
 EndProject
-Project("{8A8BB0A8-D809-F2DF-89D6-F26151FFF558}") = "MyLovelyGarden", "Assembly-CSharp-Editor.csproj", "{A08052E5-32CE-91C0-FF56-C60C901D6BEF}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLovelyGarden.Editor", "MyLovelyGarden.Editor.csproj", "{B575449E-FD9A-1672-368B-EC1E1252F6E4}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,19 +11,16 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{21BB93BC-2239-D8F5-1219-201F8DCBAF49}.Release|Any CPU.Build.0 = Release|Any CPU
-		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{A08052E5-32CE-91C0-FF56-C60C901D6BEF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9F3A3259-D53B-F6C8-8878-C5B99621035A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B575449E-FD9A-1672-368B-EC1E1252F6E4}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
-	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = Assembly-CSharp.csproj
-	EndGlobalSection
 EndGlobal

+ 1 - 5
MyLovelyGarden.txt

@@ -1,7 +1,3 @@
-GameInfo九宫格
-
-FmlParse增加offset功能
-
 Xml(变量赋值、字体、文本内容、Hud颜色、Hud速度、Message颜色、按钮图片)
 
 声音(按钮声音 背景音乐)
@@ -19,7 +15,7 @@ SpritePacker
 
 RaycastTarget
 
-开启加密并确定密匙
+使用加密和签名
 
 DisableButton的颜色
 

BIN
ProjectSettings/GraphicsSettings.asset