LiuQilin 8 éve
szülő
commit
c74b8b70b3
33 módosított fájl, 1285 hozzáadás és 842 törlés
  1. BIN
      .vs/MyLovelyGarden/v14/.suo
  2. BIN
      Assets/Resources/Prefab/PrefabUI/Canvas.prefab
  3. BIN
      Assets/Resources/Sprite/SpriteUI/4大技能3.png
  4. 0 68
      Assets/Resources/Sprite/SpriteUI/4大技能3.png.meta
  5. 0 0
      Assets/Resources/Sprite/SpriteUI/Skill/4大技能4.png
  6. 2 2
      Assets/Resources/Sprite/SpriteUI/Skill/4大技能4.png.meta
  7. BIN
      Assets/Resources/Sprite/SpriteUI/Skill/4大技能4da.png
  8. 2 2
      Assets/Resources/Sprite/SpriteUI/Skill/4大技能4da.png.meta
  9. 0 0
      Assets/Resources/Sprite/SpriteUI/大技能背景.png
  10. 2 2
      Assets/Resources/Sprite/SpriteUI/大技能背景.png.meta
  11. 2 2
      Assets/Resources/Sprite/SpriteUI/领取按钮.png.meta
  12. 9 0
      Assets/Resources/Temp.meta
  13. 63 34
      Assets/Resources/XML/Config/PlayerConfig.xml
  14. 2 2
      Assets/Resources/XML/Config/pack_config.xml
  15. 1 1
      Assets/Resources/XML/Config/skill_config.xml
  16. 12 0
      Assets/Script/Manage/Main.cs
  17. 2 2
      Assets/Script/Manage/Main.cs.meta
  18. 121 81
      Assets/Script/Manage/ManaData.cs
  19. 9 31
      Assets/Script/Manage/ManaGarden.cs
  20. 11 0
      Assets/Script/Manage/ManaUI.cs
  21. 1 0
      Assets/Script/Object/Flower.cs
  22. 184 86
      Assets/Script/Object/Skill/Ability.cs
  23. 228 78
      Assets/Script/Object/Skill/BigSkill.cs
  24. 106 33
      Assets/Script/Object/Skill/Pack.cs
  25. 233 89
      Assets/Script/Object/Skill/Skill.cs
  26. 0 209
      Assets/Script/Object/Skill/SkillProcessor.cs
  27. 13 10
      Assets/Script/Object/Skill/SkillRoot.cs
  28. 2 7
      Assets/Script/Tool/Auxiliary.cs
  29. 263 83
      Assets/Script/Tool/Data.cs
  30. BIN
      Assets/XlsxSource/skill_config.xlsx
  31. 16 13
      MyLovelyGarden.sln
  32. 1 7
      MyLovelyGarden.txt
  33. BIN
      ProjectSettings/GraphicsSettings.asset

BIN
.vs/MyLovelyGarden/v14/.suo


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


BIN
Assets/Resources/Sprite/SpriteUI/4大技能3.png


+ 0 - 68
Assets/Resources/Sprite/SpriteUI/4大技能3.png.meta

@@ -1,68 +0,0 @@
-fileFormatVersion: 2
-guid: 7263dc99ffca50b4380276bb1f05c3d7
-timeCreated: 1487721800
-licenseType: Pro
-TextureImporter:
-  fileIDToRecycleName: {}
-  serializedVersion: 4
-  mipmaps:
-    mipMapMode: 0
-    enableMipMap: 0
-    sRGBTexture: 1
-    linearTexture: 0
-    fadeOut: 0
-    borderMipMap: 0
-    mipMapFadeDistanceStart: 1
-    mipMapFadeDistanceEnd: 3
-  bumpmap:
-    convertToNormalMap: 0
-    externalNormalMap: 0
-    heightScale: 0.25
-    normalMapFilter: 0
-  isReadable: 0
-  grayScaleToAlpha: 0
-  generateCubemap: 6
-  cubemapConvolution: 0
-  seamlessCubemap: 0
-  textureFormat: 1
-  maxTextureSize: 2048
-  textureSettings:
-    filterMode: -1
-    aniso: -1
-    mipBias: -1
-    wrapMode: 1
-  nPOTScale: 0
-  lightmap: 0
-  compressionQuality: 50
-  spriteMode: 1
-  spriteExtrude: 1
-  spriteMeshType: 1
-  alignment: 0
-  spritePivot: {x: 0.5, y: 0.5}
-  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
-  spritePixelsToUnits: 100
-  alphaUsage: 1
-  alphaIsTransparency: 1
-  spriteTessellationDetail: -1
-  textureType: 8
-  textureShape: 1
-  maxTextureSizeSet: 0
-  compressionQualitySet: 0
-  textureFormatSet: 0
-  platformSettings:
-  - buildTarget: DefaultTexturePlatform
-    maxTextureSize: 2048
-    textureFormat: -1
-    textureCompression: 1
-    compressionQuality: 50
-    crunchedCompression: 0
-    allowsAlphaSplitting: 0
-    overridden: 0
-  spriteSheet:
-    serializedVersion: 2
-    sprites: []
-    outline: []
-  spritePackingTag: 
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 0
Assets/Resources/Sprite/SpriteUI/四大技能4.png → Assets/Resources/Sprite/SpriteUI/Skill/4大技能4.png


+ 2 - 2
Assets/Resources/Sprite/SpriteUI/四大技能2.png.meta → Assets/Resources/Sprite/SpriteUI/Skill/4大技能4.png.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 602004bdc16507549a8d91276b9a66a2
-timeCreated: 1487721800
+guid: 70b51e41db9c4b84e8c084b13a4c228a
+timeCreated: 1489384390
 licenseType: Pro
 TextureImporter:
   fileIDToRecycleName: {}

BIN
Assets/Resources/Sprite/SpriteUI/四大技能2.png → Assets/Resources/Sprite/SpriteUI/Skill/4大技能4da.png


+ 2 - 2
Assets/Resources/Sprite/SpriteUI/4大技能1.png.meta → Assets/Resources/Sprite/SpriteUI/Skill/4大技能4da.png.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 501e1555b4700c64da1fe2a11815fc0a
-timeCreated: 1487721800
+guid: 50a1f7a48c4036f4da811dd54cd1bc23
+timeCreated: 1489384390
 licenseType: Pro
 TextureImporter:
   fileIDToRecycleName: {}

+ 0 - 0
Assets/Resources/Sprite/SpriteUI/4大技能1.png → Assets/Resources/Sprite/SpriteUI/大技能背景.png


+ 2 - 2
Assets/Resources/Sprite/SpriteUI/四大技能4.png.meta → Assets/Resources/Sprite/SpriteUI/大技能背景.png.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 0a1b347f66c52584cba93e34f9ad6126
-timeCreated: 1487721798
+guid: 5d5a33dd53e644745bf6b450e30cbf3f
+timeCreated: 1489384390
 licenseType: Pro
 TextureImporter:
   fileIDToRecycleName: {}

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

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

+ 9 - 0
Assets/Resources/Temp.meta

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

+ 63 - 34
Assets/Resources/XML/Config/PlayerConfig.xml

@@ -1,41 +1,70 @@
 <PlayerConfig>
-  <Coin value="0" />
+  <Coin value="50" />
   <Level value="0" />
   <Person value="1" />
-  <Diamond value="0" />
-  <QuitTime value="" />
+  <Diamond value="4000" />
+  <QuitTime value="3/13/2017 5:42:29 PM" />
   <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>
-  <Skill>
-    <免费获取钻石 status="Lock" level="0" />
-    <免费获取金币 status="Lock" level="0" />
-    <繁花似锦 status="Lock" level="0" />
-  </Skill>
-  <Ability>
-    <黄色小蜜蜂 status="Lock" level="0" />
-    <花园 status="Lock" level="0" />
-    <紫色小蜜蜂 status="Lock" level="0" />
-    <蓝色小蜜蜂 status="Lock" level="0" />
-    <红色小蜜蜂 status="Lock" level="0" />
-    <白色小蜜蜂 status="Lock" level="0" />
-    <炼金石 status="Lock" level="0" />
-    <黄色小蝴蝶 status="Lock" level="0" />
-    <神秘灌木 status="Lock" level="0" />
-    <紫色小蝴蝶 status="Lock" level="0" />
-    <滴哩哩的小黄鹂 status="Lock" level="0" />
-    <蓝色小蝴蝶 status="Lock" level="0" />
-    <红色小蝴蝶 status="Lock" level="0" />
-    <白色小蝴蝶 status="Lock" level="0" />
-  </Ability>
-  <BigSkill>
-    <技能冷却 status="Lock" level="0" />
-    <人潮涌动 status="Lock" level="0" />
-    <大亨光临 status="Lock" level="0" />
-    <花之祝福 status="Lock" level="0" />
-  </BigSkill>
-  <CoolList>
-  </CoolList>
-  <ProcessorList>
-  </ProcessorList>
+  <FlowerList>
+    <Flower Id="1" />
+    <Flower Id="2" />
+    <Flower Id="3" />
+    <Flower Id="4" />
+    <Flower Id="5" />
+    <Flower Id="6" />
+    <Flower Id="7" />
+    <Flower Id="8" />
+    <Flower Id="9" />
+    <Flower Id="10" />
+    <Flower Id="11" />
+    <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="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <花园 SkillCato="Ability" ItemStatus="Upgrade" 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="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="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="高级礼包" ItemStatus="Buy" Level="0" />
+    <礼包 SkillCato="Pack" Name="花神大礼包" ItemStatus="Buy" 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="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石500 赠送50" ItemStatus="Buy" 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="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石6000 赠送600" ItemStatus="Buy" Level="0" />
+    <红色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石10000 赠送2000" ItemStatus="Buy" Level="0" />
+    <白色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
+  </SkillList>
 </PlayerConfig>

+ 2 - 2
Assets/Resources/XML/Config/pack_config.xml

@@ -2,8 +2,8 @@
   <item id="1" name="金币大礼包" class="3" class_id="2" coin_person="" person="" skill_cd="" coin="500" diamond="500" flower="500" use_lv="" use_cur="2" use_amnt="200" desc="立即获得金币 [&amp;coin&amp;]" icon="绿-金币包1" anim="" label="" />
   <item id="2" name="天赐大礼包" class="3" class_id="3" coin_person="" person="" skill_cd="" coin="" diamond="" flower="" use_lv="" use_cur="2" use_amnt="400" desc="立即获得金币 [&amp;coin&amp;]" icon="绿-金币包2" anim="" label="" />
   <item id="3" name="花神大礼包" class="3" class_id="4" coin_person="" person="" skill_cd="" coin="15000" diamond="" flower="" use_lv="" use_cur="2" use_amnt="800" desc="立即获得金币 [&amp;coin&amp;]" icon="绿-金币包3" anim="" label="" />
-  <item id="4" name="新手礼包" class="4" class_id="2" coin_person="110%" person="" skill_cd="" coin="" diamond="500" flower="10" use_lv="50,150" use_cur="3" use_amnt="6" desc="获得[&amp;flower&amp;],[&amp;diamond&amp;]钻石&#xA;所有金币产出提升[&amp;coin_person&amp;],永久有效" icon="蓝-初级包" anim="" label="" />
-  <item id="5" name="中级礼包" class="4" class_id="3" coin_person="110%" person="" skill_cd="" coin="" diamond="2000" flower="11" use_lv="" use_cur="3" use_amnt="30" desc="获得[&amp;flower&amp;],[&amp;diamond&amp;]钻石&#xA;所有金币产出提升[&amp;coin_person&amp;],永久有效" icon="蓝-中级包" anim="" label="" />
+  <item id="4" name="新手礼包" class="4" class_id="2" coin_person="" person="1" skill_cd="" coin="" diamond="" flower="10" use_lv="50,150" use_cur="3" use_amnt="6" desc="获得[&amp;flower&amp;],[&amp;diamond&amp;]钻石&#xA;所有金币产出提升[&amp;coin_person&amp;],永久有效" icon="蓝-初级包" anim="" label="" />
+  <item id="5" name="中级礼包" class="4" class_id="3" coin_person="" person="1" skill_cd="" coin="" diamond="2000" flower="" use_lv="" use_cur="3" use_amnt="30" desc="获得[&amp;flower&amp;],[&amp;diamond&amp;]钻石&#xA;所有金币产出提升[&amp;coin_person&amp;],永久有效" icon="蓝-中级包" anim="" label="" />
   <item id="6" name="高级礼包" class="4" class_id="4" coin_person="110%" person="" skill_cd="" coin="" diamond="4000" flower="12" use_lv="" use_cur="3" use_amnt="68" desc="获得[&amp;flower&amp;],[&amp;diamond&amp;]钻石&#xA;所有金币产出提升[&amp;coin_person&amp;],永久有效" icon="蓝-高级包" anim="" label="" />
   <item id="7" name="钻石100" class="4" class_id="5" coin_person="" person="" skill_cd="" coin="" diamond="100" flower="" use_lv="" use_cur="3" use_amnt="6" desc="购买 [&amp;diamond&amp;]钻石" icon="蓝-免费钻" anim="" label="" />
   <item id="8" name="钻石500 赠送50" class="4" class_id="6" coin_person="" person="" skill_cd="" coin="" diamond="550" flower="" use_lv="" use_cur="3" use_amnt="30" desc="共计 [&amp;diamond&amp;]钻石" icon="蓝-免费钻" anim="" label="热卖" />

+ 1 - 1
Assets/Resources/XML/Config/skill_config.xml

@@ -1,5 +1,5 @@
 <data>
-  <item id="1" name="人潮涌动" class="1" class_id="2" skill_index="1" reduce_cd="1" coin_person="" person="1" coin_once="" diamond_once="" skill_cd="" duration="10" cd="1800" unlock_lv="100" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="" use__cur="" use_amnt="" upgrade_cur="1" upgrade_amnt="200" upgrade_fml="a" upgrade_plus="" upgrade_person="" upgrade_coin_once="" upgrade_duration="60" upgrade_cd="" desc="每分钟增加[&amp;person&amp;*60],持续[&amp;duration&amp;/60][lv]分钟" icon="4大技能1" anim="" label="" />
+  <item id="1" name="人潮涌动" class="1" class_id="2" skill_index="1" reduce_cd="1" coin_person="" person="1" coin_once="" diamond_once="" skill_cd="" duration="100" cd="1800" unlock_lv="10" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="" use__cur="" use_amnt="" upgrade_cur="1" upgrade_amnt="200" upgrade_fml="a" upgrade_plus="" upgrade_person="" upgrade_coin_once="" upgrade_duration="60" upgrade_cd="" desc="每分钟增加[&amp;person&amp;*60],持续[&amp;duration&amp;/60][lv]分钟" icon="4大技能1" anim="" label="" />
   <item id="2" name="大亨光临" class="1" class_id="3" skill_index="2" reduce_cd="1" coin_person="" person="" coin_once="50000%" diamond_once="" skill_cd="" duration="" cd="3600" unlock_lv="100" unlock_ahead_cur="2" unlock_ahead_amt="200" unlock_cur="" unlock_amnt="" unlock_pos="" use__cur="" use_amnt="" upgrade_cur="2" upgrade_amnt="300" upgrade_fml="a" upgrade_plus="" upgrade_person="" upgrade_coin_once="5000%" upgrade_duration="" upgrade_cd="" desc="" icon="4大技能2" anim="" label="" />
   <item id="3" name="花之祝福" class="1" class_id="4" skill_index="3" reduce_cd="1" coin_person="500%" person="" coin_once="" diamond_once="" skill_cd="" duration="300" cd="3600" unlock_lv="300" unlock_ahead_cur="2" unlock_ahead_amt="300" unlock_cur="" unlock_amnt="" unlock_pos="" use__cur="" use_amnt="" upgrade_cur="2" upgrade_amnt="300" upgrade_fml="a" upgrade_plus="" upgrade_person="" upgrade_coin_once="" upgrade_duration="60" upgrade_cd="" desc="" icon="4大技能3" anim="" label="" />
   <item id="4" name="繁花似锦" class="4" class_id="1" skill_index="" reduce_cd="" coin_person="200%" person="" coin_once="" diamond_once="" skill_cd="" duration="900" cd="900" unlock_lv="100" unlock_ahead_cur="2" unlock_ahead_amt="100" unlock_cur="" unlock_amnt="" unlock_pos="" use__cur="2" use_amnt="150" upgrade_cur="" upgrade_amnt="" upgrade_fml="" upgrade_plus="" upgrade_person="" upgrade_coin_once="" upgrade_duration="" upgrade_cd="" desc="" icon="绿-繁花似锦" anim="" label="" />

+ 12 - 0
Assets/Script/Manage/Main.cs

@@ -0,0 +1,12 @@
+using UnityEngine;
+
+using System.Collections;
+using System.Collections.Generic;
+
+public class Main : MonoBehaviour
+{
+	private void Awake()
+	{
+	    gameObject.AddComponent<Initializer>();
+	}
+}

+ 2 - 2
Assets/Script/Object/Skill/SkillProcessor.cs.meta → Assets/Script/Manage/Main.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 5204744056706714090029ae97e4ffea
-timeCreated: 1487766958
+guid: f7796f0fa55028349853861ea4ed0cb7
+timeCreated: 1489398833
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 121 - 81
Assets/Script/Manage/ManaData.cs

@@ -69,20 +69,18 @@ public class ManaData : MonoBehaviour
     private static double _Coin;
     private static double _Diamond;
 
-    public static bool SkillBarValid; //是否有已解锁的大技能
-    public static List<Skill> SkillList;
-    public static List<Skill> CoolList; //冷却技能
-    public static List<Pack> PackList;
-    public static List<Ability> AbilityList;
-    public static List<BigSkill> BigSkillList;
-    public static List<SkillProcessor> ProcessorList;
-
-    public static float Plus;
     public static float Circle; //收入周期
-    public static float PersonBuff;
-    public static float CoinPersonBuff;
-    public static float TempPerson;
-    public static float TempCoinPerson;
+    public static bool SkillBarValid; //是否有已解锁的大技能
+    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 SkillPersonBuff; //技能增益
+    public static float SkillCoinPerson; //技能增益
+    public static float SkillCoinPersonBuff; //技能增益
 
     private static float Timer;
     private static float NewPerson;
@@ -95,14 +93,12 @@ public class ManaData : MonoBehaviour
         Initializer.RegistValue += RegistValue;
         Initializer.RegistReference += RegistReference;
         
-        #region 获取技能信息
+        #region 获取技能
 
-        SkillList = new List<Skill>();
+        SkillDic = new Dictionary<string, SkillRoot>();
+        SkillList = new List<SkillRoot>();
         CoolList = new List<Skill>();
-        PackList = new List<Pack>();
-        AbilityList = new List<Ability>();
-        BigSkillList = new List<BigSkill>();
-        ProcessorList = new List<SkillProcessor>();
+        ProcessList = new List<SkillRoot>();
 
         List<XmlAttributeCollection> attributesList = Data.GetSkillConfig();
 
@@ -110,21 +106,29 @@ public class ManaData : MonoBehaviour
         {
             if (attributesList[i].Count == 17) //Pack配置
             {
-                PackList.Add(new Pack(attributesList[i]));
+                Pack pack = new Pack(attributesList[i]);
+                SkillList.Add(pack);
+                SkillDic.Add(pack.Name, pack);
             }
             else if (attributesList[i].Count == 23) //Ability配置
             {
-                AbilityList.Add(new Ability(attributesList[i]));
+                Ability ability = new Ability(attributesList[i]);
+                SkillList.Add(ability);
+                SkillDic.Add(ability.Name, ability);
             }
             else if (attributesList[i].Count == 33) //Skill配置
             {
                 if (string.IsNullOrEmpty(attributesList[i][4].Value)) //普通Skill
                 {
-                    SkillList.Add(new Skill(attributesList[i]));
+                    Skill skill = new Skill(attributesList[i]);
+                    SkillList.Add(skill);
+                    SkillDic.Add(skill.Name, skill);
                 }
                 else //BigSkill
                 {
-                    BigSkillList.Add(new BigSkill(attributesList[i]));
+                    BigSkill bigSkill = new BigSkill(attributesList[i]);
+                    SkillList.Add(bigSkill);
+                    SkillDic.Add(bigSkill.Name, bigSkill);
                 }
             }
             else
@@ -134,9 +138,6 @@ public class ManaData : MonoBehaviour
         }
 
         SkillList.Sort();
-        PackList.Sort();
-        AbilityList.Sort();
-        BigSkillList.Sort();
 
         #endregion
 
@@ -150,30 +151,6 @@ public class ManaData : MonoBehaviour
             }
         }
 
-        for (int i = 0; i < PackList.Count; i++)
-        {
-            if (PackList[i].Class != SkillClass.Null)
-            {
-                ManaReso.GetSkillItem(PackList[i]);
-            }
-        }
-
-        for (int i = 0; i < AbilityList.Count; i++)
-        {
-            if (AbilityList[i].Class != SkillClass.Null)
-            {
-                ManaReso.GetSkillItem(AbilityList[i]);
-            }
-        }
-
-        for (int i = 0; i < BigSkillList.Count; i++)
-        {
-            if (BigSkillList[i].Class != SkillClass.Null)
-            {
-                ManaReso.GetSkillItem(BigSkillList[i]);
-            }
-        }
-
         #endregion
     }
 
@@ -186,27 +163,27 @@ public class ManaData : MonoBehaviour
         if (Timer >= Circle)
         {
             Timer = 0;
+
+            NewPerson = Person*(1 + SkillPersonBuff) + SkillPerson;
+            NewCoinPerson = CoinPerson*(1 + SkillCoinPersonBuff) + SkillCoinPerson;
             
-            NewPerson = Person*(1 + PersonBuff) + TempPerson;
-            NewCoinPerson = CoinPerson * (1 + CoinPersonBuff) + TempCoinPerson;
-            
-            float income = (NewPerson*NewCoinPerson*Circle)*(1 + Plus);
+            float income = (NewPerson*NewCoinPerson*Circle)*(1 + SkillPlus);
             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 + Plus));
+            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));
         }
 
         #endregion
 
         #region 使用中的技能
 
-        for (int i = 0; i < ProcessorList.Count; i++)
+        for (int i = 0; i < ProcessList.Count; i++)
         {
-            if (ProcessorList[i].CountDown())
+            if (ProcessList[i].CountDown())
             {
-                ProcessorList[i].Annul();
+                ProcessList[i].Annul();
 
-                ProcessorList.RemoveAt(i--);
+                ProcessList.RemoveAt(i--);
             }
         }
 
@@ -228,45 +205,108 @@ public class ManaData : MonoBehaviour
 
     private void RegistValue()
     {
-        Plus = 0;
-        Coin = 0;
-        Circle = 10;
-        Diamond = 0;
-        TempPerson = 0;
-        TempCoinPerson = 0;
+        #region 读取技能状态
 
-        Person = 0; //Sa0
-        CoinPerson = 0; //Sa0
+        XmlNodeList xmlNodeList = Data.PlayerNode.SelectSingleNode("SkillList").ChildNodes;
+        for (int i = 0; i < xmlNodeList.Count; i++)
+        {
+            if (xmlNodeList[i].Attributes[0].Value == SkillCato.Skill.ToString())
+            {
+                Skill skill = (Skill)SkillDic[xmlNodeList[i].Name];
 
-        Level = 0; //Sa1
-    }
+                skill.Level = int.Parse(xmlNodeList[i].Attributes[2].Value);
+                skill.CdTimer = float.Parse(xmlNodeList[i].Attributes[3].Value);
+                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.Pack.ToString())
+            {
+                Pack pack = (Pack)SkillDic[xmlNodeList[i].Attributes[1].Value];
 
-    private void RegistReference()
-    {
+                pack.Level = int.Parse(xmlNodeList[i].Attributes[3].Value);
+                pack.ItemSkillStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[2].Value);
+            }
+            else if (xmlNodeList[i].Attributes[0].Value == SkillCato.Ability.ToString())
+            {
+                Ability ability = (Ability)SkillDic[xmlNodeList[i].Name];
 
-    }
+                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();
+            }
+        }
 
-    public static void UpdateSkillStatus()
-    {
         for (int i = 0; i < SkillList.Count; i++)
         {
-            SkillList[i].OnLevelChange();
+            SkillList[i].Initialize();
         }
 
-        for (int i = 0; i < PackList.Count; i++)
+        #endregion
+
+        #region 读取已种植的花
+
+        xmlNodeList = Data.PlayerNode.SelectSingleNode("PlantList").ChildNodes;
+        for (int i = 0; i < xmlNodeList.Count; i++)
         {
-            PackList[i].OnLevelChange();
+            int id = int.Parse(xmlNodeList[i].Attributes[0].Value);
+
+            ManaGarden.PlaceFlower(id, ManaReso.Get(xmlNodeList[i].Name));
         }
 
-        for (int i = 0; i < AbilityList.Count; i++)
+        #endregion
+
+        #region 读取花的解锁状态
+
+        xmlNodeList = Data.PlayerNode.SelectSingleNode("FlowerList").ChildNodes;
+        for (int i = 0; i < xmlNodeList.Count; i++)
         {
-            AbilityList[i].OnLevelChange();
+            int id = int.Parse(xmlNodeList[i].Attributes[0].Value);
+            FlowerInfo flowerInfo = ManaGarden.FlowerDic[id];
+            flowerInfo.Unlock = true;
+            
+            if (flowerInfo.Special)
+            {
+                ManaGarden.MyFlowerSpec++;
+            }
+            else
+            {
+                ManaGarden.MyFlowerRegu++;
+            }
         }
 
-        for (int i = 0; i < BigSkillList.Count; i++)
+        #endregion
+
+        Coin = double.Parse(Data.PlayerNode.SelectSingleNode("Coin").Attributes[0].Value);
+        Circle = 10;
+        Diamond = double.Parse(Data.PlayerNode.SelectSingleNode("Diamond").Attributes[0].Value);
+
+        Level = int.Parse(Data.PlayerNode.SelectSingleNode("Level").Attributes[0].Value);
+    }
+
+    private void RegistReference()
+    {
+
+    }
+
+
+    public static void UpdateSkillStatus()
+    {
+        for (int i = 0; i < SkillList.Count; i++)
         {
-            BigSkillList[i].OnLevelChange();
+            SkillList[i].OnLevelChange();
         }
     }
 

+ 9 - 31
Assets/Script/Manage/ManaGarden.cs

@@ -67,6 +67,15 @@ public class ManaGarden : MonoBehaviour
         {
             flowerInfo = new FlowerInfo(attributesList[i]);
 
+            if (flowerInfo.Special)
+            {
+                TotalFlowerSpec++;
+            }
+            else
+            {
+                TotalFlowerRegu++;
+            }
+
             FlowerDic.Add(flowerInfo.Id, flowerInfo);
         }
 
@@ -103,37 +112,6 @@ public class ManaGarden : MonoBehaviour
     private static void RegistValue()
     {
         SeleId = 1;
-
-        #region 生成花
-
-        int count = 0;
-        List<FlowerInfo> flowerInfoList = FlowerDic.Values.ToList();
-
-        for (int i = 0; i < flowerInfoList.Count; i++)
-        {
-            if (flowerInfoList[i].Special)
-            {
-                TotalFlowerSpec++; //Sa0
-                MyFlowerSpec++; //Sa1
-            }
-            else
-            {
-                TotalFlowerRegu++; //Sc0
-                MyFlowerRegu++; //Sc1
-            }
-
-            count++;
-            if (count > 9)
-            {
-                PlaceFlower(i+1, ManaReso.Get(string.Format("FlowerTraB{0}", count - 9)));
-            }
-            else
-            {
-                PlaceFlower(i+1, ManaReso.Get(string.Format("FlowerTraA{0}", count)));
-            }
-        }
-
-        #endregion
     }
 
     private static void RegistReference()

+ 11 - 0
Assets/Script/Manage/ManaUI.cs

@@ -298,6 +298,8 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fc_StoreTab", false);
                 ManaReso.SetActive("Fb_MagicTab", false);
                 ManaReso.SetActive("Fa_GardenTab", false);
+
+                ManaReso.SetActive("F_SkillBar", false);
             }
         );
 
@@ -319,6 +321,8 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fc_StoreTab", true);
                 ManaReso.SetActive("Fb_MagicTab", false);
                 ManaReso.SetActive("Fa_GardenTab", false);
+
+                ManaReso.SetActive("F_SkillBar", false);
             }
         );
 
@@ -340,6 +344,8 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fc_StoreTab", false);
                 ManaReso.SetActive("Fb_MagicTab", true);
                 ManaReso.SetActive("Fa_GardenTab", false);
+
+                ManaReso.SetActive("F_SkillBar", false);
             }
         );
 
@@ -361,6 +367,11 @@ public class ManaUI : MonoBehaviour
                 ManaReso.SetActive("Fc_StoreTab", false);
                 ManaReso.SetActive("Fb_MagicTab", false);
                 ManaReso.SetActive("Fa_GardenTab", true);
+
+                if (ManaData.SkillBarValid)
+                {
+                    ManaReso.SetActive("F_SkillBar", true);
+                }
             }
         );
 

+ 1 - 0
Assets/Script/Object/Flower.cs

@@ -18,6 +18,7 @@ public class FlowerInfo
 {
     public int Id;
     public int Plant; //该类花种了几朵
+    public bool Unlock;
     public bool Special;
     public string Name;
     public string Description;

+ 184 - 86
Assets/Script/Object/Skill/Ability.cs

@@ -118,33 +118,53 @@ public class Ability : SkillRoot
         ValueBuffParse(out NewSkillCD, out NewSkillCdBuff, UpgradeCD);
         ValueBuffParse(out NewCoinPerson, out NewPlus, UpgradePlus);
 
-        _ItemSkillStatus = SkillStatus.Lock; //todo 删掉这句
+        SkillCato = SkillCato.Ability;
     }
 
 
-    public override void Annul()
-    {
-        
-    }
-
-    protected override void RegistValue()
+    public override void Initialize()
     {
+        NewPlus = Plus;
+        NewPerson = Person;
+        NewSkillCD = SkillCD;
+        NewSkillCdBuff = SkillCdBuff;
+        NewPersonBuff = PersonBuff;
+        NewCoinPerson = CoinPerson;
         NewUpgradeAmt = UpgradeAmt;
 
+        if (!string.IsNullOrEmpty(UpgradeFml))
+        {
+            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 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);
 
-        ItemSkillStatus = ItemSkillStatus;
+        if (ItemSkillStatus == SkillStatus.Upgrade)
+        {
+            Effect();
+            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+        }
     }
 
-    protected override void RegistReference()
+    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
     {
         
     }
 
-
-    public void OnLevelChange()
+    public override void OnLevelChange()
     {
         if (ManaData.Level >= UnlockLv) //到达解锁等级
         {
@@ -162,6 +182,53 @@ public class Ability : SkillRoot
         }
     }
 
+    
+    protected void Unlock()
+    {
+        if (ManaData.Pay(UnlockAmt, UnlockCur))
+        {
+            Effect();
+
+            if (UpgradeCur != Current.Free) //升级类型
+            {
+                ItemSkillStatus = SkillStatus.Upgrade;
+            }
+            else
+            {
+                throw new Exception();
+            }
+
+            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+        }
+    }
+
+    protected void UnlockAhead()
+    {
+        if (ItemSkillStatus != SkillStatus.Lock)
+        {
+            ManaMessage.Show("您并不需要提前解锁", 1);
+
+            return;
+        }
+
+        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
+        {
+            Effect();
+
+            if (UpgradeCur != Current.Free) //升级类型
+            {
+                ItemSkillStatus = SkillStatus.Upgrade;
+            }
+            else
+            {
+                throw new Exception();
+            }
+
+            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+        }
+    }
+
+
     protected void OnClick()
     {
         ManaReso.Get("Fe_ManageInfo").Forward(TweenType.CG);
@@ -220,111 +287,120 @@ public class Ability : SkillRoot
         }
     }
 
-
-    protected void Unlock()
+    protected void Upgrade()
     {
-        if (ManaData.Pay(UnlockAmt, UnlockCur))
+        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
         {
-            UnlockEffect();
+            Level++;
 
-            if (UpgradeCur != Current.Free) //升级类型
-            {
-                ItemSkillStatus = SkillStatus.Upgrade;
-            }
-            else
+            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+            UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
+            UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
+            UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
+
+            UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
+            UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
+            UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
+
+            ItemLab.text = GetDescription(0);
+            ManaReso.SetText("Fe_Lab0", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", GetDescription(1));
+            ManaReso.SetText("Fe_BtnLab", string.Format("升级({0}{1:0})", UpgradeCur, NewUpgradeAmt));
+
+            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+
+            if (ItemSkillStatus == SkillStatus.Use) //更新技能效果
             {
-                throw new Exception();
+                Annul();
+                Effect();
             }
-
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
     }
 
-    protected void UnlockAhead()
+
+    public override void Annul() //注销技能
     {
-        if (ItemSkillStatus != SkillStatus.Lock)
-        {
-            ManaMessage.Show("您并不需要提前解锁", 1);
+        
+    }
 
-            return;
-        }
+    public override bool CountDown()
+    {
+        return true;
+    }
 
-        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
+    protected void Effect()
+    {
+        if (Name == "花园")
+        {
+            ManaData.Person += Person;
+            ManaData.CoinPerson += CoinPerson;
+        }
+        else
         {
-            UnlockEffect();
+            ManaData.SkillPerson += Person;
+            ManaData.SkillCoinPerson += CoinPerson;
+        }
 
-            if (UpgradeCur != Current.Free) //升级类型
+        ManaData.SkillPlus += NewPlus;
+        ManaData.SkillPersonBuff += NewPersonBuff;
+
+        if (Math.Abs(NewSkillCD) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
             {
-                ItemSkillStatus = SkillStatus.Upgrade;
+                ManaData.SkillList[i].ReceiveCool(NewSkillCD, false, false);
             }
-            else
+        }
+
+        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
             {
-                throw new Exception();
+                ManaData.SkillList[i].ReceiveCool(NewSkillCdBuff, false, true);
             }
-
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
-    }
 
+        #region 调试输出
 
-    protected void Upgrade()
-    {
-        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
-        {
-            Level++;
+        StringBuilder strb = new StringBuilder();
 
-            UpgradeEffect();
+        strb.AppendFormat("使用技能 : <color=red>{0}</color>", Name);
 
-            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
-
-            ItemLab.text = GetDescription(0);
-            ManaReso.SetText("Fe_Lab0", GetDescription(0));
-            ManaReso.SetText("Fe_Lab1", GetDescription(1));
-            ManaReso.SetText("Fe_BtnLab", string.Format("升级({0}{1:0})", UpgradeCur, NewUpgradeAmt));
+        if (Math.Abs(NewPlus) > 0.0005f)
+        {
+            strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", NewPlus * 100);
+        }
 
-            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+        if (Math.Abs(NewPerson) > 0.0005f)
+        {
+            strb.AppendFormat(" 参观人次<color=red>+{0}</color>", NewPerson);
         }
-    }
 
+        if (Math.Abs(NewPersonBuff) > 0.0005f)
+        {
+            strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", NewPersonBuff * 100);
+        }
 
-    protected void UnlockEffect()
-    {
-        SkillProcessor processor = new SkillProcessor();
-        
-        processor.Name = Name;
-        processor.SkillRoot = this;
-        processor.Duration = 0;
-        processor.IsCurrent = false;
-
-        processor.Plus = Plus;
-        processor.SkillCdBuff = SkillCdBuff;
-        processor.PersonBuff = PersonBuff;
-
-        processor.Person = Person;
-        processor.SkillCD = SkillCD;
-        processor.CoinPerson = CoinPerson;
-        
-        processor.Process();
-    }
+        if (Math.Abs(NewCoinPerson) > 0.0005f)
+        {
+            strb.AppendFormat(" 每次金币<color=red>+{0}</color>", NewCoinPerson);
+        }
 
-    protected void UpgradeEffect()
-    {
-        SkillProcessor processor = new SkillProcessor();
+        if (Math.Abs(SkillCD) > 0.0005f)
+        {
+            strb.AppendFormat(" 减少冷却上限<color=red>{0}</color>", SkillCD);
+        }
 
-        processor.Name = Name;
-        processor.SkillRoot = this;
-        processor.Duration = 0;
-        processor.IsCurrent = false;
+        if (Math.Abs(SkillCdBuff) > 0.0005f)
+        {
+            strb.AppendFormat(" 减少冷却上限<color=red>{0}%</color>", SkillCdBuff * 100);
+        }
 
-        processor.Plus = NewPlus;
-        processor.SkillCdBuff = NewSkillCdBuff;
-        processor.PersonBuff = NewPersonBuff;
+        strb.Append(" <color=red>永久有效</color>");
 
-        processor.Person = NewPerson;
-        processor.SkillCD = NewSkillCD;
-        processor.CoinPerson = NewCoinPerson;
+        ManaLog.Log(strb.ToString());
 
-        processor.Process();
+        #endregion
     }
 
     #region 解读器
@@ -401,7 +477,6 @@ public class Ability : SkillRoot
         return stringBuilder.ToString();
     } //得到说明
 
-
     protected double UpgradeAmtParse(string str)
     {
         if (string.IsNullOrEmpty(str))
@@ -414,5 +489,28 @@ public class Ability : SkillRoot
         }
     }
 
+    protected void UpgradeValue(ref float target, float baseValue, string fml, int offset)
+{
+    if (Math.Abs(target) < 0.0005f)
+    {
+        return;
+    }
+
+    if (string.IsNullOrEmpty(fml))
+    {
+
+    }
+    else if (fml.Contains("%"))
+    {
+        float step = float.Parse(fml.Replace("%", "")) / 100;
+
+        target += baseValue * step * offset;
+    }
+    else
+    {
+        target += float.Parse(fml) * offset;
+    }
+}
+
     #endregion
 }

+ 228 - 78
Assets/Script/Object/Skill/BigSkill.cs

@@ -3,6 +3,7 @@ using UnityEngine.UI;
 
 using System;
 using System.Xml;
+using System.Text;
 using System.Collections;
 using System.Collections.Generic;
 
@@ -33,7 +34,6 @@ public class BigSkill : Skill
                 BarBk0.SetActive(true);
                 BarBk1.SetActive(false);
                 
-                Timer = CD * (1 + CdBuff);
                 ManaData.CoolList.Add(this);
             }
             else if (_BarSkillStatus == SkillStatus.Buy)
@@ -83,7 +83,7 @@ public class BigSkill : Skill
             }
             else if (_BarSkillStatus == SkillStatus.Use)
             {
-                
+                ManaData.ProcessList.Add(this);
             }
             else
             {
@@ -117,7 +117,7 @@ public class BigSkill : Skill
             {
                 ItemBtnLab.text = string.Format("升级");
 
-                TryActivate();
+                BarSkillStatus = SkillStatus.Buy;
             }
             else
             {
@@ -132,21 +132,41 @@ public class BigSkill : Skill
 
     public BigSkill(XmlAttributeCollection attributes) : base(attributes)
     {
+        Initializer.RegistReference += RegistReference;
+
         SkillIndex = IntParse(attributes[4].Value);
+
+        SkillCato = SkillCato.BigSkill;
     }
 
 
-    public override void Annul()
+    public override bool Cool()
     {
-        BarLab.color = new Color(1, 1, 1, 1);
-        BarSkillStatus = SkillStatus.CD;
+        CdTimer -= Time.deltaTime;
+
+        TimeSpan timeSpan = new TimeSpan(0, 0, 0, (int)CdTimer);
+
+        BarLab.text = string.Format("{0} : {1}", timeSpan.Minutes, timeSpan.Seconds);
+
+        BarBk0.fillAmount = CdTimer / CD;
+
+        if (CdTimer <= 0)
+        {
+            BarSkillStatus = SkillStatus.Buy;
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
     }
 
-    protected override void RegistValue()
+    public override void Initialize()
     {
-        Level = 0;
-        Timer = 0;
-
+        BarBtn.onClick.AddListener(Use);
+        BarBk1.sprite = ManaReso.Load<Sprite>(Icon + "副", Folder.Skill);
+        
         NewPlus = Plus;
         NewPerson = Person;
         NewSkillCD = SkillCD;
@@ -158,51 +178,61 @@ public class BigSkill : Skill
         NewUpgradeAmt = UpgradeAmt;
         NewCoinOnceBuff = CoinOnceBuff;
 
+        if (!string.IsNullOrEmpty(UpgradeFml))
+        {
+            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 NewCoinOnceBuff, UpgradeCoinOnce, Level);
+
+        UpgradeValue(ref NewPerson, Person, UpgradePerson, Level);
+        UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
+        UpgradeValue(ref NewDuration, Duration, UpgradeDuration, Level);
+        UpgradeValue(ref NewCoinOnce, CoinOnce, UpgradeCoinOnce, Level);
+        UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
+
         if (Class != SkillClass.Null)
         {
             ItemTit.text = Name;
             ItemLab.text = GetDescription(0);
             ItemBtn.onClick.AddListener(OnClick);
-
-            ItemSkillStatus = ItemSkillStatus;
         }
 
-        BarLab = ManaReso.Get<Text>(string.Format("F_SkillLab{0}", SkillIndex - 1));
-        BarBk0 = ManaReso.Get<Image>(string.Format("F_SkillBk{0}0", SkillIndex - 1));
-        BarBk1 = ManaReso.Get<Image>(string.Format("F_SkillBk{0}1", SkillIndex - 1));
-
-        BarBtn = BarBk1.GetComponent<Button>();
-
-        BarBtn.onClick.AddListener(Use);
-
-        if (!string.IsNullOrEmpty(Icon))
+        if (ItemSkillStatus == SkillStatus.Upgrade)
         {
-            BarBk1.sprite = ManaReso.Load<Sprite>(Icon + "副", Folder.Skill);
+            ShowSkillBar();
+            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
         }
-    }
 
-    protected override void RegistReference()
-    {
-        
+        if (BarSkillStatus == SkillStatus.Use)
+        {
+            Effect();
+            BarLab.color = new Color(38/255f, 155/255f, 1, 1);
+        }
     }
 
-
-    public override void Cool(float amt, bool isCurrent, bool isBuff)
+    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
     {
-        if (!ReduceCD && BarSkillStatus == SkillStatus.CD)
+        if (!ReduceCD || BarSkillStatus != SkillStatus.CD)
         {
             return;
         }
-
+        Debug.Log(Name);
         if (isCurrent) //减少当前值
         {
             if (isBuff) //按比例减少
             {
-                Timer -= CD * amt;
+                CdTimer -= CD * amt;
             }
             else //按数值减少
             {
-                Timer -= amt;
+                CdTimer -= amt;
             }
         }
         else //减少最大值
@@ -218,34 +248,34 @@ public class BigSkill : Skill
         }
     }
 
-    public override bool Cool()
-    {
-        Timer -= Time.deltaTime;
-
-        TimeSpan timeSpan = new TimeSpan(0, 0, 0, (int)Timer);
 
-        BarLab.text = string.Format("{0} : {1}", timeSpan.Minutes, timeSpan.Seconds);
+    private void ShowSkillBar()
+    {
+        if (!ManaData.SkillBarValid)
+        {
+            RectTransform skillBar = ManaReso.Get<RectTransform>("F_SkillBar");
+            RectTransform gardenScrr = ManaReso.Get<RectTransform>("Fa_GardenScrr");
 
-        BarBk0.fillAmount = Timer / CD;
+            gardenScrr.offsetMax += new Vector2(0, -skillBar.rect.height);
 
-        if (Timer <= 0)
-        {
-            BarSkillStatus = SkillStatus.Buy;
+            ManaData.SkillBarValid = true;
 
-            return true;
-        }
-        else
-        {
-            return false;
+            if (ManaReso.Get("Fa_GardenTab").gameObject.activeSelf)
+            {
+                skillBar.SetActive(true);
+            }
         }
     }
 
-
-    protected void TryActivate()
+    private void RegistReference()
     {
-        BarSkillStatus = SkillStatus.Buy;
+        BarLab = ManaReso.Get<Text>(string.Format("F_SkillLab{0}", SkillIndex - 1));
+        BarBk0 = ManaReso.Get<Image>(string.Format("F_SkillBk{0}0", SkillIndex - 1));
+        BarBk1 = ManaReso.Get<Image>(string.Format("F_SkillBk{0}1", SkillIndex - 1));
+        BarBtn = BarBk1.GetComponent<Button>();
     }
 
+
     protected override void Use()
     {
         if (BarSkillStatus == SkillStatus.Use)
@@ -255,6 +285,9 @@ public class BigSkill : Skill
 
         if (ManaData.Pay(UseAmt, UseCur))
         {
+            CdTimer = CD * (1 + CdBuff);
+            EffectTimer = NewDuration;
+
             if (Math.Abs(Duration) < 0.0005f)
             {
                 BarSkillStatus = SkillStatus.CD;
@@ -265,45 +298,82 @@ public class BigSkill : Skill
                 BarLab.color = new Color(38/255f, 155/255f, 1, 1);
             }
 
-            SkillProcessor processor = new SkillProcessor();
+            Effect();
+            EffectOnce();
 
-            processor.Name = Name;
-            processor.SkillRoot = this;
-            processor.TimerLab = BarLab;
-            processor.IsCurrent = true;
+            #region 调试输出
 
-            processor.Plus = NewPlus;
-            processor.SkillCdBuff = NewSkillCdBuff;
-            processor.PersonBuff = NewPersonBuff;
-            processor.CoinOnceBuff = NewCoinOnceBuff;
+            StringBuilder strb = new StringBuilder();
 
-            processor.Person = NewPerson;
-            processor.SkillCD = NewSkillCD;
-            processor.Duration = NewDuration;
-            processor.CoinOnce = NewCoinOnce;
-            processor.CoinPerson = NewCoinPerson;
+            strb.AppendFormat("使用技能 : <color=red>{0}</color>", Name);
 
-            processor.Process();
+            if (Math.Abs(NewPlus) > 0.0005f)
+            {
+                strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", NewPlus * 100);
+            }
+
+            if (Math.Abs(NewPerson) > 0.0005f)
+            {
+                strb.AppendFormat(" 参观人次<color=red>+{0}</color>", NewPerson);
+            }
+
+            if (Math.Abs(NewPersonBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", NewPersonBuff * 100);
+            }
+
+            if (Math.Abs(NewCoinPerson) > 0.0005f)
+            {
+                strb.AppendFormat(" 每次金币<color=red>+{0}</color>", NewCoinPerson);
+            }
+
+            if (Math.Abs(NewSkillCD) > 0.0005f)
+            {
+                strb.AppendFormat(" 减少冷却<color=red>{0}</color>", NewSkillCD);
+            }
+
+            if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 减少冷却<color=red>{0}%</color>", NewSkillCdBuff * 100);
+            }
+
+            if (Math.Abs(NewCoinOnce) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得金币<color=red>{0}</color>", NewCoinOnce);
+            }
+
+            if (Math.Abs(NewCoinOnceBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得金币<color=red>{0}</color>", ManaData.Person * ManaData.CoinPerson * ManaData.Circle * NewCoinOnceBuff);
+            }
+
+            if (Math.Abs(DiamondOnce) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得钻石<color=red>{0}</color>", DiamondOnce);
+            }
+
+            if (Math.Abs(NewDuration) > 0.0005f)
+            {
+                strb.AppendFormat(" 持续时间<color=red>{0}</color>秒", NewDuration);
+            }
+            else
+            {
+                strb.Append(" <color=red>永久有效</color>");
+            }
+
+            ManaLog.Log(strb.ToString());
+
+            #endregion
         }
     }
 
-
     protected override void Unlock()
     {
         if (ManaData.Pay(UnlockAmt, UnlockCur))
         {
-            TryActivate();
-            
-            if (!ManaData.SkillBarValid)
-            {
-                RectTransform skillBar = ManaReso.Get<RectTransform>("F_SkillBar");
-                RectTransform gardenScrr = ManaReso.Get<RectTransform>("Fa_GardenScrr");
-
-                skillBar.SetActive(true);
-                gardenScrr.offsetMax += new Vector2(0, -skillBar.rect.height);
+            ShowSkillBar();
 
-                ManaData.SkillBarValid = true;
-            }
+            BarSkillStatus = SkillStatus.Buy;
 
             if (Class != SkillClass.Null) //该技能有技能条
             {
@@ -336,7 +406,7 @@ public class BigSkill : Skill
 
         if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
         {
-            TryActivate();
+            BarSkillStatus = SkillStatus.Buy;
 
             ManaReso.Get("Fe_ManageInfo").Backward(TweenType.CG);
 
@@ -352,4 +422,84 @@ public class BigSkill : Skill
             ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
     }
+
+    protected override void Upgrade()
+    {
+        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
+        {
+            Level++;
+
+            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+
+            UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
+            UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
+            UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
+            UpgradeValue(ref NewCoinOnceBuff, UpgradeCoinOnce, 1);
+
+            UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
+            UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
+            UpgradeValue(ref NewDuration, Duration, UpgradeDuration, 1);
+            UpgradeValue(ref NewCoinOnce, CoinOnce, UpgradeCoinOnce, 1);
+            UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
+
+            ItemLab.text = GetDescription(0);
+            ManaReso.SetText("Fe_Lab0", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", GetDescription(1));
+            ManaReso.SetText("Fe_BtnLab", string.Format("升级({0}{1:0})", UpgradeCur, NewUpgradeAmt));
+
+            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+
+            if (BarSkillStatus == SkillStatus.Use) //更新技能效果
+            {
+                Annul();
+                Effect();
+            }
+        }
+    }
+
+
+    public override void Annul() //注销技能
+    {
+        BarLab.color = new Color(1, 1, 1, 1);
+        BarSkillStatus = SkillStatus.CD;
+
+        ManaData.SkillPlus -= NewPlus;
+        ManaData.SkillPerson -= NewPerson;
+        ManaData.SkillPersonBuff -= NewPersonBuff;
+        ManaData.SkillCoinPerson -= NewCoinPerson;
+
+        if (Math.Abs(NewSkillCD) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(-NewSkillCD, true, false);
+            }
+        }
+
+        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(-NewSkillCdBuff, true, true);
+            }
+        }
+
+        ManaLog.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
+    }
+
+    public override bool CountDown()
+    {
+        EffectTimer -= Time.deltaTime;
+
+        BarLab.text = EffectTimer.ToString("0.0");
+
+        if (EffectTimer <= 0)
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
 }

+ 106 - 33
Assets/Script/Object/Skill/Pack.cs

@@ -36,7 +36,7 @@ public class Pack : SkillRoot
 
     protected SkillStatus _ItemSkillStatus;
 
-    protected SkillStatus ItemSkillStatus
+    public SkillStatus ItemSkillStatus
     {
         get { return _ItemSkillStatus; }
         set
@@ -91,33 +91,28 @@ public class Pack : SkillRoot
 
         #endregion
 
-        _ItemSkillStatus = SkillStatus.Lock; //todo 删掉这句
+        SkillCato = SkillCato.Pack;
     }
 
 
-    public override void Annul()
+    public override void Initialize()
     {
-        
-    }
-
-    protected override void RegistValue()
-    {
-        Level = 0;
-        
         ItemTit.text = Name;
         ItemLab.text = GetDescription(0);
         ItemBtn.onClick.AddListener(OnClick);
 
-        ItemSkillStatus = ItemSkillStatus;
+        for (int i = 0; i < Level; i++)
+        {
+            Effect();
+        }
     }
 
-    protected override void RegistReference()
+    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
     {
         
     }
 
-
-    public void OnLevelChange()
+    public override void OnLevelChange()
     {
         if (MaxUseLv == MinUseLv)
         {
@@ -136,6 +131,7 @@ public class Pack : SkillRoot
         }
     }
 
+
     protected void OnClick()
     {
         ManaReso.Get("Fe_ManageInfo").Forward(TweenType.CG);
@@ -172,32 +168,109 @@ public class Pack : SkillRoot
         }
     }
 
-
     protected virtual void Use()
     {
         if (ManaData.Pay(UseAmt, UseCur))
         {
-            SkillProcessor processor = new SkillProcessor();
-
-            processor.Name = Name;
-            processor.SkillRoot = this;
-            processor.Duration = 0;
-            processor.IsCurrent = false;
-
-            processor.Plus = Plus;
-            processor.SkillCdBuff = SkillCdBuff;
-            processor.PersonBuff = PersonBuff;
-            
-            processor.Person = Person;
-            processor.SkillCD = SkillCD;
-            processor.CoinOnce = CoinOnce;
-            processor.CoinPerson = CoinPerson;
-            processor.DiamondOnce = DiamondOnce;
-            
-            processor.Process();
+            Effect();
+            EffectOnce();
+
+            Level++;
+
+            #region 调试输出
+
+            StringBuilder strb = new StringBuilder();
+
+            strb.AppendFormat("使用技能 : <color=red>{0}</color>", Name);
+
+            if (Math.Abs(Plus) > 0.0005f)
+            {
+                strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", Plus * 100);
+            }
+
+            if (Math.Abs(Person) > 0.0005f)
+            {
+                strb.AppendFormat(" 参观人次<color=red>+{0}</color>", Person);
+            }
+
+            if (Math.Abs(PersonBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", PersonBuff * 100);
+            }
+
+            if (Math.Abs(CoinPerson) > 0.0005f)
+            {
+                strb.AppendFormat(" 每次金币<color=red>+{0}</color>", CoinPerson);
+            }
+
+            if (Math.Abs(SkillCD) > 0.0005f)
+            {
+                strb.AppendFormat(" 减少冷却上限<color=red>{0}</color>", SkillCD);
+            }
+
+            if (Math.Abs(SkillCdBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 减少冷却上限<color=red>{0}%</color>", SkillCdBuff * 100);
+            }
+
+            if (Math.Abs(CoinOnce) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得金币<color=red>{0}</color>", CoinOnce);
+            }
+
+            if (Math.Abs(DiamondOnce) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得钻石<color=red>{0}</color>", DiamondOnce);
+            }
+
+            strb.Append(" <color=red>永久有效</color>");
+
+            ManaLog.Log(strb.ToString());
+
+            #endregion
+        }
+    }
+
+
+    public override void Annul() //注销技能
+    {
+
+    }
+
+    public override bool CountDown()
+    {
+        return true;
+    }
+
+    protected void Effect()
+    {
+        ManaData.SkillPlus += Plus;
+        ManaData.SkillPerson += Person;
+        ManaData.SkillPersonBuff += PersonBuff;
+        ManaData.SkillCoinPerson += CoinPerson;
+
+        if (Math.Abs(SkillCD) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(SkillCD, false, false);
+            }
+        }
+
+        if (Math.Abs(SkillCdBuff) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(SkillCdBuff, false, true);
+            }
         }
     }
 
+    protected void EffectOnce()
+    {
+        ManaData.Coin += CoinOnce;
+        ManaData.Diamond += DiamondOnce;
+    }
 
     #region 解读器
 

+ 233 - 89
Assets/Script/Object/Skill/Skill.cs

@@ -53,7 +53,9 @@ public class Skill : SkillRoot
 
     #endregion
 
-    protected float Timer; //冷却计时
+    public float CdTimer; //冷却计时
+    public float EffectTimer; //冷却计时
+
     protected float NewPlus;
     protected float NewPerson;
     protected float NewSkillCD;
@@ -79,8 +81,6 @@ public class Skill : SkillRoot
 
             if (_ItemSkillStatus == SkillStatus.CD)
             {
-                Timer = CD * (1 + CdBuff);
-
                 ManaData.CoolList.Add(this);
             }
             else if (_ItemSkillStatus == SkillStatus.Buy)
@@ -89,7 +89,7 @@ public class Skill : SkillRoot
             }
             else if (_ItemSkillStatus == SkillStatus.Use)
             {
-
+                ManaData.ProcessList.Add(this);
             }
             else if (_ItemSkillStatus == SkillStatus.Lock)
             {
@@ -158,21 +158,12 @@ public class Skill : SkillRoot
 
         #endregion
 
-        _ItemSkillStatus = SkillStatus.Lock; //todo 删掉这句
+        SkillCato = SkillCato.Skill;
     }
 
 
-    public override void Annul()
-    {
-        ItemBtnLab.color = new Color(1, 1, 1, 1);
-        ItemSkillStatus = SkillStatus.CD;
-    }
-
-    protected override void RegistValue()
+    public override void Initialize()
     {
-        Level = 0;
-        Timer = 0;
-
         NewPlus = Plus;
         NewPerson = Person;
         NewSkillCD = SkillCD;
@@ -184,20 +175,62 @@ public class Skill : SkillRoot
         NewUpgradeAmt = UpgradeAmt;
         NewCoinOnceBuff = CoinOnceBuff;
 
+        if (!string.IsNullOrEmpty(UpgradeFml))
+        {
+            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 NewCoinOnceBuff, UpgradeCoinOnce, Level);
+
+        UpgradeValue(ref NewPerson, Person, UpgradePerson, Level);
+        UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
+        UpgradeValue(ref NewDuration, Duration, UpgradeDuration, Level);
+        UpgradeValue(ref NewCoinOnce, CoinOnce, UpgradeCoinOnce, Level);
+        UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
+
         ItemTit.text = Name;
         ItemLab.text = GetDescription(0);
         ItemBtn.onClick.AddListener(OnClick);
 
-        ItemSkillStatus = ItemSkillStatus;
-    }
+        if (ItemSkillStatus != SkillStatus.Lock && ItemSkillStatus != SkillStatus.UnLock)
+        {
+            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+        }
+
+        if (ItemSkillStatus == SkillStatus.Use)
+        {
+            Effect();
+            ItemBtnLab.color = new Color(38 / 255f, 155 / 255f, 1, 1);
+        }
+    } //读取配置时调用
 
-    protected override void RegistReference()
+    public virtual bool Cool()
     {
-        
-    }
+        CdTimer -= Time.deltaTime;
+
+        TimeSpan timeSpan = new TimeSpan(0, 0, (int)CdTimer);
+
+        ItemBtnLab.text = string.Format("冷却中\n剩余时间({0}:{1})", timeSpan.Minutes, timeSpan.Seconds);
+
+        if (CdTimer <= 0)
+        {
+            ItemSkillStatus = SkillStatus.Buy;
 
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
 
-    public virtual void Cool(float amt, bool isCurrent, bool isBuff)
+    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
     {
         if (!ReduceCD && ItemSkillStatus == SkillStatus.CD)
         {
@@ -208,11 +241,11 @@ public class Skill : SkillRoot
         {
             if (isBuff) //按比例减少
             {
-                Timer -= CD*amt;
+                CdTimer -= CD * amt;
             }
             else //按数值减少
             {
-                Timer -= amt;
+                CdTimer -= amt;
             }
         }
         else //减少最大值
@@ -228,27 +261,7 @@ public class Skill : SkillRoot
         }
     }
 
-    public virtual bool Cool()
-    {
-        Timer -= Time.deltaTime;
-
-        TimeSpan timeSpan = new TimeSpan(0, 0, (int) Timer);
-
-        ItemBtnLab.text = string.Format("冷却中\n剩余时间({0}:{1})", timeSpan.Minutes, timeSpan.Seconds);
-
-        if (Timer <= 0)
-        {
-            ItemSkillStatus = SkillStatus.Buy;
-
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-
-    public virtual void OnLevelChange()
+    public override void OnLevelChange()
     {
         if (ManaData.Level >= UnlockLv) //到达解锁等级
         {
@@ -289,7 +302,7 @@ public class Skill : SkillRoot
         }
         else if (ItemSkillStatus == SkillStatus.Use)
         {
-            
+
         }
         else if (ItemSkillStatus == SkillStatus.Lock)
         {
@@ -344,11 +357,47 @@ public class Skill : SkillRoot
         }
     }
 
+    protected virtual void Upgrade()
+    {
+        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
+        {
+            Level++;
+
+            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+
+            UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
+            UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
+            UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
+            UpgradeValue(ref NewCoinOnceBuff, UpgradeCoinOnce, 1);
+
+            UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
+            UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
+            UpgradeValue(ref NewDuration, Duration, UpgradeDuration, 1);
+            UpgradeValue(ref NewCoinOnce, CoinOnce, UpgradeCoinOnce, 1);
+            UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
+
+            ItemLab.text = GetDescription(0);
+            ManaReso.SetText("Fe_Lab0", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", GetDescription(1));
+            ManaReso.SetText("Fe_BtnLab", string.Format("升级({0}{1:0})", UpgradeCur, NewUpgradeAmt));
+
+            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+
+            if (ItemSkillStatus == SkillStatus.Use) //更新技能效果
+            {
+                Annul();
+                Effect();
+            }
+        }
+    }
 
     protected virtual void Use()
     {
         if (ManaData.Pay(UseAmt, UseCur))
         {
+            CdTimer = CD * (1 + CdBuff);
+            EffectTimer = NewDuration;
+
             if (Math.Abs(Duration) < 0.0005f)
             {
                 ItemSkillStatus = SkillStatus.CD;
@@ -359,26 +408,72 @@ public class Skill : SkillRoot
                 ItemBtnLab.color = new Color(38/255f, 155/255f, 1, 1);
             }
 
-            SkillProcessor processor = new SkillProcessor();
+            Effect();
+            EffectOnce();
+
+            #region 调试输出
+
+            StringBuilder strb = new StringBuilder();
+
+            strb.AppendFormat("使用技能 : <color=red>{0}</color>", Name);
+
+            if (Math.Abs(NewPlus) > 0.0005f)
+            {
+                strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", NewPlus * 100);
+            }
+
+            if (Math.Abs(NewPerson) > 0.0005f)
+            {
+                strb.AppendFormat(" 参观人次<color=red>+{0}</color>", NewPerson);
+            }
+
+            if (Math.Abs(NewPersonBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", NewPersonBuff * 100);
+            }
+
+            if (Math.Abs(NewCoinPerson) > 0.0005f)
+            {
+                strb.AppendFormat(" 每次金币<color=red>+{0}</color>", NewCoinPerson);
+            }
+
+            if (Math.Abs(NewSkillCD) > 0.0005f)
+            {
+                strb.AppendFormat(" 减少冷却<color=red>{0}</color>", NewSkillCD);
+            }
+
+            if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 减少冷却<color=red>{0}%</color>", NewSkillCdBuff * 100);
+            }
+
+            if (Math.Abs(NewCoinOnce) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得金币<color=red>{0}</color>", NewCoinOnce);
+            }
+
+            if (Math.Abs(NewCoinOnceBuff) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得金币<color=red>{0}</color>", ManaData.Person * ManaData.CoinPerson * ManaData.Circle * NewCoinOnceBuff);
+            }
 
-            processor.Name = Name;
-            processor.SkillRoot = this;
-            processor.TimerLab = ItemBtnLab;
-            processor.IsCurrent = true;
+            if (Math.Abs(DiamondOnce) > 0.0005f)
+            {
+                strb.AppendFormat(" 获得钻石<color=red>{0}</color>", DiamondOnce);
+            }
 
-            processor.Plus = NewPlus;
-            processor.SkillCdBuff = NewSkillCdBuff;
-            processor.PersonBuff = NewPersonBuff;
-            processor.CoinOnceBuff = NewCoinOnceBuff;
+            if (Math.Abs(NewDuration) > 0.0005f)
+            {
+                strb.AppendFormat(" 持续时间<color=red>{0}</color>秒", NewDuration);
+            }
+            else
+            {
+                strb.Append(" <color=red>永久有效</color>");
+            }
 
-            processor.Person = NewPerson;
-            processor.SkillCD = NewSkillCD;
-            processor.Duration = NewDuration;
-            processor.CoinOnce = NewCoinOnce;
-            processor.CoinPerson = NewCoinPerson;
-            processor.DiamondOnce = DiamondOnce;
+            ManaLog.Log(strb.ToString());
 
-            processor.Process();
+            #endregion
         }
     }
 
@@ -430,35 +525,7 @@ public class Skill : SkillRoot
             ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
     }
-    
 
-    protected void Upgrade()
-    {
-        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
-        {
-            Level++;
-
-            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
-
-            UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
-            UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
-            UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
-            UpgradeValue(ref NewCoinOnceBuff, UpgradeCoinOnce, 1);
-
-            UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
-            UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
-            UpgradeValue(ref NewDuration, Duration, UpgradeDuration, 1);
-            UpgradeValue(ref NewCoinOnce, CoinOnce, UpgradeCoinOnce, 1);
-            UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
-
-            ItemLab.text = GetDescription(0);
-            ManaReso.SetText("Fe_Lab0", GetDescription(0));
-            ManaReso.SetText("Fe_Lab1", GetDescription(1));
-            ManaReso.SetText("Fe_BtnLab", string.Format("升级({0}{1:0})", UpgradeCur, NewUpgradeAmt));
-
-            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
-        }
-    }
 
     protected void UpgradeValue(ref float target, float baseValue, string fml, int offset)
     {
@@ -483,6 +550,83 @@ public class Skill : SkillRoot
         }
     }
 
+
+    public override void Annul() //注销技能
+    {
+        ItemBtnLab.color = new Color(1, 1, 1, 1);
+        ItemSkillStatus = SkillStatus.CD;
+
+        ManaData.SkillPlus -= NewPlus;
+        ManaData.SkillPerson -= NewPerson;
+        ManaData.SkillPersonBuff -= NewPersonBuff;
+        ManaData.SkillCoinPerson -= NewCoinPerson;
+
+        if (Math.Abs(NewSkillCD) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(-NewSkillCD, true, false);
+            }
+        }
+
+        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(-NewSkillCdBuff, true, true);
+            }
+        }
+
+        ManaLog.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
+    }
+
+    public override bool CountDown()
+    {
+        EffectTimer -= Time.deltaTime;
+
+        ItemLab.text = EffectTimer.ToString("0.0");
+
+        if (EffectTimer <= 0)
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    protected void Effect()
+    {
+        ManaData.SkillPlus += NewPlus;
+        ManaData.SkillPerson += NewPerson;
+        ManaData.SkillPersonBuff += NewPersonBuff;
+        ManaData.SkillCoinPerson += NewCoinPerson;
+
+        if (Math.Abs(NewSkillCD) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(NewSkillCD, true, false);
+            }
+        }
+
+        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(NewSkillCdBuff, true, true);
+            }
+        }
+    }
+
+    protected void EffectOnce()
+    {
+        ManaData.Coin += NewCoinOnce;
+        ManaData.Coin += ManaData.Person * ManaData.CoinPerson * ManaData.Circle * NewCoinOnceBuff;
+        ManaData.Diamond += DiamondOnce;
+    }
+
     #region 解读器
 
     protected string GetDescription(int offset)

+ 0 - 209
Assets/Script/Object/Skill/SkillProcessor.cs

@@ -1,209 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-
-public class SkillProcessor 
-{
-    #region 变量
-
-    public float Person;
-    public float SkillCD;
-    public float Duration;
-    public float CoinOnce;
-    public float CoinPerson;
-    public float DiamondOnce;
-
-    public float Plus;
-    public float SkillCdBuff;
-    public float PersonBuff;
-    public float CoinOnceBuff;
-
-    public float Timer; //技能效果计时
-    public bool IsCurrent; //减少CD的当前值或最大值
-    public string Name;
-    public Text TimerLab;
-    public SkillRoot SkillRoot;
-
-    #endregion
-
-    public void Annul() //注销技能
-    {
-        SkillRoot.Annul();
-
-        ManaData.Plus -= Plus;
-        ManaData.PersonBuff -= PersonBuff;
-        ManaData.TempPerson -= Person;
-        ManaData.TempCoinPerson -= CoinPerson;
-
-        if (Math.Abs(SkillCD) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].Cool(-SkillCD, IsCurrent, false);
-            }
-        }
-
-        if (Math.Abs(SkillCdBuff) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].Cool(-SkillCD, IsCurrent, true);
-            }
-        }
-
-        ManaLog.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
-    }
-
-    public void Process() //产生加成
-    {
-        if (Name == "花园")
-        {
-            ManaData.Person += Person;
-            ManaData.CoinPerson += CoinPerson;
-        }
-        else
-        {
-            ManaData.TempPerson += Person;
-            ManaData.TempCoinPerson += CoinPerson;
-        }
-
-        ManaData.Coin += CoinOnce;
-        ManaData.Coin += ManaData.Person * ManaData.CoinPerson * ManaData.Circle * CoinOnceBuff;
-
-        ManaData.Diamond += DiamondOnce;
-
-        ManaData.Plus += Plus;
-        ManaData.PersonBuff += PersonBuff;
-
-        if (Math.Abs(Duration) > 0.0005f)
-        {
-            Timer = Duration;
-
-            ManaData.ProcessorList.Add(this);
-        }
-
-        if (Math.Abs(SkillCD) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].Cool(SkillCD, IsCurrent, false);
-            }
-
-            for (int i = 0; i < ManaData.BigSkillList.Count; i++)
-            {
-                ManaData.BigSkillList[i].Cool(SkillCD, IsCurrent, false);
-            }
-        }
-        
-        if (Math.Abs(SkillCdBuff) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].Cool(SkillCdBuff, IsCurrent, true);
-            }
-            
-            for (int i = 0; i < ManaData.BigSkillList.Count; i++)
-            {
-                ManaData.BigSkillList[i].Cool(SkillCdBuff, IsCurrent, true);
-            }
-        }
-
-        #region 调试输出
-
-        StringBuilder strb = new StringBuilder();
-
-        strb.AppendFormat("使用技能 : <color=red>{0}</color>", Name);
-        
-        if (Math.Abs(Plus) > 0.0005f)
-        {
-            strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", Plus * 100);
-        }
-
-        if (Math.Abs(Person) > 0.0005f)
-        {
-            strb.AppendFormat(" 参观人次<color=red>+{0}</color>", Person);
-        }
-
-        if (Math.Abs(PersonBuff) > 0.0005f)
-        {
-            strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", PersonBuff * 100);
-        }
-
-        if (Math.Abs(CoinPerson) > 0.0005f)
-        {
-            strb.AppendFormat(" 每次金币<color=red>+{0}</color>", CoinPerson);
-        }
-
-        if (Math.Abs(SkillCD) > 0.0005f)
-        {
-            if (IsCurrent)
-            {
-                strb.AppendFormat(" 减少冷却<color=red>{0}</color>", SkillCD);
-            }
-            else
-            {
-                strb.AppendFormat(" 减少冷却上限<color=red>{0}</color>", SkillCD);
-            }
-        }
-
-        if (Math.Abs(SkillCdBuff) > 0.0005f)
-        {
-            if (IsCurrent)
-            {
-                strb.AppendFormat(" 减少冷却<color=red>{0}%</color>", SkillCdBuff * 100);
-            }
-            else
-            {
-                strb.AppendFormat(" 减少冷却上限<color=red>{0}%</color>", SkillCdBuff * 100);
-            }
-        }
-
-        if (Math.Abs(CoinOnce) > 0.0005f)
-        {
-            strb.AppendFormat(" 获得金币<color=red>{0}</color>", CoinOnce);
-        }
-
-        if (Math.Abs(CoinOnceBuff) > 0.0005f)
-        {
-            strb.AppendFormat(" 获得金币<color=red>{0}</color>", ManaData.Person * ManaData.CoinPerson * ManaData.Circle * CoinOnceBuff);
-        }
-
-        if (Math.Abs(DiamondOnce) > 0.0005f)
-        {
-            strb.AppendFormat(" 获得钻石<color=red>{0}</color>", DiamondOnce);
-        }
-
-        if (Math.Abs(Duration) > 0.0005f)
-        {
-            strb.AppendFormat(" 持续时间<color=red>{0}</color>秒", Duration);
-        }
-        else
-        {
-            strb.Append(" <color=red>永久有效</color>");
-        }
-
-        ManaLog.Log(strb.ToString());
-
-        #endregion
-    }
-
-    public bool CountDown()
-    {
-        Timer -= Time.deltaTime;
-
-        TimerLab.text = Timer.ToString("0.0");
-        
-        if (Timer <= 0)
-        {
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-}

+ 13 - 10
Assets/Script/Object/Skill/SkillRoot.cs

@@ -16,6 +16,14 @@ public enum Current
     Diamond,
 }
 
+public enum SkillCato
+{
+    Skill,
+    Pack,
+    Ability,
+    BigSkill,
+}
+
 public enum SkillClass
 {
     Null,
@@ -55,19 +63,10 @@ public abstract class SkillRoot : IComparable
     public Text ItemBtnLab;
     public Image ItemIcon;
     public Button ItemBtn;
+    public SkillCato SkillCato;
 
     #endregion
 
-    protected SkillRoot()
-    {
-        Initializer.RegistValue += RegistValue;
-        Initializer.RegistReference += RegistReference;
-    }
-
-    protected abstract void RegistValue();
-    protected abstract void RegistReference();
-
-
     public virtual int CompareTo(object obj)
     {
         SkillRoot other = (SkillRoot) obj;
@@ -91,6 +90,10 @@ public abstract class SkillRoot : IComparable
     }
 
     public abstract void Annul();
+    public abstract void Initialize();
+    public abstract void ReceiveCool(float amt, bool isCurrent, bool isBuff); //接受技能冷却
+    public abstract void OnLevelChange();
+    public abstract bool CountDown();
 
     #region 解读器
 

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

@@ -48,19 +48,14 @@ public class Auxiliary : MonoBehaviour
     {
         if (Input.GetKeyDown(KeyCode.P))
         {
-            ManaData.Level += 100;
+            ManaData.Level += 10;
         }
 
         if (Input.GetKeyDown(KeyCode.O))
         {
             for (int i = 0; i < ManaData.SkillList.Count; i++)
             {
-                ManaData.SkillList[i].Cool(1, true, true);
-            }
-
-            for (int i = 0; i < ManaData.BigSkillList.Count; i++)
-            {
-                ManaData.BigSkillList[i].Cool(1, true, true);
+                ManaData.SkillList[i].ReceiveCool(1, true, true);
             }
         }
 

+ 263 - 83
Assets/Script/Tool/Data.cs

@@ -49,7 +49,7 @@ public class Data
     {
         XmlNode xmlNode;
         XmlAttribute xmlAttribute;
-
+        
         #region MyRegion
         
         PlayerNode.SelectSingleNode("Coin").Attributes[0].Value = ManaData.Coin.ToString("0");
@@ -61,76 +61,114 @@ public class Data
 
         #endregion
 
-        #region Skill
+        #region SkillList
 
-        #region Skill
-
-        xmlNode = PlayerNode.SelectSingleNode("Skill");
+        xmlNode = PlayerNode.SelectSingleNode("SkillList");
         xmlNode.RemoveAll();
         for (int i = 0; i < ManaData.SkillList.Count; i++)
         {
-            xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ManaData.SkillList[i].Name, ""));
+            if (ManaData.SkillList[i].SkillCato == SkillCato.Skill)
+            {
+                #region Skill
 
-            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("status"));
-            xmlAttribute.Value = ManaData.SkillList[i].ItemSkillStatus.ToString();
+                Skill skill = (Skill) ManaData.SkillList[i];
 
-            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("level"));
-            xmlAttribute.Value = ManaData.SkillList[i].Level.ToString();
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, skill.Name, ""));
 
-            xmlNode = PlayerNode.SelectSingleNode("Skill");
-        }
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = skill.SkillCato.ToString();
 
-        #endregion
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = skill.ItemSkillStatus.ToString();
 
-        #region Ability
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = skill.Level.ToString();
 
-        xmlNode = PlayerNode.SelectSingleNode("Ability");
-        xmlNode.RemoveAll();
-        for (int i = 0; i < ManaData.AbilityList.Count; i++)
-        {
-            xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ManaData.AbilityList[i].Name, ""));
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("CdTimer"));
+                xmlAttribute.Value = skill.CdTimer.ToString();
 
-            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("status"));
-            xmlAttribute.Value = ManaData.AbilityList[i].ItemSkillStatus.ToString();
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("EffectTimer"));
+                xmlAttribute.Value = skill.EffectTimer.ToString();
 
-            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("level"));
-            xmlAttribute.Value = ManaData.AbilityList[i].Level.ToString();
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
 
-            xmlNode = PlayerNode.SelectSingleNode("Ability");
-        }
+                #endregion
+            }
+            else if (ManaData.SkillList[i].SkillCato == SkillCato.Pack)
+            {
+                #region Pack
 
-        #endregion
+                Pack pack = (Pack)ManaData.SkillList[i];
 
-        #region BigSkill
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "礼包", ""));
 
-        xmlNode = PlayerNode.SelectSingleNode("BigSkill");
-        xmlNode.RemoveAll();
-        for (int i = 0; i < ManaData.BigSkillList.Count; i++)
-        {
-            xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ManaData.BigSkillList[i].Name, ""));
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = pack.SkillCato.ToString();
 
-            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("status"));
-            xmlAttribute.Value = ManaData.BigSkillList[i].ItemSkillStatus.ToString();
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Name"));
+                xmlAttribute.Value = pack.Name;
 
-            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("level"));
-            xmlAttribute.Value = ManaData.BigSkillList[i].Level.ToString();
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = pack.ItemSkillStatus.ToString();
 
-            xmlNode = PlayerNode.SelectSingleNode("BigSkill");
-        }
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = pack.Level.ToString();
 
-        #endregion
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
 
-        #endregion
+                #endregion
+            }
+            else if (ManaData.SkillList[i].SkillCato == SkillCato.Ability)
+            {
+                #region Ability
 
-        #region CoolList
+                Ability ability = (Ability)ManaData.SkillList[i];
 
-        xmlNode = PlayerNode.SelectSingleNode("CoolList");
-        xmlNode.RemoveAll();
-        for (int i = 0; i < ManaData.CoolList.Count; i++)
-        {
-            xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ManaData.CoolList[i].Name, ""));
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ability.Name, ""));
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = ability.SkillCato.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = ability.ItemSkillStatus.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = ability.Level.ToString();
+
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
+
+                #endregion
+            }
+            else if (ManaData.SkillList[i].SkillCato == SkillCato.BigSkill)
+            {
+                #region BigSkill
+
+                BigSkill bigSkill = (BigSkill) ManaData.SkillList[i];
 
-            xmlNode = PlayerNode.SelectSingleNode("CoolList");
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, bigSkill.Name, ""));
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = bigSkill.SkillCato.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = bigSkill.ItemSkillStatus.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("BarStatus"));
+                xmlAttribute.Value = bigSkill.BarSkillStatus.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = bigSkill.Level.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("CdTimer"));
+                xmlAttribute.Value = bigSkill.CdTimer.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("EffectTimer"));
+                xmlAttribute.Value = bigSkill.EffectTimer.ToString();
+
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
+
+                #endregion
+            }
         }
 
         #endregion
@@ -151,15 +189,22 @@ public class Data
 
         #endregion
 
-        #region ProcessorList
+        #region FlowerList
 
-        xmlNode = PlayerNode.SelectSingleNode("ProcessorList");
+        xmlNode = PlayerNode.SelectSingleNode("FlowerList");
         xmlNode.RemoveAll();
-        for (int i = 0; i < ManaData.ProcessorList.Count; i++)
+
+        foreach (var kv in ManaGarden.FlowerDic)
         {
-            xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ManaData.ProcessorList[i].Name, ""));
+            if (kv.Value.Unlock)
+            {
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Flower", ""));
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+                xmlAttribute.Value = kv.Value.Id.ToString();
 
-            xmlNode = PlayerNode.SelectSingleNode("ProcessorList");
+                xmlNode = PlayerNode.SelectSingleNode("FlowerList");
+            }
         }
 
         #endregion
@@ -170,6 +215,7 @@ public class Data
     public static void ResetPlayerConfig()
     {
         XmlNode xmlNode;
+        XmlAttribute xmlAttribute;
 
         #region MyRegion
         
@@ -182,50 +228,115 @@ public class Data
 
         #endregion
 
-        #region Skill
+        #region SkillList
 
-        #region Skill
+        xmlNode = PlayerNode.SelectSingleNode("SkillList");
+        xmlNode.RemoveAll();
+        for (int i = 0; i < ManaData.SkillList.Count; i++)
+        {
+            if (ManaData.SkillList[i].SkillCato == SkillCato.Skill)
+            {
+                #region Skill
 
-        xmlNode = PlayerNode.SelectSingleNode("Skill");
+                Skill skill = (Skill)ManaData.SkillList[i];
 
-        for (int i = 0; i < xmlNode.ChildNodes.Count; i++)
-        {
-            xmlNode.ChildNodes[i].Attributes[0].Value = "Lock";
-            xmlNode.ChildNodes[i].Attributes[1].Value = "0";
-        }
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, skill.Name, ""));
 
-        #endregion
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = skill.SkillCato.ToString();
 
-        #region Ability
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = SkillStatus.Lock.ToString();
 
-        xmlNode = PlayerNode.SelectSingleNode("Ability");
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = 0.ToString();
 
-        for (int i = 0; i < xmlNode.ChildNodes.Count; i++)
-        {
-            xmlNode.ChildNodes[i].Attributes[0].Value = "Lock";
-            xmlNode.ChildNodes[i].Attributes[1].Value = "0";
-        }
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("CdTimer"));
+                xmlAttribute.Value = 0.ToString();
 
-        #endregion
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("EffectTimer"));
+                xmlAttribute.Value = 0.ToString();
 
-        #region BigSkill
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
 
-        xmlNode = PlayerNode.SelectSingleNode("BigSkill");
+                #endregion
+            }
+            else if (ManaData.SkillList[i].SkillCato == SkillCato.Pack)
+            {
+                #region Pack
 
-        for (int i = 0; i < xmlNode.ChildNodes.Count; i++)
-        {
-            xmlNode.ChildNodes[i].Attributes[0].Value = "Lock";
-            xmlNode.ChildNodes[i].Attributes[1].Value = "0";
-        }
+                Pack pack = (Pack) ManaData.SkillList[i];
 
-        #endregion
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "礼包", ""));
 
-        #endregion
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = pack.SkillCato.ToString();
 
-        #region CoolList
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Name"));
+                xmlAttribute.Value = pack.Name;
 
-        xmlNode = PlayerNode.SelectSingleNode("CoolList");
-        xmlNode.RemoveAll();
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = SkillStatus.Lock.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = 0.ToString();
+
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
+
+                #endregion
+            }
+            else if (ManaData.SkillList[i].SkillCato == SkillCato.Ability)
+            {
+                #region Ability
+
+                Ability ability = (Ability)ManaData.SkillList[i];
+
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, ability.Name, ""));
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = ability.SkillCato.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = SkillStatus.Lock.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = 0.ToString();
+
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
+
+                #endregion
+            }
+            else if (ManaData.SkillList[i].SkillCato == SkillCato.BigSkill)
+            {
+                #region BigSkill
+
+                BigSkill bigSkill = (BigSkill)ManaData.SkillList[i];
+
+                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, bigSkill.Name, ""));
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("SkillCato"));
+                xmlAttribute.Value = bigSkill.SkillCato.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("ItemStatus"));
+                xmlAttribute.Value = SkillStatus.Lock.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("BarStatus"));
+                xmlAttribute.Value = SkillStatus.Buy.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Level"));
+                xmlAttribute.Value = 0.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("CdTimer"));
+                xmlAttribute.Value = 0.ToString();
+
+                xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("EffectTimer"));
+                xmlAttribute.Value = 0.ToString();
+
+                xmlNode = PlayerNode.SelectSingleNode("SkillList");
+
+                #endregion
+            }
+        }
 
         #endregion
 
@@ -234,13 +345,82 @@ public class Data
         xmlNode = PlayerNode.SelectSingleNode("PlantList");
         xmlNode.RemoveAll();
 
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA1", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 1.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA2", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 2.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA3", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 3.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA4", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 4.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA5", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 5.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA6", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 6.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA7", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 7.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA8", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 8.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraA9", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 9.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraB1", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 10.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraB2", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 11.ToString();
+        xmlNode = PlayerNode.SelectSingleNode("PlantList");
+
+        xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "FlowerTraB3", ""));
+        xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+        xmlAttribute.Value = 12.ToString();
+
         #endregion
 
-        #region ProcessorList
+        #region FlowerList
 
-        xmlNode = PlayerNode.SelectSingleNode("ProcessorList");
+        xmlNode = PlayerNode.SelectSingleNode("FlowerList");
         xmlNode.RemoveAll();
 
+        foreach (var kv in ManaGarden.FlowerDic)
+        {
+            xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Flower", ""));
+
+            xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
+            xmlAttribute.Value = kv.Value.Id.ToString();
+
+            xmlNode = PlayerNode.SelectSingleNode("FlowerList");
+        }
+
         #endregion
 
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");

BIN
Assets/XlsxSource/skill_config.xlsx


+ 16 - 13
MyLovelyGarden.sln

@@ -1,9 +1,9 @@
-
-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}"
+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}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLovelyGarden.Editor", "MyLovelyGarden.Editor.csproj", "{B575449E-FD9A-1672-368B-EC1E1252F6E4}"
+Project("{8A8BB0A8-D809-F2DF-89D6-F26151FFF558}") = "MyLovelyGarden", "Assembly-CSharp-Editor.csproj", "{A08052E5-32CE-91C0-FF56-C60C901D6BEF}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,16 +11,19 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{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
+		{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
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(MonoDevelopProperties) = preSolution
+		StartupItem = Assembly-CSharp.csproj
+	EndGlobalSection
 EndGlobal

+ 1 - 7
MyLovelyGarden.txt

@@ -1,12 +1,6 @@
-增加Main类
-
 GameInfo九宫格
 
-改写技能状态逻辑
-
-重写SkillProcess
-
-进度保存(签到 小游戏奖励)
+FmlParse增加offset功能
 
 Xml(变量赋值、字体、文本内容、Hud颜色、Hud速度、Message颜色、按钮图片)
 

BIN
ProjectSettings/GraphicsSettings.asset