Browse Source

Update 3.24

LiuQilin 8 years ago
parent
commit
5cb3d1e315
67 changed files with 2122 additions and 1825 deletions
  1. BIN
      .vs/MyLovelyGarden/v14/.suo
  2. 0 0
      Assets/Resources/Audio.meta
  3. 0 0
      Assets/Resources/Audio/8LOGO音效.mp3
  4. 0 0
      Assets/Resources/Audio/8LOGO音效.mp3.meta
  5. 0 0
      Assets/Resources/Audio/mini_game_bg.mp3
  6. 0 0
      Assets/Resources/Audio/mini_game_bg.mp3.meta
  7. 0 0
      Assets/Resources/Audio/theme_bg.mp3
  8. 0 0
      Assets/Resources/Audio/theme_bg.mp3.meta
  9. BIN
      Assets/Resources/Garden.unity
  10. BIN
      Assets/Resources/Prefab/Object/Bird.prefab
  11. BIN
      Assets/Resources/Prefab/Object/Flower.prefab
  12. BIN
      Assets/Resources/Prefab/Object/ObjPool.prefab
  13. BIN
      Assets/Resources/Prefab/PrefabUI/AwardItem.prefab
  14. BIN
      Assets/Resources/Prefab/PrefabUI/Canvas.prefab
  15. BIN
      Assets/Resources/Prefab/PrefabUI/FlowerItemG.prefab
  16. 0 0
      Assets/Resources/Prefab/PrefabUI/FlowerItemG.prefab.meta
  17. BIN
      Assets/Resources/Prefab/PrefabUI/FlowerItemH.prefab
  18. 0 0
      Assets/Resources/Prefab/PrefabUI/FlowerItemH.prefab.meta
  19. 2 2
      Assets/Resources/XML/Config/PlayerConfig.xml
  20. 3 3
      Assets/Resources/XML/Config/ability_config.xml
  21. 26 0
      Assets/Resources/XML/Config/minigame_config.xml
  22. 3 3
      Assets/Resources/XML/Config/minigame_config.xml.meta
  23. 1 1
      Assets/Resources/XML/Config/skill_config.xml
  24. 24 18
      Assets/Resources/XML/lan/ChineseSimplified.xml
  25. 10 4
      Assets/Resources/XML/lan/ChineseTraditional.xml
  26. 10 4
      Assets/Resources/XML/lan/English.xml
  27. 0 27
      Assets/Script/Editor/EdiotExcelExport.cs
  28. 2 2
      Assets/Script/Interface.meta
  29. 26 0
      Assets/Script/Interface/Regist.cs
  30. 2 2
      Assets/Script/Interface/Regist.cs.meta
  31. 35 24
      Assets/Script/Manage/Initializer.cs
  32. 3 2
      Assets/Script/Manage/Main.cs
  33. 30 29
      Assets/Script/Manage/ManaAnim.cs
  34. 6 7
      Assets/Script/Manage/ManaAudio.cs
  35. 139 95
      Assets/Script/Manage/ManaData.cs
  36. 46 0
      Assets/Script/Manage/ManaDebug.cs
  37. 0 0
      Assets/Script/Manage/ManaDebug.cs.meta
  38. 110 62
      Assets/Script/Manage/ManaGarden.cs
  39. 0 74
      Assets/Script/Manage/ManaLog.cs
  40. 235 143
      Assets/Script/Manage/ManaMiniGame.cs
  41. 1 1
      Assets/Script/Manage/ManaPlayer.cs
  42. 269 291
      Assets/Script/Manage/ManaReso.cs
  43. 348 191
      Assets/Script/Manage/ManaUI.cs
  44. 11 11
      Assets/Script/Object/Flower.cs
  45. 9 24
      Assets/Script/Object/Garden.cs
  46. 92 96
      Assets/Script/Object/Skill/Ability.cs
  47. 126 167
      Assets/Script/Object/Skill/BigSkill.cs
  48. 64 55
      Assets/Script/Object/Skill/Pack.cs
  49. 238 226
      Assets/Script/Object/Skill/Skill.cs
  50. 37 178
      Assets/Script/Object/Skill/SkillRoot.cs
  51. 140 13
      Assets/Script/Tool/Auxiliary.cs
  52. 19 6
      Assets/Script/Tool/Data.cs
  53. 0 24
      Assets/Script/Tool/ExcelExport.cs
  54. 0 12
      Assets/Script/Tool/ExcelExport.cs.meta
  55. 19 0
      Assets/Script/Tool/Extension.cs
  56. 1 2
      Assets/Script/Tool/SpriteAsset.cs
  57. 1 1
      Assets/Script/Tool/UI/FlowerCard.cs
  58. BIN
      Assets/XlsxSource/ability_config.xlsx
  59. BIN
      Assets/XlsxSource/language_config.xlsx
  60. BIN
      Assets/XlsxSource/minigame_config.xlsx
  61. 3 3
      Assets/XlsxSource/minigame_config.xlsx.meta
  62. BIN
      Assets/XlsxSource/skill_config.xlsx
  63. 4 0
      MyLovelyGarden.Editor.csproj
  64. 7 1
      MyLovelyGarden.csproj
  65. 13 16
      MyLovelyGarden.sln
  66. 7 5
      MyLovelyGarden.txt
  67. BIN
      ProjectSettings/GraphicsSettings.asset

BIN
.vs/MyLovelyGarden/v14/.suo


+ 0 - 0
Assets/Resources/Sounds.meta → Assets/Resources/Audio.meta


+ 0 - 0
Assets/Resources/Sounds/8LOGO音效.mp3 → Assets/Resources/Audio/8LOGO音效.mp3


+ 0 - 0
Assets/Resources/Sounds/8LOGO音效.mp3.meta → Assets/Resources/Audio/8LOGO音效.mp3.meta


+ 0 - 0
Assets/Resources/Sounds/mini_game_bg.mp3 → Assets/Resources/Audio/mini_game_bg.mp3


+ 0 - 0
Assets/Resources/Sounds/mini_game_bg.mp3.meta → Assets/Resources/Audio/mini_game_bg.mp3.meta


+ 0 - 0
Assets/Resources/Sounds/theme_bg.mp3 → Assets/Resources/Audio/theme_bg.mp3


+ 0 - 0
Assets/Resources/Sounds/theme_bg.mp3.meta → Assets/Resources/Audio/theme_bg.mp3.meta


BIN
Assets/Resources/Garden.unity


BIN
Assets/Resources/Prefab/Object/Bird.prefab


BIN
Assets/Resources/Prefab/Object/Flower.prefab


BIN
Assets/Resources/Prefab/Object/ObjPool.prefab


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


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


BIN
Assets/Resources/Prefab/PrefabUI/FlowerHouseItem.prefab → Assets/Resources/Prefab/PrefabUI/FlowerItemG.prefab


+ 0 - 0
Assets/Resources/Prefab/PrefabUI/FlowerHouseItem.prefab.meta → Assets/Resources/Prefab/PrefabUI/FlowerItemG.prefab.meta


BIN
Assets/Resources/Prefab/PrefabUI/FlowerCardItem.prefab → Assets/Resources/Prefab/PrefabUI/FlowerItemH.prefab


+ 0 - 0
Assets/Resources/Prefab/PrefabUI/FlowerCardItem.prefab.meta → Assets/Resources/Prefab/PrefabUI/FlowerItemH.prefab.meta


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

@@ -4,11 +4,11 @@
   <Level value="0" />
   <Person value="1" />
   <Diamond value="0" />
-  <QuitTime value="3/20/2017 3:37:22 PM" />
+  <QuitTime value="3/24/2017 8:18:12 PM" />
   <CoinPerson value="1" />
   <CircleTimer value="0" />
   <PlantList FlowerTraA1="1" FlowerTraA2="2" FlowerTraA3="3" FlowerTraA4="4" FlowerTraA5="5" FlowerTraA6="6" FlowerTraA7="7" FlowerTraA8="8" FlowerTraA9="9" />
-  <FlowerList ID="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20" />
+  <FlowerList ID="1 2 3 4 5 6 7 8 9 10" />
   <SkillList>
     <免费获取金币 SkillType="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
     <免费获取钻石 SkillType="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />

+ 3 - 3
Assets/Resources/XML/Config/ability_config.xml

@@ -1,8 +1,8 @@
 <data>
   <item id="1" name="花园" class="1" class_id="1" coin_person="1" person="1" skill_cd="" unlock_lv="" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="" upgrade_cur="1" upgrade_amnt="200" upgrade_fml="a*1.07" upgrade_plus="10" upgrade_person="0.1" upgrade_cd="" desc="每人次收入 金币[&amp;coin_person&amp;][lv],每分钟来访[&amp;person&amp;*60][lv]人" icon="红-公园" anim="" label="" />
-  <item id="2" name="缤纷彩虹" class="1" class_id="5" coin_person="" person="" skill_cd="" unlock_lv="200" unlock_ahead_cur="2" unlock_ahead_amt="200" unlock_cur="" unlock_amnt="100" unlock_pos="" upgrade_cur="2" upgrade_amnt="" upgrade_fml="a" upgrade_plus="50%" upgrade_person="50%" upgrade_cd="" desc="每分钟增加[&amp;person&amp;*60][lv]人参观,永久有效" icon="红-彩虹" anim="" label="" />
-  <item id="3" name="玉树樱花" class="1" class_id="6" coin_person="" person="" skill_cd="" unlock_lv="500" unlock_ahead_cur="2" unlock_ahead_amt="300" unlock_cur="" unlock_amnt="" unlock_pos="" upgrade_cur="2" upgrade_amnt="300" upgrade_fml="a" upgrade_plus="50%" upgrade_person="" upgrade_cd="" desc="每人次收入提升[&amp;coin_person&amp;][lv],永久有效" icon="红-樱花树" anim="" label="" />
-  <item id="4" name="滴哩哩的小黄鹂" class="1" class_id="7" coin_person="" person="" skill_cd="5%" unlock_lv="" unlock_ahead_cur="2" unlock_ahead_amt="500" unlock_cur="" unlock_amnt="" unlock_pos="" upgrade_cur="2" upgrade_amnt="300" upgrade_fml="a" upgrade_plus="" upgrade_person="" upgrade_cd="5%" desc="技能冷却时间减少[&amp;skill_cd&amp;][lv],永久有效" icon="红-黄鹂鸟" anim="" label="" />
+  <item id="2" name="缤纷彩虹" class="1" class_id="5" coin_person="" person="50%" skill_cd="" unlock_lv="200" unlock_ahead_cur="2" unlock_ahead_amt="200" unlock_cur="" unlock_amnt="100" unlock_pos="" upgrade_cur="2" upgrade_amnt="" upgrade_fml="a" upgrade_plus="" upgrade_person="50%" upgrade_cd="" desc="每分钟增加[&amp;person&amp;*60][lv]人参观,永久有效" icon="红-彩虹" anim="" label="" />
+  <item id="3" name="玉树樱花" class="1" class_id="6" coin_person="50%" person="" skill_cd="" unlock_lv="500" unlock_ahead_cur="2" unlock_ahead_amt="300" unlock_cur="" unlock_amnt="" unlock_pos="" upgrade_cur="2" upgrade_amnt="300" upgrade_fml="a" upgrade_plus="50%" upgrade_person="" upgrade_cd="" desc="每人次收入提升[&amp;coin_person&amp;][lv],永久有效" icon="红-樱花树" anim="" label="" />
+  <item id="4" name="滴哩哩的小黄鹂" class="1" class_id="7" coin_person="" person="" skill_cd="5%" unlock_lv="" unlock_ahead_cur="2" unlock_ahead_amt="500" unlock_cur="" unlock_amnt="" unlock_pos="" upgrade_cur="2" upgrade_amnt="300" upgrade_fml="a" upgrade_plus="" upgrade_person="" upgrade_cd="5%" desc="技能冷却时间减少[&amp;skill_cd&amp;][lv],永久有效" icon="红-黄鹂鸟" anim="Bird,GardenBk4" label="" />
   <item id="5" name="黄色小蜜蜂" class="2" class_id="1" coin_person="10" person="" skill_cd="" unlock_lv="200" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="" upgrade_cur="1" upgrade_amnt="1600" upgrade_fml="a*1.07" upgrade_plus="10" upgrade_person="" upgrade_cd="" desc="每人次参观获得[&amp;coin_person&amp;][lv]金币" icon="黄-黄色蜜蜂" anim="" label="" />
   <item id="6" name="紫色小蜜蜂" class="2" class_id="2" coin_person="10" person="" skill_cd="" unlock_lv="200" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="1" upgrade_cur="1" upgrade_amnt="86400" upgrade_fml="a*1.07" upgrade_plus="10" upgrade_person="" upgrade_cd="" desc="每人次参观获得[&amp;coin_person&amp;][lv]金币" icon="黄-紫色蜜蜂" anim="" label="" />
   <item id="7" name="蓝色小蜜蜂" class="2" class_id="3" coin_person="10" person="" skill_cd="" unlock_lv="200" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="1" upgrade_cur="1" upgrade_amnt="22118000" upgrade_fml="a*1.07" upgrade_plus="10" upgrade_person="" upgrade_cd="" desc="每人次参观获得[&amp;coin_person&amp;][lv]金币" icon="黄-蓝色蜜蜂" anim="" label="" />

+ 26 - 0
Assets/Resources/XML/Config/minigame_config.xml

@@ -0,0 +1,26 @@
+<data>
+  <item id="1" coin="s*0.05" diamond="5,20" diamond_drop="0.5/l+l*0.0001" flower_drop="1/f+l*0.0001" flower_rate_based="0.008,0.08,0.8" rate="0,200,800" />
+  <comment>
+    <id>
+
+</id>
+    <coin>
+金币奖励公式
+</coin>
+    <diamond>
+钻石奖励区间
+</diamond>
+    <diamond_drop>
+钻石掉率公式
+</diamond_drop>
+    <flower_drop>
+花朵掉率公式
+</flower_drop>
+    <flower_rate_based>
+评级要求
+</flower_rate_based>
+    <rate>
+评价配置
+</rate>
+  </comment>
+</data>

+ 3 - 3
Assets/Resources/Prefab/Object/ObjPool.prefab.meta → Assets/Resources/XML/Config/minigame_config.xml.meta

@@ -1,8 +1,8 @@
 fileFormatVersion: 2
-guid: 06bda0db1430df44a85365dd30edafef
-timeCreated: 1486969518
+guid: 1899173996d522f4bb665c09c0b9a1e5
+timeCreated: 1490249676
 licenseType: Pro
-NativeFormatImporter:
+TextScriptImporter:
   userData: 
   assetBundleName: 
   assetBundleVariant: 

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

@@ -1,6 +1,6 @@
 <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="300" 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="1" unlock_amnt="100" 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="立即获得每人次收入的[&amp;coin_once&amp;][lv]" icon="4大技能2" 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="1" unlock_amnt="100" 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="立即获得每人次收入的[&amp;coin_once&amp;][lv]" 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="所有收入提升[&amp;coin_person&amp;],持续[&amp;duration&amp;/60][lv]" 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="所有金币产出提升[&amp;coin_person&amp;],持续[&amp;duration&amp;]分钟" icon="绿-繁花似锦" anim="" label="" />
   <item id="5" name="免费获取金币" class="3" class_id="0" skill_index="" reduce_cd="" coin_person="" person="" coin_once="500%" diamond_once="" skill_cd="" duration="" cd="900" unlock_lv="" unlock_ahead_cur="" unlock_ahead_amt="" unlock_cur="" unlock_amnt="" unlock_pos="" use__cur="5" use_amnt="" upgrade_cur="" upgrade_amnt="" upgrade_fml="" upgrade_plus="" upgrade_person="" upgrade_coin_once="" upgrade_duration="" upgrade_cd="" desc="免费获取金币[&amp;coin_once&amp;]" icon="绿-免费金币" anim="" label="" />

+ 24 - 18
Assets/Resources/XML/lan/ChineseSimplified.xml

@@ -9,6 +9,10 @@
     <Fe_BtnLab1 desc=""><![CDATA[解锁]]></Fe_BtnLab1>
     <Fe_BtnLab2 desc=""><![CDATA[升级]]></Fe_BtnLab2>
     <Fe_BtnLab3 desc=""><![CDATA[购买]]></Fe_BtnLab3>
+    <Fe_BtnLab4 desc=""><![CDATA[等级]]></Fe_BtnLab4>
+    <Fe_BtnLab5 desc=""><![CDATA[无法使用]]></Fe_BtnLab5>
+    <Fe_BtnLab6 desc=""><![CDATA[冷却中]]></Fe_BtnLab6>
+    <Fe_BtnLab7 desc=""><![CDATA[剩余时间]]></Fe_BtnLab7>
     <Fg_Tit desc=""><![CDATA[提示]]></Fg_Tit>
     <Fg_BtnLab desc=""><![CDATA[连接服务器]]></Fg_BtnLab>
     <Fg_Lab desc=""><![CDATA[该功能仅在联网时使用]]></Fg_Lab>
@@ -19,8 +23,10 @@
     <D_StatusLab1 desc=""><![CDATA[进行中]]></D_StatusLab1>
     <D_StatusLab2 desc=""><![CDATA[已暂停]]></D_StatusLab2>
     <D_StatusLab3 desc=""><![CDATA[操作被冻结]]></D_StatusLab3>
-    <Da_Tit desc=""><![CDATA[退出游戏]]></Da_Tit>
-    <Da_Lab desc=""><![CDATA[打理完花园可能获得以下奖励,确定要退出?]]></Da_Lab>
+    <Da_Tit0 desc=""><![CDATA[退出游戏]]></Da_Tit0>
+    <Da_Tit1 desc=""><![CDATA[游戏结束]]></Da_Tit1>
+    <Da_Lab0 desc=""><![CDATA[打理完花园可能获得以下奖励,确定要退出?]]></Da_Lab0>
+    <Da_Lab1 desc=""><![CDATA[得分 : ]]></Da_Lab1>
     <Da_QuitLab desc=""><![CDATA[退出游戏]]></Da_QuitLab>
     <Da_CancelLab desc=""><![CDATA[取消]]></Da_CancelLab>
     <Da_GetAwardLab desc=""><![CDATA[领取奖励]]></Da_GetAwardLab>
@@ -36,7 +42,7 @@
     <Bb_Title desc=""><![CDATA[每日签到]]></Bb_Title>
     <Bb_ConfirmLab desc=""><![CDATA[确定]]></Bb_ConfirmLab>
   </UI>
-  <Flower>
+  <FlowerName>
     <Flower1 desc=""><![CDATA[粉色小花]]></Flower1>
     <Flower2 desc=""><![CDATA[紫色小花]]></Flower2>
     <Flower3 desc=""><![CDATA[波斯菊(粉)]]></Flower3>
@@ -64,7 +70,7 @@
     <Flower25 desc=""><![CDATA[鸢尾(紫)]]></Flower25>
     <Flower26 desc=""><![CDATA[朱槿(粉)]]></Flower26>
     <Flower27 desc=""><![CDATA[朱槿(黄)]]></Flower27>
-  </Flower>
+  </FlowerName>
   <SkillName>
     <Pack1 desc=""><![CDATA[金币大礼包]]></Pack1>
     <Pack2 desc=""><![CDATA[天赐大礼包]]></Pack2>
@@ -100,22 +106,22 @@
     <Skill7 desc=""><![CDATA[技能冷却]]></Skill7>
   </SkillName>
   <SkillDescription>
-    <Pack1 desc=""><![CDATA[立即获得金币 [&coin&]]]></Pack1>
-    <Pack2 desc=""><![CDATA[立即获得金币 [&coin&]]]></Pack2>
-    <Pack3 desc=""><![CDATA[立即获得金币 [&coin&]]]></Pack3>
+    <Pack1 desc=""><![CDATA[立即获得金币[&coin&]]]></Pack1>
+    <Pack2 desc=""><![CDATA[立即获得金币[&coin&]]]></Pack2>
+    <Pack3 desc=""><![CDATA[立即获得金币[&coin&]]]></Pack3>
     <Pack4 desc=""><![CDATA[获得[&flower&],[&diamond&]钻石
 所有金币产出提升[&coin_person&],永久有效]]></Pack4>
     <Pack5 desc=""><![CDATA[获得[&flower&],[&diamond&]钻石
 所有金币产出提升[&coin_person&],永久有效]]></Pack5>
     <Pack6 desc=""><![CDATA[获得[&flower&],[&diamond&]钻石
 所有金币产出提升[&coin_person&],永久有效]]></Pack6>
-    <Pack7 desc=""><![CDATA[购买 [&diamond&]钻石]]></Pack7>
-    <Pack8 desc=""><![CDATA[共计 [&diamond&]钻石]]></Pack8>
-    <Pack9 desc=""><![CDATA[共计 [&diamond&]钻石]]></Pack9>
-    <Pack10 desc=""><![CDATA[共计 [&diamond&]钻石]]></Pack10>
-    <Pack11 desc=""><![CDATA[共计 [&diamond&]钻石]]></Pack11>
-    <Ability1 desc=""><![CDATA[每人次收入 金币[&coin_person&][lv],每分钟来访[&person&*60][lv]人]]></Ability1>
-    <Ability2 desc=""><![CDATA[每分钟增加[&person&*60][lv]人参观,永久有效]]></Ability2>
+    <Pack7 desc=""><![CDATA[购买[&diamond&]钻石]]></Pack7>
+    <Pack8 desc=""><![CDATA[共计[&diamond&]钻石]]></Pack8>
+    <Pack9 desc=""><![CDATA[共计[&diamond&]钻石]]></Pack9>
+    <Pack10 desc=""><![CDATA[共计[&diamond&]钻石]]></Pack10>
+    <Pack11 desc=""><![CDATA[共计[&diamond&]钻石]]></Pack11>
+    <Ability1 desc=""><![CDATA[每人次收入金币[&coin_person&][lv],每分钟来访[&person&*60][lv]人]]></Ability1>
+    <Ability2 desc=""><![CDATA[每分钟来访增加[&person&*60][lv]人参观,永久有效]]></Ability2>
     <Ability3 desc=""><![CDATA[每人次收入提升[&coin_person&][lv],永久有效]]></Ability3>
     <Ability4 desc=""><![CDATA[技能冷却时间减少[&skill_cd&][lv],永久有效]]></Ability4>
     <Ability5 desc=""><![CDATA[每人次参观获得[&coin_person&][lv]金币]]></Ability5>
@@ -129,10 +135,10 @@
     <Ability13 desc=""><![CDATA[每人次参观获得[&coin_person&][lv]金币]]></Ability13>
     <Ability14 desc=""><![CDATA[每人次参观获得[&coin_person&][lv]金币]]></Ability14>
     <Skill1 desc=""><![CDATA[每分钟增加[&person&*60],持续[&duration&/60][lv]分钟]]></Skill1>
-    <Skill2 desc=""><![CDATA[立即获得每人次收入的[&coin_once&][lv]]]></Skill2>
-    <Skill3 desc=""><![CDATA[所有收入提升[&coin_person&],持续[&duration&/60][lv]]]></Skill3>
-    <Skill4 desc=""><![CDATA[所有金币产出提升[&coin_person&],持续[&duration&]分钟]]></Skill4>
-    <Skill5 desc=""><![CDATA[免费获取金币[&coin_once&]]]></Skill5>
+    <Skill2 desc=""><![CDATA[立即获得每人次收入的[&coin_once&][lv]]]></Skill2>
+    <Skill3 desc=""><![CDATA[所有收入提升[&coin_person&],持续[&duration&/60][lv]分钟]]></Skill3>
+    <Skill4 desc=""><![CDATA[所有金币产出提升[&coin_person&],持续[&duration&/60]分钟]]></Skill4>
+    <Skill5 desc=""><![CDATA[免费获取每人次收入的[&coin_once&]倍]]></Skill5>
     <Skill6 desc=""><![CDATA[免费获取金币[&diamond_once&]]]></Skill6>
     <Skill7 desc=""><![CDATA[]]></Skill7>
   </SkillDescription>

+ 10 - 4
Assets/Resources/XML/lan/ChineseTraditional.xml

@@ -9,6 +9,10 @@
     <Fe_BtnLab1 desc=""><![CDATA[]]></Fe_BtnLab1>
     <Fe_BtnLab2 desc=""><![CDATA[]]></Fe_BtnLab2>
     <Fe_BtnLab3 desc=""><![CDATA[]]></Fe_BtnLab3>
+    <Fe_BtnLab4 desc=""><![CDATA[]]></Fe_BtnLab4>
+    <Fe_BtnLab5 desc=""><![CDATA[]]></Fe_BtnLab5>
+    <Fe_BtnLab6 desc=""><![CDATA[]]></Fe_BtnLab6>
+    <Fe_BtnLab7 desc=""><![CDATA[]]></Fe_BtnLab7>
     <Fg_Tit desc=""><![CDATA[]]></Fg_Tit>
     <Fg_BtnLab desc=""><![CDATA[]]></Fg_BtnLab>
     <Fg_Lab desc=""><![CDATA[]]></Fg_Lab>
@@ -19,8 +23,10 @@
     <D_StatusLab1 desc=""><![CDATA[]]></D_StatusLab1>
     <D_StatusLab2 desc=""><![CDATA[]]></D_StatusLab2>
     <D_StatusLab3 desc=""><![CDATA[]]></D_StatusLab3>
-    <Da_Tit desc=""><![CDATA[]]></Da_Tit>
-    <Da_Lab desc=""><![CDATA[]]></Da_Lab>
+    <Da_Tit0 desc=""><![CDATA[]]></Da_Tit0>
+    <Da_Tit1 desc=""><![CDATA[]]></Da_Tit1>
+    <Da_Lab0 desc=""><![CDATA[]]></Da_Lab0>
+    <Da_Lab1 desc=""><![CDATA[]]></Da_Lab1>
     <Da_QuitLab desc=""><![CDATA[]]></Da_QuitLab>
     <Da_CancelLab desc=""><![CDATA[]]></Da_CancelLab>
     <Da_GetAwardLab desc=""><![CDATA[]]></Da_GetAwardLab>
@@ -36,7 +42,7 @@
     <Bb_Title desc=""><![CDATA[]]></Bb_Title>
     <Bb_ConfirmLab desc=""><![CDATA[]]></Bb_ConfirmLab>
   </UI>
-  <Flower>
+  <FlowerName>
     <Flower1 desc=""><![CDATA[]]></Flower1>
     <Flower2 desc=""><![CDATA[]]></Flower2>
     <Flower3 desc=""><![CDATA[]]></Flower3>
@@ -64,7 +70,7 @@
     <Flower25 desc=""><![CDATA[]]></Flower25>
     <Flower26 desc=""><![CDATA[]]></Flower26>
     <Flower27 desc=""><![CDATA[]]></Flower27>
-  </Flower>
+  </FlowerName>
   <SkillName>
     <Pack1 desc=""><![CDATA[]]></Pack1>
     <Pack2 desc=""><![CDATA[]]></Pack2>

+ 10 - 4
Assets/Resources/XML/lan/English.xml

@@ -9,6 +9,10 @@
     <Fe_BtnLab1 desc=""><![CDATA[]]></Fe_BtnLab1>
     <Fe_BtnLab2 desc=""><![CDATA[]]></Fe_BtnLab2>
     <Fe_BtnLab3 desc=""><![CDATA[]]></Fe_BtnLab3>
+    <Fe_BtnLab4 desc=""><![CDATA[]]></Fe_BtnLab4>
+    <Fe_BtnLab5 desc=""><![CDATA[]]></Fe_BtnLab5>
+    <Fe_BtnLab6 desc=""><![CDATA[]]></Fe_BtnLab6>
+    <Fe_BtnLab7 desc=""><![CDATA[]]></Fe_BtnLab7>
     <Fg_Tit desc=""><![CDATA[]]></Fg_Tit>
     <Fg_BtnLab desc=""><![CDATA[]]></Fg_BtnLab>
     <Fg_Lab desc=""><![CDATA[]]></Fg_Lab>
@@ -19,8 +23,10 @@
     <D_StatusLab1 desc=""><![CDATA[]]></D_StatusLab1>
     <D_StatusLab2 desc=""><![CDATA[]]></D_StatusLab2>
     <D_StatusLab3 desc=""><![CDATA[]]></D_StatusLab3>
-    <Da_Tit desc=""><![CDATA[]]></Da_Tit>
-    <Da_Lab desc=""><![CDATA[]]></Da_Lab>
+    <Da_Tit0 desc=""><![CDATA[]]></Da_Tit0>
+    <Da_Tit1 desc=""><![CDATA[]]></Da_Tit1>
+    <Da_Lab0 desc=""><![CDATA[]]></Da_Lab0>
+    <Da_Lab1 desc=""><![CDATA[]]></Da_Lab1>
     <Da_QuitLab desc=""><![CDATA[]]></Da_QuitLab>
     <Da_CancelLab desc=""><![CDATA[]]></Da_CancelLab>
     <Da_GetAwardLab desc=""><![CDATA[]]></Da_GetAwardLab>
@@ -36,7 +42,7 @@
     <Bb_Title desc=""><![CDATA[]]></Bb_Title>
     <Bb_ConfirmLab desc=""><![CDATA[]]></Bb_ConfirmLab>
   </UI>
-  <Flower>
+  <FlowerName>
     <Flower1 desc=""><![CDATA[]]></Flower1>
     <Flower2 desc=""><![CDATA[]]></Flower2>
     <Flower3 desc=""><![CDATA[]]></Flower3>
@@ -64,7 +70,7 @@
     <Flower25 desc=""><![CDATA[]]></Flower25>
     <Flower26 desc=""><![CDATA[]]></Flower26>
     <Flower27 desc=""><![CDATA[]]></Flower27>
-  </Flower>
+  </FlowerName>
   <SkillName>
     <Pack1 desc=""><![CDATA[]]></Pack1>
     <Pack2 desc=""><![CDATA[]]></Pack2>

+ 0 - 27
Assets/Script/Editor/EdiotExcelExport.cs

@@ -1,27 +0,0 @@
-using UnityEngine;
-
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.OleDb;
-using UnityEditor;
-
-[CustomEditor(typeof(ExcelExport))]
-public class EdiotExcelExport : Editor
-{
-    [MenuItem("DashGame/Design Tools/ExportSignConfig")]
-    public static void ExportSignConfig()
-    {
-        string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Assets/XlsxSource/signin_config.xls;" + "Extended Properties='Excel 8.0'";
-
-        OleDbConnection connection = new OleDbConnection(connStr);
-        connection.Open();
-
-        DataSet dataSet = new DataSet();
-        OleDbDataAdapter adapter = new OleDbDataAdapter("select * from [Sheet1$]", connection);
-
-        adapter.Fill(dataSet);
-
-        Debug.Log(dataSet.Tables[0].Columns);
-    }
-}

+ 2 - 2
Assets/Resources/Temp.meta → Assets/Script/Interface.meta

@@ -1,7 +1,7 @@
 fileFormatVersion: 2
-guid: 0dcf62c8561c02f479195703efe90da2
+guid: b532d4612c2813c4fab4492a713c4e78
 folderAsset: yes
-timeCreated: 1486173350
+timeCreated: 1490233729
 licenseType: Pro
 DefaultImporter:
   userData: 

+ 26 - 0
Assets/Script/Interface/Regist.cs

@@ -0,0 +1,26 @@
+using UnityEngine;
+
+using System.Collections;
+
+public class Regist : MonoBehaviour
+{
+    public virtual void RegistValueA()
+    {
+        
+    }
+
+    public virtual void RegistValueB()
+    {
+        
+    }
+
+    public virtual void RegistValueC()
+    {
+        
+    }
+
+    public virtual void RegistReference()
+    {
+        
+    }
+}

+ 2 - 2
Assets/Script/Editor/EdiotExcelExport.cs.meta → Assets/Script/Interface/Regist.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 6be060908efe9ab4ea5446e78b6b9352
-timeCreated: 1490160929
+guid: a2197a90bf67a3249b4ef616b8e1ee52
+timeCreated: 1490233758
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 35 - 24
Assets/Script/Manage/Initializer.cs

@@ -4,39 +4,50 @@ using UnityEngine;
 using UnityEngine.EventSystems;
 
 using System.Collections;
-using System.Diagnostics;
-
-public delegate void Regist();
+using System.Collections.Generic;
 
 public class Initializer : MonoBehaviour 
 {
     #region
 
-    public static Regist RegistValue;
-    public static Regist RegistReference;
+    public static List<Regist> RegistList;
 
     #endregion
 
     private void Start()
     {
-        gameObject.AddComponent<ManaReso>();
-        gameObject.AddComponent<ManaAnim>();
-        gameObject.AddComponent<ManaAudio>();
-
-        gameObject.AddComponent<ManaData>();
-
-        gameObject.AddComponent<ManaUI>();
-        gameObject.AddComponent<ManaGarden>();
-
-        gameObject.AddComponent<ManaPlayer>();
-        gameObject.AddComponent<ManaMiniGame>();
-
-        gameObject.AddComponent<ManaLog>();
-
-        RegistReference();
-        RegistValue();
-
-        ManaLog.Log(string.Format("开始调试 每<color=red>{0}</color>秒计算一次收入", ManaData.CircleTime));
-        ManaLog.Log(string.Format("开始调试 按<color=red>{0}</color>键-升级花园 <color=red>{1}</color>键-冷却技能 <color=red>{2}</color>键-获取游戏币", "P", "O", "I"));
+        RegistList = new List<Regist>();
+
+        gameObject.AddScript<ManaReso>();
+        gameObject.AddScript<ManaAnim>();
+        gameObject.AddScript<ManaAudio>();
+
+        gameObject.AddScript<ManaUI>();
+        gameObject.AddScript<ManaData>();
+        gameObject.AddScript<ManaGarden>();
+
+        gameObject.AddScript<ManaDebug>();
+        gameObject.AddScript<ManaPlayer>();
+        gameObject.AddScript<ManaMiniGame>();
+
+        for (int i = 0; i < RegistList.Count; i++)
+        {
+            RegistList[i].RegistReference();
+        }
+
+        for (int i = 0; i < RegistList.Count; i++)
+        {
+            RegistList[i].RegistValueA();
+        }
+
+        for (int i = 0; i < RegistList.Count; i++)
+        {
+            RegistList[i].RegistValueB();
+        }
+
+        for (int i = 0; i < RegistList.Count; i++)
+        {
+            RegistList[i].RegistValueC();
+        }
     }
 }

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

@@ -7,6 +7,7 @@ public class Main : MonoBehaviour
 {
 	private void Awake()
 	{
-	    gameObject.AddComponent<Initializer>();
-	}
+	    gameObject.AddScript<Auxiliary>();
+	    gameObject.AddScript<Initializer>();
+    }
 }

+ 30 - 29
Assets/Script/Manage/ManaAnim.cs

@@ -18,7 +18,7 @@ public delegate Color CurveFunctionC(float timer, float duration, Color start, C
 
 public delegate Vector3 CurveFunctionV(float timer, float duration, Vector3 start, Vector3 delta);
 
-public class ManaAnim : MonoBehaviour 
+public class ManaAnim : Regist 
 {
     #region 变量
 
@@ -40,34 +40,6 @@ public class ManaAnim : MonoBehaviour
 
     #endregion
 
-    private void Awake()
-    {
-        MoveList = new List<Move>();
-        TweenForList = new List<Tween>();
-        TweenBacList = new List<Tween>();
-
-        FunctionDicF = new Dictionary<Curve, CurveFunctionF>();
-        FunctionDicC = new Dictionary<Curve, CurveFunctionC>();
-        FunctionDicV = new Dictionary<Curve, CurveFunctionV>();
-
-        MoveVecDic = new Dictionary<Transform, MoveVec>();
-        TweenCgDic = new Dictionary<Transform, TweenCG>();
-        TweenGraDic = new Dictionary<Transform, TweenGra>();
-        TweenVecDic = new Dictionary<Transform, TweenVec>();
-        TweenRectDic = new Dictionary<Transform, TweenRect>();
-        TweenScaleDic = new Dictionary<Transform, TweenScale>();
-        TweenAudioDic = new Dictionary<Transform, TweenAudio>();
-
-        FunctionDicF.Add(Curve.Linear, Linear);
-        FunctionDicF.Add(Curve.EaseOutQuad, EaseOutQuad);
-
-        FunctionDicC.Add(Curve.Linear, Linear);
-        FunctionDicC.Add(Curve.EaseOutQuad, EaseOutQuad);
-
-        FunctionDicV.Add(Curve.Linear, Linear);
-        FunctionDicV.Add(Curve.EaseOutQuad, EaseOutQuad);
-    }
-
     private void FixedUpdate()
     {
         for (int i = 0; i < MoveList.Count; i++)
@@ -96,6 +68,35 @@ public class ManaAnim : MonoBehaviour
     }
 
 
+    public override void RegistValueA()
+    {
+        MoveList = new List<Move>();
+        TweenForList = new List<Tween>();
+        TweenBacList = new List<Tween>();
+
+        FunctionDicF = new Dictionary<Curve, CurveFunctionF>();
+        FunctionDicC = new Dictionary<Curve, CurveFunctionC>();
+        FunctionDicV = new Dictionary<Curve, CurveFunctionV>();
+
+        MoveVecDic = new Dictionary<Transform, MoveVec>();
+        TweenCgDic = new Dictionary<Transform, TweenCG>();
+        TweenGraDic = new Dictionary<Transform, TweenGra>();
+        TweenVecDic = new Dictionary<Transform, TweenVec>();
+        TweenRectDic = new Dictionary<Transform, TweenRect>();
+        TweenScaleDic = new Dictionary<Transform, TweenScale>();
+        TweenAudioDic = new Dictionary<Transform, TweenAudio>();
+
+        FunctionDicF.Add(Curve.Linear, Linear);
+        FunctionDicF.Add(Curve.EaseOutQuad, EaseOutQuad);
+
+        FunctionDicC.Add(Curve.Linear, Linear);
+        FunctionDicC.Add(Curve.EaseOutQuad, EaseOutQuad);
+
+        FunctionDicV.Add(Curve.Linear, Linear);
+        FunctionDicV.Add(Curve.EaseOutQuad, EaseOutQuad);
+    }
+
+
     #region 曲线
 
     public static float Linear(float timer, float duration, float start, float delta)

+ 6 - 7
Assets/Script/Manage/ManaAudio.cs

@@ -2,7 +2,7 @@
 
 using System.Collections;
 
-public class ManaAudio : MonoBehaviour 
+public class ManaAudio : Regist
 {
     #region 变量
 
@@ -15,15 +15,14 @@ public class ManaAudio : MonoBehaviour
 
     private void Awake()
     {
-        Initializer.RegistValue += RegistValue;
-        Initializer.RegistReference+= RegistReference;
+        Transform tra = new GameObject("Audio").transform;
 
-        ManaReso.Get("MusicMini", Folder.Object, true, null, true);
-        ManaReso.Get("MusicTheme", Folder.Object, true, null, true);
+        ManaReso.Get("MusicMini", Folder.Object, true, tra, true);
+        ManaReso.Get("MusicTheme", Folder.Object, true, tra, true);
     }
 
 
-	private void RegistValue()
+    public override void RegistValueA()
 	{
         #region MusicMini
 
@@ -66,7 +65,7 @@ public class ManaAudio : MonoBehaviour
         ManaReso.Get("MusicTheme").TweenForAudio();
     }
 
-    private void RegistReference()
+    public override void RegistReference()
     {
         MusicMini = ManaReso.Get<AudioSource>("MusicMini");
         MusicTheme = ManaReso.Get<AudioSource>("MusicTheme");

+ 139 - 95
Assets/Script/Manage/ManaData.cs

@@ -8,7 +8,7 @@ using System.Xml;
 using System.Collections;
 using System.Collections.Generic;
 
-public class ManaData : MonoBehaviour 
+public class ManaData : Regist 
 {
     #region 变量
 
@@ -19,12 +19,33 @@ public class ManaData : MonoBehaviour
         {
             _Level = value;
 
+            ManaDebug.Log(string.Format("已升级 花园等级 : <color=red>{0}</color>", _Level));
+
             for (int i = 0; i < SkillList.Count; i++)
             {
-                SkillList[i].OnLevelChange();
+                SkillList[i].UpdateStatus();
             }
+        }
+    }
+    public static bool Pause
+    {
+        get { return _Pause; }
+        set
+        {
+            _Pause = value;
+
+            if (_Pause)
+            {
+                Time.timeScale = 0;
 
-            ManaLog.Log(string.Format("已升级 花园等级 : <color=red>{0}</color>", _Level));
+                ManaDebug.Log("<color=red>游戏暂停</color>");
+            }
+            else
+            {
+                Time.timeScale = 1;
+
+                ManaDebug.Log("<color=red>游戏继续</color>");
+            }
         }
     }
     public static float Person
@@ -68,8 +89,9 @@ public class ManaData : MonoBehaviour
             ManaReso.SetText("F_DiamondLab", _Diamond.ToString("0"));
         }
     }
-    
+
     private static int _Level;
+    private static bool _Pause;
     private static float _Person;
     private static float _CoinPerson;
     private static double _Coin;
@@ -82,28 +104,27 @@ public class ManaData : MonoBehaviour
 
     public static int Sign;
     public static int Main;
+    public static bool Mini;
     public static bool SkillBar;
     public static bool Connect;
     public static float OpTime;
-    public static float CircleTime;
     public static float OpTimer;
+    public static float MiniTimer;
+    public static float CircleTime;
     public static float CircleTimer;
     public static float NewPerson;
     public static float NewCoinPerson;
 
     public static List<Skill> CoolList;
+    public static List<SkillRoot> UseList;
     public static List<SkillRoot> SkillList;
-    public static List<SkillRoot> UsingList;
     public static Dictionary<string, SkillRoot> SkillDic;
 
     #endregion
 
     private void Awake()
     {
-        Initializer.RegistValue += RegistValue;
-
-        ManaReso.Get("Canvas", Folder.PrefabUI, true, null, true);
-        ManaReso.Get("EventSystem", Folder.PrefabUI, false, null, false);
+        #region 生成技能条
 
         #region 读技能配置
 
@@ -144,19 +165,17 @@ public class ManaData : MonoBehaviour
 
             #endregion
 
-            SkillList.Add(skillRoot);
             SkillDic.Add(skillRoot.Name, skillRoot);
+            SkillList.Add(skillRoot);
         }
-        
-        SkillList.Sort(SkillRoot.SortByClassID);
 
-        #endregion
+        SkillList.Sort(SkillRoot.Sort);
 
-        #region 创建技能条
+        #endregion
 
         for (int i = 0; i < SkillList.Count; i++)
         {
-            if (SkillList[i].Tab != SkillTab.Null)
+            if (SkillList[i].SkillTab != SkillTab.Null)
             {
                 ManaReso.GetSkillItem(SkillList[i]);
             }
@@ -167,11 +186,21 @@ public class ManaData : MonoBehaviour
 
     private void Update()
     {
-        if (Math.Abs(Time.timeScale) < 0.0005f)
+        if (Pause)
         {
             return;
         }
-        
+
+        if (Mini == false)
+        {
+            MiniTimer -= Time.deltaTime;
+
+            if (MiniTimer < 0)
+            {
+                ManaReso.Get("C_MiniGame").TweenForCG();
+            }
+        }
+
         if (Auxiliary.AnyKeyUp)
         {
             OpTimer = 0;
@@ -179,8 +208,6 @@ public class ManaData : MonoBehaviour
             if (Main == 0)
             {
                 ManaReso.Get("C_Main").TweenForCG();
-
-                Main--;
             }
         }
         else
@@ -194,8 +221,6 @@ public class ManaData : MonoBehaviour
                 if (Main == -1)
                 {
                     ManaReso.Get("C_Main").TweenBacCG();
-
-                    Main++;
                 }
             }
         }
@@ -205,16 +230,16 @@ public class ManaData : MonoBehaviour
     {
         #region 使用技能
 
-        for (int i = 0; i < UsingList.Count; i++)
+        for (int i = 0; i < UseList.Count; i++)
         {
-            if (UsingList[i].DoUse())
+            if (UseList[i].DoUse())
             {
                 i--;
             }
         }
 
         #endregion
-
+        
         #region 冷却技能
 
         for (int i = 0; i < CoolList.Count; i++)
@@ -244,18 +269,25 @@ public class ManaData : MonoBehaviour
 
             if (Main == -1)
             {
-                ManaReso.GetHudText("+" + temp.ToString("0"), ManaReso.Get("C_HudTra"), false, 25, Color.red);
+                ManaReso.GetHudText("+" + temp.ToString("0"), Color.red, 25, ManaReso.Get("C_HudTra"), ManaReso.Get("C_Main"), false);
             }
 
-            ManaLog.Log(string.Format("参观收益<color=red>{0:0}</color> = <color=red>{1}</color> * <color=red>{2}</color> * <color=red>{3}</color> * <color=red>{4}</color> (人次*金币*时间*加成)", temp, NewPerson, NewCoinPerson, CircleTime, 1 + SkillPlus));
+            ManaDebug.Log(string.Format("参观收益<color=red>{0:0}</color> = <color=red>{1}</color> * <color=red>{2}</color> * <color=red>{3}</color> * <color=red>{4}</color> (人次*金币*时间*加成)", temp, NewPerson, NewCoinPerson, CircleTime, 1 + SkillPlus));
         }
 
         #endregion
     }
 
 
-    private void RegistValue()
+    public override void RegistValueA()
     {
+        OpTime = 5;
+        MiniTimer = 0;
+        CircleTime = 60;
+        CircleTimer = 60;
+
+        #region 调试
+
         if (ManaReso.Get("B_SignIn").gameObject.activeSelf)
         {
             Main = 1;
@@ -265,36 +297,78 @@ public class ManaData : MonoBehaviour
             Main = 0;
         }
 
-        OpTime = 5;
-        CircleTime = 10;
-        CircleTimer = 10;
+        #endregion
 
-        CoolList = new List<Skill>();
-        UsingList = new List<SkillRoot>();
+        #region 读花朵存档
+
+        XmlAttributeCollection attributes = Data.PlayerNode.SelectSingleNode("FlowerList").Attributes;
+
+        if (!string.IsNullOrEmpty(attributes[0].Value))
+        {
+            string[] strings = attributes[0].Value.Split(' ');
+
+            for (int i = 0; i < strings.Length; i++)
+            {
+                int id = int.Parse(strings[i]);
+
+                ManaGarden.FlowerInfoDic[id].Unlock = true;
+            }
+        }
+
+        attributes = Data.PlayerNode.SelectSingleNode("PlantList").Attributes;
+
+        for (int i = 0; i < attributes.Count; i++)
+        {
+            int id = int.Parse(attributes[i].Value);
 
+            ManaGarden.PlantFlower(id, ManaReso.Get(attributes[i].Name));
+        }
+
+        #endregion
+
+        #region 读数据存档
+
+        Sign = int.Parse(Data.PlayerNode.SelectSingleNode("Sign").Attributes[0].Value);
+
+        #endregion
+    }
+
+    public override void RegistValueC()
+    {
         #region 读技能存档
 
-        double elapse = DateTime.Now.Subtract(DateTime.Parse(Data.PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value)).TotalSeconds;
+        CoolList = new List<Skill>();
+        UseList = new List<SkillRoot>();
+
+        float elapse = (float) DateTime.Now.Subtract(DateTime.Parse(Data.PlayerNode.SelectSingleNode("QuitTime").Attributes[0].Value)).TotalSeconds;
 
         if (elapse > 43200)
         {
             elapse = 43200;
         }
 
+        ManaDebug.Log(string.Format("离线时间<color=red>{0}</color>", elapse));
+
         XmlNodeList xmlNodeList = Data.PlayerNode.SelectSingleNode("SkillList").ChildNodes;
 
         List<SkillRoot> ffCoolList = new List<SkillRoot>();
-        List<List<SkillRoot>> ffList = new List<List<SkillRoot>>();
+        List<List<SkillRoot>> ffUseList = new List<List<SkillRoot>>();
 
         if (elapse > CircleTimer)
         {
-            int ffCircle = 1 + Mathf.FloorToInt((float)((elapse - CircleTimer) / CircleTime));
+            int ffCircle = 1 + Mathf.FloorToInt((elapse - CircleTimer)/CircleTime);
+
+            ManaDebug.Log(string.Format("离线周期<color=red>{0}</color>", ffCircle));
 
             for (int i = 0; i < ffCircle; i++)
             {
-                ffList.Add(new List<SkillRoot>());
+                ffUseList.Add(new List<SkillRoot>());
             }
         }
+        else
+        {
+            ManaDebug.Log(string.Format("离线周期<color=red>{0}</color>", 0));
+        }
 
         for (int i = 0; i < xmlNodeList.Count; i++)
         {
@@ -306,11 +380,11 @@ public class ManaData : MonoBehaviour
 
                 skill.Level = int.Parse(xmlNodeList[i].Attributes[2].Value);
                 skill.CoolTimer = float.Parse(xmlNodeList[i].Attributes[3].Value);
-                skill.UsingTimer = float.Parse(xmlNodeList[i].Attributes[4].Value);
+                skill.UseTimer = float.Parse(xmlNodeList[i].Attributes[4].Value);
 
                 skill._ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value);
 
-                skill.RegistValue(elapse, ffList);
+                skill.RegistValue(elapse, ffUseList);
             }
             else if (xmlNodeList[i].Attributes[0].Value == SkillType.BigSkill.ToString())
             {
@@ -320,12 +394,12 @@ public class ManaData : MonoBehaviour
 
                 bigSkill.Level = int.Parse(xmlNodeList[i].Attributes[3].Value);
                 bigSkill.CoolTimer = float.Parse(xmlNodeList[i].Attributes[4].Value);
-                bigSkill.UsingTimer = float.Parse(xmlNodeList[i].Attributes[5].Value);
+                bigSkill.UseTimer = float.Parse(xmlNodeList[i].Attributes[5].Value);
 
-                bigSkill._ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value); //Sa0
-                bigSkill._BarStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[2].Value); //Sa1
+                bigSkill._ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value);
+                bigSkill._BarStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[2].Value);
 
-                bigSkill.RegistValue(elapse, ffList);
+                bigSkill.RegistValue(elapse, ffUseList);
             }
             else if (xmlNodeList[i].Attributes[0].Value == SkillType.Pack.ToString())
             {
@@ -334,9 +408,10 @@ public class ManaData : MonoBehaviour
                 pack.RegistReference();
 
                 pack.Level = int.Parse(xmlNodeList[i].Attributes[3].Value);
+
                 pack._ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[2].Value);
 
-                pack.RegistValue(elapse, ffList);
+                pack.RegistValue(elapse, ffUseList);
             }
             else if (xmlNodeList[i].Attributes[0].Value == SkillType.Ability.ToString())
             {
@@ -345,9 +420,10 @@ public class ManaData : MonoBehaviour
                 ability.RegistReference();
 
                 ability.Level = int.Parse(xmlNodeList[i].Attributes[2].Value);
+
                 ability._ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), xmlNodeList[i].Attributes[1].Value);
 
-                ability.RegistValue(elapse, ffList);
+                ability.RegistValue(elapse, ffUseList);
             }
             else
             {
@@ -357,41 +433,8 @@ public class ManaData : MonoBehaviour
 
         #endregion
 
-        #region 读花朵存档
-
-        XmlAttributeCollection attributes = Data.PlayerNode.SelectSingleNode("FlowerList").Attributes;
-
-        if (string.IsNullOrEmpty(attributes[0].Value) == false)
-        {
-            string[] strings = attributes[0].Value.Split(' ');
-
-            for (int i = 0; i < strings.Length; i++)
-            {
-                if (string.IsNullOrEmpty(strings[i]))
-                {
-                    continue;
-                }
-
-                int id = int.Parse(strings[i]);
-
-                ManaGarden.FlowerDic[id].Unlock = true;
-            }
-        }
-
-        attributes = Data.PlayerNode.SelectSingleNode("PlantList").Attributes;
-
-        for (int i = 0; i < attributes.Count; i++)
-        {
-            int id = int.Parse(attributes[i].Value);
-
-            ManaGarden.PlaceFlower(id, ManaReso.Get(attributes[i].Name));
-        }
-
-        #endregion
-
         #region 读数据存档
 
-        Sign = int.Parse(Data.PlayerNode.SelectSingleNode("Sign").Attributes[0].Value);
         Level = int.Parse(Data.PlayerNode.SelectSingleNode("Level").Attributes[0].Value);
 
         Coin = double.Parse(Data.PlayerNode.SelectSingleNode("Coin").Attributes[0].Value);
@@ -401,31 +444,32 @@ public class ManaData : MonoBehaviour
 
         #region 计算离线收入
 
-        double collectCoin = 0;
+        float collectCoin = 0;
 
-        if (ffList.Count > 0)
+        if (ffUseList.Count > 0)
         {
-            for (int i = 0; i < ffList.Count; i++)
+            for (int i = 0; i < ffUseList.Count; i++)
             {
                 for (int j = 0; j < ffCoolList.Count; j++)
                 {
-                    if (ffCoolList[j].SkillType == SkillType.Skill || ffCoolList[j].SkillType == SkillType.BigSkill)
+                    if (ffCoolList[j] is Skill)
                     {
                         if (i == 0)
                         {
-                            ((Skill) ffCoolList[j]).CoolTimer -= CircleTimer;
+                            ((Skill)ffCoolList[j]).CoolTimer -= CircleTimer;
                         }
                         else
                         {
                             ((Skill)ffCoolList[j]).CoolTimer -= CircleTime;
-                        } 
+                        }
                     }
                 }
-                
-                for (int j = 0; j < ffList[i].Count; j++)
+
+                for (int j = 0; j < ffUseList[i].Count; j++)
                 {
-                    ffList[i][j].Annul();
-                    ffCoolList.Add(ffList[i][j]);
+                    ffUseList[i][j].Annul();
+
+                    ffCoolList.Add(ffUseList[i][j]);
                 }
 
                 NewPerson = Person * (1 + SkillPersonBuff) + SkillPerson;
@@ -435,15 +479,15 @@ public class ManaData : MonoBehaviour
             }
 
             Coin += collectCoin;
-            
-            ManaReso.SetText("Ba_IconLab", collectCoin.ToString("0"));
 
-            CircleTimer = (float)((elapse - CircleTimer) % CircleTime);
+            CircleTimer = (elapse - CircleTimer)%CircleTime;
+
+            ManaReso.SetText("Ba_IconLab", collectCoin.ToString("0"));
         }
         else
         {
-            CircleTimer = (float)(CircleTimer - elapse);
-
+            CircleTimer = CircleTimer - elapse;
+            
             ManaReso.SetText("Ba_IconLab", "0");
         }
 
@@ -477,7 +521,7 @@ public class ManaData : MonoBehaviour
             }
             else
             {
-                ManaLog.Log("您没有足够的金币");
+                ManaDebug.Log("您没有足够的金币");
 
                 return false;
             }
@@ -492,7 +536,7 @@ public class ManaData : MonoBehaviour
             }
             else
             {
-                ManaLog.Log("您没有足够的钻石");
+                ManaDebug.Log("您没有足够的钻石");
 
                 return false;
             }

+ 46 - 0
Assets/Script/Manage/ManaDebug.cs

@@ -0,0 +1,46 @@
+using UnityEngine;
+using UnityEngine.UI;
+using UnityEngine.Serialization;
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+
+using Random = UnityEngine.Random;
+
+public class ManaDebug : MonoBehaviour 
+{
+    #region 变量
+
+    private static Text Lab;
+
+    #endregion
+
+    private void Awake()
+    {
+        Lab = ManaReso.Get<Text>("E_ScrrLab");
+    }
+
+
+    public static void Log(string message)
+    {
+        Lab.text += '\n' + message;
+    }
+
+    public static void LockBtn()
+    {
+        if (ManaData.Pause)
+        {
+            ManaData.Pause = false;
+
+            ManaReso.SetText("E_PauseLab", "暂停");
+        }
+        else
+        {
+            ManaData.Pause = true;
+
+            ManaReso.SetText("E_PauseLab", "继续");
+        }
+    }
+}

+ 0 - 0
Assets/Script/Manage/ManaLog.cs.meta → Assets/Script/Manage/ManaDebug.cs.meta


+ 110 - 62
Assets/Script/Manage/ManaGarden.cs

@@ -9,35 +9,94 @@ using System.Linq;
 using System.Collections;
 using System.Collections.Generic;
 
-public class ManaGarden : MonoBehaviour
+public class ManaGarden : Regist
 {
     #region 变量
 
-    public static int MyFlowerSpec;
-    public static int MyFlowerRegu;
-    public static int TotalFlowerSpec;
-    public static int TotalFlowerRegu;
+    public static int MyFlower
+    {
+        get { return _MyFlower; }
+        set
+        {
+            _MyFlower = value;
+
+            ManaReso.SetText("F_FlowerLab", string.Format("{0}", MyFlower));
+            ManaReso.SetText("G_CollectLab1", string.Format("{0}/{1}", MyFlower, TotalFlower));
+        }
+    }
+    public static int MyFlowerSpec
+    {
+        get { return _MyFlowerSpec; }
+        set
+        {
+            _MyFlowerSpec = value;
+
+            MyFlower = _MyFlowerSpec + _MyFlowerRegu;
+        }
+    }
+    public static int MyFlowerRegu
+    {
+        get { return _MyFlowerRegu; }
+        set
+        {
+            _MyFlowerRegu = value;
+
+            MyFlower = _MyFlowerSpec + _MyFlowerRegu;
+        }
+    }
+
+    public static int TotalFlower
+    {
+        get { return _TotalFlower; }
+        set { _TotalFlower = value; }
+    }
+    public static int TotalFlowerSpec
+    {
+        get { return _TotalFlowerSpec; }
+        set
+        {
+            _TotalFlowerSpec = value;
+
+            TotalFlower = _TotalFlowerSpec + _TotalFlowerRegu;
+        }
+    }
+    public static int TotalFlowerRegu
+    {
+        get { return _TotalFlowerRegu; }
+        set
+        {
+            _TotalFlowerRegu = value;
+
+            TotalFlower = _TotalFlowerSpec + _TotalFlowerRegu;
+        }
+    }
+
+    private static int _MyFlower;
+    private static int _MyFlowerSpec;
+    private static int _MyFlowerRegu;
+
+    private static int _TotalFlower;
+    private static int _TotalFlowerSpec;
+    private static int _TotalFlowerRegu;
 
     public static int SeleId;
     public static Flower SeleFlower;
-    public static Transform SeleFlowerTra;
+    public static Transform SelePosTra;
     public static List<Flower> PlantList;
-    public static List<Transform> FlowerTraList;
-    public static Dictionary<int, FlowerInfo> FlowerDic;
+    public static List<Transform> PosTraList;
+    public static Dictionary<int, FlowerInfo> FlowerInfoDic;
 
     #endregion
 
     private void Awake()
     {
-        Initializer.RegistValue += RegistValue;
-
-        PlantList = new List<Flower>();
-        FlowerDic = new Dictionary<int, FlowerInfo>();
-
-        ManaReso.Get("Garden", Folder.Object, true, transform, true).AddComponent<Garden>();
+        ManaReso.Get("Garden", Folder.Object, true, transform, true).AddScript<Garden>();
 
         #region 生成FlowerItem
 
+        PlantList = new List<Flower>();
+        FlowerInfoDic = new Dictionary<int, FlowerInfo>();
+
         List<XmlAttributeCollection> attributesList = Data.GetFlowerConfig();
 
         for (int i = 0; i < attributesList.Count; i++)
@@ -53,14 +112,18 @@ public class ManaGarden : MonoBehaviour
                 TotalFlowerRegu++;
             }
 
-            FlowerDic.Add(flowerInfo.Id, flowerInfo);
+            FlowerInfoDic.Add(flowerInfo.Id, flowerInfo);
         }
 
         #endregion
+    }
+
 
-        #region 得到土堆
+    public override void RegistValueA()
+    {
+        SeleId = 1;
 
-        FlowerTraList = new List<Transform>()
+        PosTraList = new List<Transform>()
         {
             ManaReso.Get("FlowerTraA1"),
             ManaReso.Get("FlowerTraA2"),
@@ -81,14 +144,6 @@ public class ManaGarden : MonoBehaviour
             ManaReso.Get("FlowerTraB8"),
             ManaReso.Get("FlowerTraB9"),
         };
-
-        #endregion
-    }
-
-
-    private static void RegistValue()
-    {
-        SeleId = 1;
     }
 
 
@@ -96,7 +151,7 @@ public class ManaGarden : MonoBehaviour
     {
         SeleId = id;
 
-        FlowerInfo flowerInfo = FlowerDic[id];
+        FlowerInfo flowerInfo = FlowerInfoDic[id];
 
         ManaReso.SetText("H_Lab", flowerInfo.Name);
 
@@ -107,17 +162,10 @@ public class ManaGarden : MonoBehaviour
         Vector2 newSize = flowerInfo.Sprite.rect.size;
         newSize.x *= 0.65f;
         newSize.y *= 0.65f;
-        image.rectTransform.sizeDelta = newSize;
-    }
-
-    public static void UpdateCollectStatus()
-    {
-        int myTotalFlower = MyFlowerSpec + MyFlowerRegu;
 
-        ManaReso.SetText("F_FlowerLab", myTotalFlower.ToString());
-        ManaReso.SetText("G_CollectLab1", string.Format("{0}/{1}", myTotalFlower, TotalFlowerRegu + TotalFlowerSpec));
+        image.rectTransform.sizeDelta = newSize;
     }
-    
+        
 
     public static void RetriveFlower()
     {
@@ -125,11 +173,11 @@ public class ManaGarden : MonoBehaviour
 
         PlantList.Remove(SeleFlower);
 
-        FlowerInfo flowerInfo = FlowerDic[SeleFlower.Id];
+        FlowerInfo flowerInfo = FlowerInfoDic[SeleFlower.Id];
 
         flowerInfo.Plant = false;
 
-        SeleFlower.PosTra.SetCollider(true);
+        SeleFlower.ParTra.SetCollider(true);
     }
 
     public static void RetriveFlowerAll()
@@ -138,85 +186,85 @@ public class ManaGarden : MonoBehaviour
         {
             ManaReso.Save(PlantList[i]);
             
-            PlantList[i].PosTra.SetCollider(true);
+            PlantList[i].ParTra.SetCollider(true);
+
             PlantList.RemoveAt(i--);
         }
 
-        foreach (var kv in FlowerDic)
+        foreach (var kv in FlowerInfoDic)
         {
             kv.Value.Plant = false;
         }
     }
 
 
-    public static void PlaceFlower()
+    public static void PlantFlower()
     {
-        FlowerInfo flowerInfo = FlowerDic[SeleId];
+        FlowerInfo flowerInfo = FlowerInfoDic[SeleId];
 
         if (flowerInfo.Plant)
         {
-            ManaLog.Log("已经种植过了");
+            ManaDebug.Log("已经种植过了");
         }
         else
         {
             flowerInfo.Plant = true;
 
-            Flower flower = ManaReso.GetFlower(SeleId, true, SeleFlowerTra);
+            Flower flower = ManaReso.GetFlower(SeleId, true, SelePosTra);
 
             PlantList.Add(flower);
         }
-    } //FlowerCard种植
+    }
 
-    public static void PlaceFlower(int id)
+    public static void PlantFlower(int id)
     {
-        Transform tra = null;
+        Transform posTra = null;
 
-        for (int i = 0; i < FlowerTraList.Count; i++)
+        for (int i = 0; i < PosTraList.Count; i++)
         {
-            if (FlowerTraList[i].childCount == 0)
+            if (PosTraList[i].childCount == 0)
             {
-                tra = FlowerTraList[i];
+                posTra = PosTraList[i];
 
                 break;
             }
         }
 
-        if (tra == null)
+        if (posTra == null)
         {
-            ManaLog.Log("已经没有空地了");
+            ManaDebug.Log("已经没有空地了");
         }
         else
         {
-            FlowerInfo flowerInfo = FlowerDic[id];
+            FlowerInfo flowerInfo = FlowerInfoDic[id];
 
             if (flowerInfo.Plant)
             {
-                ManaLog.Log("已经种植过了");
+                ManaDebug.Log("已经种植过了");
             }
             else
             {
                 flowerInfo.Plant = true;
 
-                Flower flower = ManaReso.GetFlower(id, true, tra);
-
-                flower.Id = id;
-                flower.PosTra = tra;
+                Flower flower = ManaReso.GetFlower(id, true, posTra);
 
                 PlantList.Add(flower);
 
-                tra.SetCollider(false); //空地Collider
+                posTra.SetCollider(false);
             }
         }
     }
 
-    public static void PlaceFlower(int id, Transform tra)
+    public static void PlantFlower(int id, Transform posTra)
     {
-        FlowerInfo flowerInfo = FlowerDic[id];
+        FlowerInfo flowerInfo = FlowerInfoDic[id];
 
         flowerInfo.Plant = true;
 
-        Flower flower = ManaReso.GetFlower(id, true, tra);
+        Flower flower = ManaReso.GetFlower(id, true, posTra);
 
         PlantList.Add(flower);
-    } //读存档时调用
+
+        posTra.SetCollider(false);
+    }
 }

+ 0 - 74
Assets/Script/Manage/ManaLog.cs

@@ -1,74 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-using UnityEngine.Serialization;
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-using Random = UnityEngine.Random;
-
-public class ManaLog : MonoBehaviour 
-{
-    #region 变量
-
-    private static bool Lock;
-    private static Text Lab;
-    private static List<string> TextList;
-
-    #endregion
-
-    private void Awake()
-    {
-        Lab = ManaReso.Get<Text>("E_ScrrLab");
-
-        Initializer.RegistValue += RegistValue;
-    }
-
-
-    private static void RegistValue()
-    {
-        TextList = new List<string>();
-    }
-
-
-    public static void Log(string message)
-    {
-        if (Lab)
-        {
-            if (Lock)
-            {
-                TextList.Add('\n' + message);
-            }
-            else
-            {
-                Lab.text += '\n' + message;
-            }
-        }
-    }
-
-
-    public static void Throw(string message = "Exception")
-    {
-        Lab.text += string.Format("\n<color=red>{0}</color>", message);
-    }
-
-    public static void LockBtn()
-    {
-        if (Lock)
-        {
-            for (int i = 0; i < TextList.Count; i++)
-            {
-                Lab.text += TextList[i];
-            }
-
-            ManaReso.SetText("E_LockLab", "固定");
-        }
-        else
-        {
-            ManaReso.SetText("E_LockLab", "解锁");
-        }
-
-        Lock = !Lock;
-    }
-}

+ 235 - 143
Assets/Script/Manage/ManaMiniGame.cs

@@ -3,36 +3,138 @@ using UnityEngine.UI;
 using UnityEngine.Serialization;
 
 using System;
+using System.Xml;
 using System.Collections;
 using System.Collections.Generic;
 
 using Random = UnityEngine.Random;
 
-public class ManaMiniGame : MonoBehaviour 
+public class Award
 {
     #region 变量
 
-    #region Game
+    public int DiamondMin;
+    public int DiamondMax;
+    public string CoinFml;
+    public string FlowerFml;
+    public string DiamondFml;
 
-    public static int Score
+    public List<float> Odds;
+    public List<float> Standard;
+
+    #endregion
+
+    public Award(XmlAttributeCollection attribute)
     {
-        get { return _Score; }
-        set
+        CoinFml = attribute[1].Value;
+        FlowerFml = attribute[4].Value;
+        DiamondFml = attribute[3].Value;
+
+        string[] strings = attribute[2].Value.Split(',');
+
+        DiamondMin = int.Parse(strings[0]);
+        DiamondMax = int.Parse(strings[1]);
+
+        strings = attribute[5].Value.Split(',');
+
+        Odds = new List<float>()
         {
-            _Score = value;
+            float.Parse(strings[0]),
+            float.Parse(strings[1]),
+            float.Parse(strings[2]),
+        };
+
+        strings = attribute[6].Value.Split(',');
+
+        Standard = new List<float>()
+        {
+            float.Parse(strings[0]),
+            float.Parse(strings[1]),
+            float.Parse(strings[2]),
+        };
+    }
+
+
+    public void GetAward(int score)
+    {
+        ManaReso.SetActive("Da_Flower", false);
+        ManaReso.SetActive("Da_Diamond", false);
+
+        int coin = (int) Auxiliary.FmlParse(CoinFml, "s", score.ToString());
+
+        ManaData.Coin += coin;
+        ManaReso.SetText("Da_CoinLab", coin.ToString());
+
+        float diamondRate = (float) Auxiliary.FmlParse(DiamondFml, "l", Mathf.Clamp(ManaData.Level, 1, Mathf.Infinity).ToString());
+
+        if (Random.Range(0, 1f) <= diamondRate)
+        {
+            ManaReso.SetActive("Da_Diamond", true);
+
+            int diamond = (int) Mathf.Lerp(DiamondMin, DiamondMax, Random.Range(0, 1f));
+
+            ManaReso.SetText("Da_DiamondLab", diamond.ToString());
+            ManaData.Diamond += diamond;
+        }
+
+        int grade;
+
+        if (score < Standard[0])
+        {
+            grade = 0;
+        }
+        else if (score < Standard[1])
+        {
+            grade = 1;
+        }
+        else if (score < Standard[2])
+        {
+            grade = 2;
+        }
+        else
+        {
+            throw new Exception();
+        }
+
+        float flowerRate = (float) Auxiliary.FmlParse(DiamondFml, "l", ManaData.Level.ToString(), "f", ManaGarden.MyFlower.ToString());
+
+        if (Random.Range(0, 1f) <= flowerRate)
+        {
+            if (Random.Range(0, 1f) <= Odds[grade])
+            {
+                ManaReso.SetActive("Da_Flower", true);
+
+                FlowerInfo flowerInfo;
+
+                while (true)
+                {
+                    flowerInfo = ManaGarden.FlowerInfoDic[Random.Range(0, ManaGarden.TotalFlower - 1)];
 
-            ScoreLab.text = _Score.ToString();
+                    if (flowerInfo.Unlock)
+                    {
+                        break;
+                    }
+                }
+
+                ManaReso.SetText("Da_FlowerLab", Language.GetStr("FlowerName", "Flower" + flowerInfo.Id));
+            }
         }
     }
-    public static float Timer
+}
+
+
+public class ManaMiniGame : Regist 
+{
+    #region 变量
+
+    public static int Score
     {
-        get { return _Timer; }
+        get { return _Score; }
         set
         {
-            _Timer = value;
+            _Score = value;
 
-            TimerBk.fillAmount = _Timer / GameTime;
-            TimerLab.text = _Timer.ToString("0.0");
+            ManaReso.SetText("D_ScoreLab", _Score.ToString());
         }
     }
     public static bool Game
@@ -44,11 +146,11 @@ public class ManaMiniGame : MonoBehaviour
 
             if (_Game)
             {
-                StatusLab.text = Language.GetStr("UI", "D_StatusLab1");
+                ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab1"));
             }
             else
             {
-                StatusLab.text = Language.GetStr("UI", "D_StatusLab0");
+                ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab0"));
             }
         }
     }
@@ -63,11 +165,11 @@ public class ManaMiniGame : MonoBehaviour
             {
                 if (_Pause)
                 {
-                    StatusLab.text = Language.GetStr("UI", "D_StatusLab2");
+                    ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab2"));
                 }
                 else
                 {
-                    StatusLab.text = Language.GetStr("UI", "D_StatusLab1");
+                    ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab1"));
                 }
             }
         }
@@ -81,77 +183,78 @@ public class ManaMiniGame : MonoBehaviour
 
             if (_Panalty)
             {
-                StatusLab.text = Language.GetStr("UI", "D_StatusLab3");
+                ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab3"));
             }
             else
             {
-                StatusLab.text = Language.GetStr("UI", "D_StatusLab1");
+                ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab1"));
             }
         }
     }
+    public static float GameTimer
+    {
+        get { return _GameTimer; }
+        set
+        {
+            _GameTimer = value;
+
+            TimerBk.fillAmount = _GameTimer / GameTimer;
+
+            TimerLab.text = _GameTimer.ToString("0.0");
+        }
+    }
 
     private static int _Score;
-    private static float _Timer;
     private static bool _Game;
     private static bool _Pause;
     private static bool _Panalty;
+    private static float _GameTimer;
 
+    public static Text TimerLab;
+    public static Image TimerBk;
+    public static Award Award;
     public static List<Flower> OpList;
     public static List<Flower> IdleList;
 
     private static float OpTime;
-    private static float GameTime;
-    private static float PenaltyTime;
     private static float OpTimer;
-    private static float PenaltyTimer;
-
-    private static Text ScoreLab;
-    private static Text TimerLab;
-    private static Text StatusLab;
-    private static Image TimerBk;
-
-    #endregion
+    private static float GameTime;
+    private static float PanaltyTime;
+    private static float PanaltyTimer;
 
     #endregion
 
-    private void Awake()
-    {
-        Initializer.RegistValue += RegistValue;
-        Initializer.RegistReference += RegistReference;
-    }
-
     private void FixedUpdate()
     {
-        #region 小游戏A
-
         if (!Game || Pause)
         {
             return;
         }
 
-        Timer -= Time.fixedDeltaTime; //小游戏计时
+        GameTimer -= Time.fixedDeltaTime;
 
-        if (Timer <= 0)
+        if (GameTimer <= 0)
         {
             GameOver();
 
-            return; //小游戏结束
+            return;
         }
 
-        if (PenaltyTimer > 0) //冻结时间计时
+        if (Panalty)
         {
-            PenaltyTimer -= Time.fixedDeltaTime;
+            PanaltyTimer -= Time.fixedDeltaTime;
 
-            if (PenaltyTimer <= 0)
+            if (PanaltyTimer <= 0)
             {
                 Panalty = false;
             }
         }
 
-        OpTimer -= Time.fixedDeltaTime; //生成操作计时
-        if (OpTimer <= 0)
+        if (IdleList.Count > 0)
         {
-            if (IdleList.Count > 0)
+            OpTimer -= Time.fixedDeltaTime;
+
+            if (OpTimer <= 0)
             {
                 OpTimer = OpTime;
 
@@ -159,116 +262,124 @@ public class ManaMiniGame : MonoBehaviour
 
                 flower.CreateOp(OpList.Count);
 
-                IdleList.Remove(flower);
                 OpList.Add(flower);
+                IdleList.Remove(flower);
             }
         }
-
-        #endregion
     }
 
 
-    private static void RegistValue()
+    public override void RegistValueA()
     {
         OpTime = 1.5f;
-        GameTime = 30;
-        PenaltyTime = 1;
+        GameTime = 45;
+        PanaltyTime = 1;
 
-        Timer = GameTime;
         OpTimer = OpTime;
+        GameTimer = GameTime;
+
+        Award = new Award(Data.GetMiniGameConfig());
     }
 
-    private static void RegistReference()
+    public override void RegistReference()
     {
         TimerBk = ManaReso.Get<Image>("D_TimerIcon");
 
         TimerLab = ManaReso.Get<Text>("D_TimerLab");
-        ScoreLab = ManaReso.Get<Text>("D_ScoreLab");
-        StatusLab = ManaReso.Get<Text>("D_StatusLab");
     }
 
 
-    #region 小游戏A
+    #region MiniGame
 
     public static void Rip()
     {
-        if (PenaltyTimer > 0) //冻结操作
+        if (Panalty)
         {
             return;
         }
 
-        if (OpList.Count > 0)
+        if (OpList.Count == 0)
         {
-            if (OpList[0].Operate(OpType.Rip)) //操作正确
-            {
-                IdleList.Add(OpList[0]);
+            return;
+        }
 
-                OpList.Remove(OpList[0]);
+        if (OpList[0].Operate(OpType.Rip))
+        {
+            IdleList.Add(OpList[0]);
 
-                SetOpStatus();
-            }
-            else //操作错误
-            {
-                Panalty = true;
-                PenaltyTimer = PenaltyTime;
+            OpList.Remove(OpList[0]);
 
-                ManaLog.Log(string.Format("惩罚<color=red>{0:0}</color>秒", PenaltyTime));
-            }
+            ResetOperate();
+        }
+        else
+        {
+            Panalty = true;
+            PanaltyTimer = PanaltyTime;
         }
     }
 
     public static void Water()
     {
-        if (PenaltyTimer > 0) //冻结操作
+        if (Panalty)
         {
             return;
         }
 
-        if (OpList.Count > 0)
+        if (OpList.Count == 0)
         {
-            if (OpList[0].Operate(OpType.Water)) //操作正确
-            {
-                IdleList.Add(OpList[0]);
-                OpList.Remove(OpList[0]);
+            return;
+        }
 
-                SetOpStatus();
-            }
-            else //操作错误
-            {
-                Panalty = true;
-                PenaltyTimer = PenaltyTime;
+        if (OpList[0].Operate(OpType.Water))
+        {
+            IdleList.Add(OpList[0]);
 
-                ManaLog.Log(string.Format("惩罚<color=red>{0:0}</color>秒", PenaltyTime));
-            }
+            OpList.Remove(OpList[0]);
+
+            ResetOperate();
+        }
+        else
+        {
+            Panalty = true;
+            PanaltyTimer = PanaltyTime;
         }
     }
 
     public static void Fertilize()
     {
-        if (PenaltyTimer > 0) //冻结操作
+        if (Panalty)
         {
             return;
         }
 
-        if (OpList.Count > 0)
+        if (OpList.Count == 0)
         {
-            if (OpList[0].Operate(OpType.Fertilize)) //操作正确
-            {
-                IdleList.Add(OpList[0]);
-                OpList.Remove(OpList[0]);
+            return;
+        }
 
-                SetOpStatus();
-            }
-            else //操作错误
-            {
-                Panalty = true;
-                PenaltyTimer = PenaltyTime;
+        if (OpList[0].Operate(OpType.Fertilize))
+        {
+            IdleList.Add(OpList[0]);
 
-                ManaLog.Log(string.Format("惩罚<color=red>{0:0}</color>秒", PenaltyTime));
-            }
+            OpList.Remove(OpList[0]);
+
+            ResetOperate();
+        }
+        else
+        {
+            Panalty = true;
+            PanaltyTimer = PanaltyTime;
         }
     }
 
+
+    public static void GameOver()
+    {
+        Award.GetAward(Score);
+
+        GameAbort();
+    }
+
     public static void GameBegin()
     {
         ManaReso.Get("D_Rip1").SetActive(true);
@@ -277,30 +388,45 @@ public class ManaMiniGame : MonoBehaviour
         ManaReso.Get("D_Begin").SetActive(false);
 
         Score = 0;
+
         Game = true;
         Pause = false;
-        Timer = GameTime;
+        Panalty = false;
+
+        OpTimer = OpTime;
+        GameTimer = GameTime;
+        PanaltyTimer = 0;
 
         for (int i = 0; i < IdleList.Count; i++)
         {
             IdleList[i].GameBegin();
         }
-
-        OpList = new List<Flower>();
     }
 
     public static void GameAbort()
     {
-        ManaReso.Get("D_Rip1").SetActive(false);
-        ManaReso.Get("D_Water1").SetActive(false);
-        ManaReso.Get("D_Fertilize1").SetActive(false);
-        ManaReso.Get("D_Begin").SetActive(true);
+        ManaReso.SetActive("D_Rip1", false);
+        ManaReso.SetActive("D_Water1", false);
+        ManaReso.SetActive("D_Fertilize1", false);
+        ManaReso.SetActive("D_Begin", true);
+
+        ManaReso.SetText("Da_Tit", string.Format(Language.GetStr("UI", "Da_Tit1")));
+        ManaReso.SetText("Da_Lab", string.Format("{0}{1}", Language.GetStr("UI", "Da_Lab1"), Score));
+
+        ManaReso.SetActive("Da_Info", true);
+        ManaReso.SetActive("Da_Quit", false);
+        ManaReso.SetActive("Da_Cancel", false);
+        ManaReso.SetActive("Da_GetAward", true);
 
         Score = 0;
+
         Game = false;
         Pause = false;
-        Timer = GameTime;
+        Panalty = false;
+
         OpTimer = OpTime;
+        GameTimer = GameTime;
+        PanaltyTimer = 0;
 
         for (int i = 0; i < IdleList.Count; i++)
         {
@@ -315,8 +441,8 @@ public class ManaMiniGame : MonoBehaviour
 
     public static void GamePrepare()
     {
-        IdleList = new List<Flower>();
         OpList = new List<Flower>();
+        IdleList = new List<Flower>();
         IdleList.Add(ManaReso.GetFlower(1, false, ManaReso.Get("MiniTra1")));
         IdleList.Add(ManaReso.GetFlower(2, false, ManaReso.Get("MiniTra2")));
         IdleList.Add(ManaReso.GetFlower(3, false, ManaReso.Get("MiniTra3")));
@@ -328,41 +454,7 @@ public class ManaMiniGame : MonoBehaviour
         IdleList.Add(ManaReso.GetFlower(9, false, ManaReso.Get("MiniTra9")));
     }
 
-
-    private static void GameOver()
-    {
-        ManaReso.SetActive("D_Rip1", false);
-        ManaReso.SetActive("D_Water1",false);
-        ManaReso.SetActive("D_Fertilize1",false);
-        ManaReso.SetActive("D_Begin",true);
-
-        ManaReso.SetText("Da_Tit", "游戏结束");
-        ManaReso.SetText("Da_Lab", "得分 : " + Score);
-        ManaReso.SetActive("Da_Quit", false);
-        ManaReso.SetActive("Da_Cancel", false);
-        ManaReso.SetActive("Da_Info", true);
-        ManaReso.SetActive("Da_GetAward", true);
-
-        Score = 0;
-        Game = false;
-        Pause = false;
-        Timer = GameTime;
-        OpTimer = OpTime;
-
-        for (int i = 0; i < IdleList.Count; i++)
-        {
-            IdleList[i].GameOver();
-        }
-
-        for (int i = 0; i < OpList.Count; i++)
-        {
-            OpList[i].GameOver();
-        }
-
-        IdleList.AddRange(OpList);
-    }
-
-    private static void SetOpStatus()
+    public static void ResetOperate()
     {
         if (OpList.Count >= 2)
         {

+ 1 - 1
Assets/Script/Manage/ManaPlayer.cs

@@ -19,7 +19,7 @@ public class ManaPlayer : MonoBehaviour
     {
         Transform tra = ManaReso.Get("Player", Folder.Object, false, transform, false);
 
-        tra.AddComponent<Player>();
+        tra.AddScript<Player>();
 
         ManaReso.TraDic.Add(tra.name, tra);
     }

+ 269 - 291
Assets/Script/Manage/ManaReso.cs

@@ -34,150 +34,310 @@ public class ManaReso : MonoBehaviour
 {
     #region 变量
 
+    public static Dictionary<string, Object> ObjDic;
     public static Dictionary<string, Transform> TraDic;
-    public static Dictionary<ObjType, Object> ObjDic;
-    public static Dictionary<ObjType, List<GameObject>> ObjectPool;
+    public static Dictionary<ObjType, List<Transform>> ObjectPool;
 
     #endregion
 
     private void Awake()
     {
         TraDic = new Dictionary<string, Transform>();
-        ObjDic = new Dictionary<ObjType, Object>();
-        ObjectPool = new Dictionary<ObjType, List<GameObject>>();
+        ObjDic = new Dictionary<string, Object>();
+        ObjectPool = new Dictionary<ObjType, List<Transform>>();
 
-        Get("ObjPool", Folder.Object, true, transform,  true);
-        Get("MainCamera", Folder.Object, false, null,  true);
+        Transform objPool = new GameObject("ObjPool").transform;
+
+        objPool.parent = transform;
+        objPool.SetActive(false);
+
+        TraDic.Add(objPool.name, objPool);
     }
 
-    #region TraDic
 
-    public static T Get<T>(string goName)
+    public static T Load<T>(string goName, Folder folder, ObjType objType = ObjType.Null) where T : Object
     {
-        Transform tra;
+        Object obj;
 
-        if (TraDic.TryGetValue(goName, out tra))
+        if (ObjDic.TryGetValue(goName, out obj))
         {
-            T t = tra.GetComponent<T>();
+            return (T)obj;
+        }
+        else
+        {
+            T t;
 
-            if (t == null)
+            if (folder == Folder.Skill)
+            {
+                t = Resources.Load<T>(@"Sprite\SpriteUI\Skill\" + goName);
+            }
+            else if (folder == Folder.Object)
+            {
+                t = Resources.Load<T>(@"Prefab\Object\" + goName);
+            }
+            else if (folder == Folder.Garden)
+            {
+                t = Resources.Load<T>(@"Sprite\Garden\" + goName);
+            }
+            else if (folder == Folder.SpriteUI)
+            {
+                t = Resources.Load<T>(@"Sprite\SpriteUI\" + goName);
+            }
+            else if (folder == Folder.Shader)
+            {
+                t = Resources.Load<T>(@"Shader\" + goName);
+            }
+            else if (folder == Folder.PrefabUI)
+            {
+                t = Resources.Load<T>(@"Prefab\PrefabUI\" + goName);
+            }
+            else if (folder == Folder.Character)
+            {
+                t = Resources.Load<T>(@"Sprite\Character\" + goName);
+            }
+            else
             {
                 throw new Exception();
             }
 
+            if (t == null)
+            {
+                throw new Exception(goName);
+            }
+
+            ObjDic.Add(goName, t);
+
+            if (objType != ObjType.Null)
+            {
+                ObjectPool.Add(objType, new List<Transform>());
+            }
+
             return t;
         }
+    }
+
+    public static Transform Get(string goName, Folder folder, bool compile, Transform par, Vector3 pos, ObjType objType = ObjType.Null)
+    {
+        Transform tra = Get(objType);
+
+        if (tra != null)
+        {
+            tra.SetParent(par);
+
+            tra.position = pos;
+
+            return tra;
+        }
         else
         {
-            throw new Exception(goName);
+            GameObject go = Load<GameObject>(goName, folder, objType);
+
+            go = Instantiate(go, pos, Quaternion.identity, par);
+            go.name = go.name.Replace("(Clone)", "");
+
+            if (compile)
+            {
+                Auxiliary.CompileDic(go.transform, TraDic);
+            }
+
+            return go.transform;
         }
     }
 
-    public static Transform Get(string goName)
+    public static Transform Get(string goName, Folder folder, bool compile, Transform par, bool worldSpace, ObjType objType = ObjType.Null)
     {
-        Transform tra;
+        Transform tra = Get(objType);
 
-        if (TraDic.TryGetValue(goName, out tra))
+        if (tra == null)
         {
-            return tra;
+            GameObject go = Load<GameObject>(goName, folder, objType);
+
+            go = Instantiate(go, par, worldSpace);
+            go.name = go.name.Replace("(Clone)", "");
+
+            if (compile)
+            {
+                Auxiliary.CompileDic(go.transform, TraDic);
+            }
+
+            return go.transform;
         }
         else
         {
-            throw new Exception(goName);
+            tra.SetParent(par);
+
+            return tra;
         }
     }
 
-    #endregion
-
-    #region ObjPool
 
-    public static void Save<T>(T t) where T : Component
+    public static Flower GetFlower(int id, bool collider, Transform parTra)
     {
-        GameObject go = t.gameObject;
+        Transform tra = Get("Flower", Folder.Object, false, parTra, false, ObjType.Flower);
 
-        ObjRoot objRoot = go.GetComponent<ObjRoot>();
+        Flower flower = tra.GetComponent<Flower>();
 
-        if (objRoot == null)
+        if (flower == null)
         {
-            throw new Exception();
+            flower = tra.AddComponent<Flower>();
+
+            flower.ObjType = ObjType.Flower;
+            flower.LocalPos = flower.transform.localPosition;
+        }
+        else
+        {
+            flower.transform.localPosition = flower.LocalPos;
         }
 
-        List<GameObject> goList;
+        flower.Id = id;
+        flower.ParTra = parTra;
+
+        flower.SetCollider(collider);
+
+        return flower;
+    }
 
-        if (ObjectPool.TryGetValue(objRoot.ObjType, out goList))
+    public static HudText GetHudText(string str, Color color, int size, Transform posTra, Transform parTra, bool scene)
+    {
+        Vector3 pos;
+
+        if (scene)
         {
-            if (goList.Contains(go))
-            {
-                throw new Exception();
-            }
+            pos = Camera.main.WorldToScreenPoint(posTra.position);
+        }
+        else
+        {
+            pos = posTra.position;
+        }
 
-            go.SetActive(false);
+        Transform tra = Get("HudText", Folder.PrefabUI, false, parTra, pos, ObjType.HudText);
 
-            goList.Add(go);
+        HudText hudText = tra.GetComponent<HudText>();
 
-            go.transform.SetParent(Get("ObjPool"));
+        if (hudText == null)
+        {
+            hudText = tra.AddComponent<HudText>();
+            hudText.ObjType = ObjType.HudText;
+        }
+
+        hudText.Show(str, color, size);
+
+        return hudText;
+    }
+
+    public static Transform GetSkillItem(SkillRoot skillRoot)
+    {
+        Transform tra;
+
+        if (skillRoot.SkillTab == SkillTab.Elf)
+        {
+            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fd_Grid"), false);
+        }
+        else if (skillRoot.SkillTab == SkillTab.Store)
+        {
+            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fc_Grid"), false);
+        }
+        else if (skillRoot.SkillTab == SkillTab.Magic)
+        {
+            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fb_Grid"), false);
+        }
+        else if (skillRoot.SkillTab == SkillTab.Garden)
+        {
+            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fa_Grid"), false);
         }
         else
         {
             throw new Exception();
         }
+
+        skillRoot.SkillItem = tra;
+
+        return tra;
     }
 
-    public static void SaveUI<T>(T t) where T : Component
+    public static Transform GetFlowerItemH()
     {
-        GameObject go = t.gameObject;
+        Transform tra = Get("FlowerItemH", Folder.PrefabUI, false, Get("H_Grid"), false, ObjType.FlowerItem);
 
-        ObjRoot objRoot = go.GetComponent<ObjRoot>();
+        ObjRoot objRoot = tra.GetComponent<ObjRoot>();
 
         if (objRoot == null)
         {
-            throw new Exception();
+            objRoot = tra.AddComponent<ObjRoot>();
         }
 
-        List<GameObject> goList;
+        objRoot.ObjType = ObjType.FlowerItem;
+
+        return objRoot.transform;
+    }
+
+
+    #region TraDic
+
+    public static T Get<T>(string goName)
+    {
+        Transform tra;
 
-        if (ObjectPool.TryGetValue(objRoot.ObjType, out goList))
+        if (TraDic.TryGetValue(goName, out tra))
         {
-            if (goList.Contains(go))
+            T t = tra.GetComponent<T>();
+
+            if (t == null)
             {
                 throw new Exception();
             }
 
-            go.SetActive(false);
+            return t;
+        }
+        else
+        {
+            throw new Exception(goName);
+        }
+    }
 
-            goList.Add(go);
+    public static Transform Get(string goName)
+    {
+        Transform tra;
 
-            go.transform.SetParent(Get("J_ObjPool"));
+        if (TraDic.TryGetValue(goName, out tra))
+        {
+            return tra;
         }
         else
         {
-            throw new Exception();
+            throw new Exception(goName);
         }
     }
 
-    public static void Save(GameObject go)
+    #endregion
+
+    #region ObjPool
+
+    public static void Save<T>(T t) where T : Component
     {
-        ObjRoot objRoot = go.GetComponent<ObjRoot>();
+        Transform tra = t.transform;
+
+        ObjRoot objRoot = tra.GetComponent<ObjRoot>();
 
         if (objRoot == null)
         {
             throw new Exception();
         }
 
-        List<GameObject> goList;
+        List<Transform> traList;
 
-        if (ObjectPool.TryGetValue(objRoot.ObjType, out goList))
+        if (ObjectPool.TryGetValue(objRoot.ObjType, out traList))
         {
-            if (goList.Contains(go))
+            if (traList.Contains(tra))
             {
                 throw new Exception();
             }
 
-            go.SetActive(false);
+            tra.SetActive(false);
 
-            goList.Add(go);
+            traList.Add(tra);
 
-            go.transform.SetParent(Get("ObjPool"));
+            tra.transform.SetParent(Get("ObjPool"));
         }
         else
         {
@@ -185,7 +345,7 @@ public class ManaReso : MonoBehaviour
         }
     }
 
-    public static void SaveUI(GameObject go)
+    public static void Save(GameObject go)
     {
         ObjRoot objRoot = go.GetComponent<ObjRoot>();
 
@@ -194,20 +354,20 @@ public class ManaReso : MonoBehaviour
             throw new Exception();
         }
 
-        List<GameObject> goList;
+        List<Transform> traList;
 
-        if (ObjectPool.TryGetValue(objRoot.ObjType, out goList))
+        if (ObjectPool.TryGetValue(objRoot.ObjType, out traList))
         {
-            if (goList.Contains(go))
+            if (traList.Contains(go.transform))
             {
                 throw new Exception();
             }
 
             go.SetActive(false);
 
-            goList.Add(go);
+            traList.Add(go.transform);
 
-            go.transform.SetParent(Get("J_ObjPool"));
+            go.transform.SetParent(Get("ObjPool"));
         }
         else
         {
@@ -216,147 +376,88 @@ public class ManaReso : MonoBehaviour
     }
 
 
-    public static T Get<T>(ObjType objType)
+    public static void SaveUI<T>(T t) where T : Component
     {
-        List<GameObject> goList;
-
-        if (ObjectPool.TryGetValue(objType, out goList))
-        {
-            if (goList.Count > 0)
-            {
-                GameObject go = goList[0];
-
-                go.SetActive(true);
-                goList.RemoveAt(0);
-
-                T t = go.GetComponent<T>();
+        Transform tra = t.transform;
 
-                if (t != null)
-                {
-                    return t;
-                }
-            }
-        }
+        ObjRoot objRoot = tra.GetComponent<ObjRoot>();
 
-        return default(T);
-    }
-
-    public static Transform Get(Transform par, Vector3 pos, ObjType objType)
-    {
-        List<GameObject> goList;
-
-        if (ObjectPool.TryGetValue(objType, out goList))
+        if (objRoot == null)
         {
-            if (goList.Count > 0)
-            {
-                GameObject go = goList[0];
-
-                go.SetActive(true);
-                go.SetParent(par);
-                go.transform.position = pos;
-
-                goList.RemoveAt(0);
-
-                return go.transform;
-            }
+            throw new Exception();
         }
 
-        return null;
-    }
-
+        List<Transform> traList;
 
-    public static Transform Get(string prefabName, Folder folder, bool compile, Transform par, Vector3 pos, ObjType objType = ObjType.Null)
-    {
-        if (objType != ObjType.Null)
+        if (ObjectPool.TryGetValue(objRoot.ObjType, out traList))
         {
-            Transform tra = Get(par, pos, objType);
-
-            if (tra != null)
+            if (traList.Contains(tra))
             {
-                return tra;
+                throw new Exception();
             }
-        }
 
-        GameObject go = Load<GameObject>(prefabName, folder, objType);
+            tra.SetActive(false);
 
-        go = Instantiate(go, pos, Quaternion.identity, par);
-        go.name = go.name.Replace("(Clone)", "");
+            traList.Add(tra);
 
-        if (compile)
+            tra.transform.SetParent(Get("J_ObjPool"));
+        }
+        else
         {
-            Auxiliary.CompileDic(go.transform, TraDic);
+            throw new Exception();
         }
-
-        return go.transform;
     }
 
-    public static Transform Get(string prefabName, Folder folder, bool compile, Transform par, bool worldSpace, ObjType objType = ObjType.Null)
+    public static void SaveUI(GameObject go)
     {
-        GameObject go = Load<GameObject>(prefabName, folder, objType);
-
-        go = Instantiate(go, par, worldSpace);
-        go.name = go.name.Replace("(Clone)", "");
+        ObjRoot objRoot = go.GetComponent<ObjRoot>();
 
-        if (compile)
+        if (objRoot == null)
         {
-            Auxiliary.CompileDic(go.transform, TraDic);
+            throw new Exception();
         }
 
-        return go.transform;
-    }
+        List<Transform> traList;
 
+        if (ObjectPool.TryGetValue(objRoot.ObjType, out traList))
+        {
+            if (traList.Contains(go.transform))
+            {
+                throw new Exception();
+            }
 
-    public static void GetHudText(string str, Transform posTra, bool scene, int size, Color color)
-    {
-        HudText hudText = Get<HudText>(ObjType.HudText);
-
-        Vector3 pos;
+            go.SetActive(false);
 
-        if (scene)
-        {
-            pos = Camera.main.WorldToScreenPoint(posTra.position);
-        }
-        else
-        {
-            pos = posTra.position;
-        }
+            traList.Add(go.transform);
 
-        if (hudText == null)
-        {
-            hudText = Get("HudText", Folder.PrefabUI, false, Get("HudParent"), pos, ObjType.HudText).AddComponent<HudText>();
-            hudText.ObjType = ObjType.HudText;
+            go.transform.SetParent(Get("J_ObjPool"));
         }
         else
         {
-            hudText.transform.position = pos;
-            hudText.transform.SetParent(Get("HudParent"));
+            throw new Exception();
         }
-
-        hudText.Show(str, color, size);
     }
 
-    public static Flower GetFlower(int id, bool collider, Transform posTra)
+
+    public static Transform Get(ObjType objType)
     {
-        Flower flower = Get<Flower>(ObjType.Flower);
+        List<Transform> traList;
 
-        if (flower == null)
+        if (ObjectPool.TryGetValue(objType, out traList))
         {
-            flower = Get("Flower", Folder.Object, false, posTra, false, ObjType.Flower).AddComponent<Flower>();
+            if (traList.Count > 0)
+            {
+                Transform tra = traList[0];
 
-            flower.ObjType = ObjType.Flower;
-            flower.LocalPos = flower.transform.localPosition;
-        }
-        else
-        {
-            flower.transform.parent = posTra;
-            flower.transform.localPosition = flower.LocalPos;
-        }
+                tra.SetActive(true);
 
-        flower.Id = id;
-        flower.PosTra = posTra;
-        flower.SetCollider(collider);
+                traList.RemoveAt(0);
 
-        return flower;
+                return tra.transform;
+            }
+        }
+
+        return null;
     }
 
     #endregion
@@ -365,16 +466,16 @@ public class ManaReso : MonoBehaviour
 
     public static void SetText(string goName)
     {
-        Text tempText = Get<Text>(goName);
+        Text text = Get<Text>(goName);
 
-        tempText.text = Language.GetStr("UI", goName);
+        text.text = Language.GetStr("UI", goName);
     }
 
-    public static void SetText(string goName, string text)
+    public static void SetText(string goName, string str)
     {
-        Text tempText = Get<Text>(goName);
+        Text text = Get<Text>(goName);
 
-        tempText.text = text;
+        text.text = str;
     }
 
     public static void SetSprite(string goName, Sprite sprite)
@@ -412,127 +513,4 @@ public class ManaReso : MonoBehaviour
     }
 
     #endregion
-
-    public static T Load<T>(string name, Folder folder, ObjType objType = ObjType.Null) where T : Object
-    {
-        Object obj;
-        
-        if (ObjDic.TryGetValue(objType, out obj))
-        {
-            return (T) obj;
-        }
-        else
-        {
-            T t;
-
-            if (folder == Folder.Skill)
-            {
-                t = Resources.Load<T>(@"Sprite\SpriteUI\Skill\" + name);
-            }
-            else if (folder == Folder.Object)
-            {
-                t = Resources.Load<T>(@"Prefab\Object\" + name);
-            }
-            else if (folder == Folder.Garden)
-            {
-                t = Resources.Load<T>(@"Sprite\Garden\" + name);
-            }
-            else if (folder == Folder.SpriteUI)
-            {
-                t = Resources.Load<T>(@"Sprite\SpriteUI\" + name);
-            }
-            else if (folder == Folder.Shader)
-            {
-                t = Resources.Load<T>(@"Shader\" + name);
-            }
-            else if (folder == Folder.PrefabUI)
-            {
-                t = Resources.Load<T>(@"Prefab\PrefabUI\" + name);
-            }
-            else if (folder == Folder.Character)
-            {
-                t = Resources.Load<T>(@"Sprite\Character\" + name);
-            }
-            else
-            {
-                throw new Exception();
-            }
-
-            if (t == null)
-            {
-                throw new Exception(name);
-            }
-
-            if (objType != ObjType.Null)
-            {
-                ObjDic.Add(objType, t);
-
-                ObjectPool.Add(objType, new List<GameObject>());
-            }
-
-            return t;
-        }
-    }
-
-    public static Transform GetSkillItem(SkillRoot skillRoot)
-    {
-        Transform tra;
-        Dictionary<string, Transform> dic = new Dictionary<string, Transform>();
-
-        if (skillRoot.Tab == SkillTab.Elf)
-        {
-            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fd_Grid"), false);
-        }
-        else if (skillRoot.Tab == SkillTab.Store)
-        {
-            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fc_Grid"), false);
-        }
-        else if (skillRoot.Tab == SkillTab.Magic)
-        {
-            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fb_Grid"), false);
-        }
-        else if (skillRoot.Tab == SkillTab.Garden)
-        {
-            tra = Get("SkillItem", Folder.PrefabUI, false, Get("Fa_Grid"), false);
-        }
-        else
-        {
-            throw new Exception();
-        }
-
-        Auxiliary.CompileDic(tra, dic);
-
-        skillRoot.ItemTit = dic["Tit"].GetComponent<Text>();
-        skillRoot.ItemBtn = dic["Btn"].GetComponent<Button>();
-        skillRoot.ItemLab = dic["Lab"].GetComponent<Text>();
-        skillRoot.ItemIcon = dic["Icon"].GetComponent<Image>();
-        skillRoot.ItemBtnLab = dic["BtnLab"].GetComponent<Text>();
-
-        if (!string.IsNullOrEmpty(skillRoot.Icon))
-        {
-            skillRoot.ItemIcon.sprite = Load<Sprite>(skillRoot.Icon, Folder.Skill);
-        }
-
-        return tra;
-    }
-
-    public static Transform GetFlowerCardItem()
-    {
-        Transform tra = Get<Transform>(ObjType.FlowerItem);
-
-        if (tra == null)
-        {
-            ObjRoot objRoot = Get("FlowerCardItem", Folder.PrefabUI, false, Get("H_Grid"), false, ObjType.FlowerItem).AddComponent<ObjRoot>();
-
-            objRoot.ObjType = ObjType.FlowerItem;
-
-            return objRoot.transform;
-        }
-        else
-        {
-            tra.SetParent(Get("H_Grid"));
-
-            return tra;
-        }
-    }
 }

+ 348 - 191
Assets/Script/Manage/ManaUI.cs

@@ -1,77 +1,80 @@
-using System;
-using UnityEngine;
+using UnityEngine;
 using UnityEngine.UI;
+using UnityEngine.EventSystems;
 
+using System;
+using System.Xml;
 using System.Collections;
 using System.Collections.Generic;
-using System.Xml;
-using UnityEngine.EventSystems;
+
+using Random = UnityEngine.Random;
 
 public class Sign
 {
     public int Coin;
     public int Diamond;
-    public List<int> Flower;
-
-    public Transform Item;
+    public Image Icon;
+    public Image Mark;
+    public List<int> FlowerList;
 
     public Sign(Transform transform, XmlAttributeCollection attribute)
     {
-        Item = transform;
+        Icon = transform.GetChild(0).GetComponent<Image>();
+        Mark = transform.GetChild(1).GetComponent<Image>();
 
         if (!string.IsNullOrEmpty(attribute[1].Value))
         {
-            string[] strings = attribute[1].Value.Split(',');
-            Item.GetChild(0).GetComponent<Image>().sprite = ManaReso.Load<Sprite>("管理花园按钮", Folder.SpriteUI);
+            FlowerList = new List<int>();
 
-            Flower = new List<int>();
+            string[] strings = attribute[1].Value.Split(',');
 
             for (int i = 0; i < strings.Length; i++)
             {
-                Flower.Add(int.Parse(strings[i]));
+                FlowerList.Add(int.Parse(strings[i]));
             }
+
+            Icon.sprite = ManaReso.Load<Sprite>("管理花园按钮", Folder.SpriteUI);
         }
 
         if (!string.IsNullOrEmpty(attribute[2].Value))
         {
             Diamond = int.Parse(attribute[2].Value);
 
-            if (Flower == null)
+            if (FlowerList == null)
             {
-                Item.GetChild(0).GetComponent<Image>().sprite = ManaReso.Load<Sprite>("钻石", Folder.SpriteUI);
+                Icon.sprite = ManaReso.Load<Sprite>("钻石", Folder.SpriteUI);
             }
         }
-        else if (!string.IsNullOrEmpty(attribute[3].Value))
+
+        if (!string.IsNullOrEmpty(attribute[3].Value))
         {
             Coin = int.Parse(attribute[3].Value);
-            Item.GetChild(0).GetComponent<Image>().sprite = ManaReso.Load<Sprite>("金币", Folder.SpriteUI);
-        }
-        else
-        {
-            throw new Exception();
+
+            Icon.sprite = ManaReso.Load<Sprite>("金币", Folder.SpriteUI);
         }
     }
 
     public void Get()
     {
-        Item.GetChild(1).SetActive(true);
+        Mark.SetActive(true);
 
-        if (Flower != null)
+        if (FlowerList != null)
         {
-            for (int i = 0; i < Flower.Count; i++)
+            for (int i = 0; i < FlowerList.Count; i++)
             {
-                if (ManaGarden.FlowerDic[Flower[i]].Unlock == false)
+                if (ManaGarden.FlowerInfoDic[FlowerList[i]].Unlock == false)
                 {
-                    ManaGarden.FlowerDic[Flower[i]].Unlock = true;
+                    ManaGarden.FlowerInfoDic[FlowerList[i]].Unlock = true;
 
                     if (ManaData.Sign < 27)
                     {
                         ManaData.Sign++;
                     }
 
-                    ManaReso.SetText("Bb_InfoLab", Flower[i].ToString());
+                    ManaReso.SetText("Bb_InfoLab", Language.GetStr("FlowerName", "Flower" + FlowerList[i]));
+
+                    ManaReso.SetSprite("Bb_Info", ManaReso.Load<Sprite>("管理花园按钮", Folder.SpriteUI)); 
 
-                    ManaReso.Get<Image>("Bb_Info").sprite = ManaReso.Load<Sprite>("管理花园按钮", Folder.SpriteUI);
                     return;
                 }
             }
@@ -88,7 +91,7 @@ public class Sign
 
             ManaReso.SetText("Bb_InfoLab", Diamond.ToString());
 
-            ManaReso.Get<Image>("Bb_Info").sprite = ManaReso.Load<Sprite>("钻石", Folder.SpriteUI);
+            ManaReso.SetSprite("Bb_Info", ManaReso.Load<Sprite>("钻石", Folder.SpriteUI));
         }
         else if (Coin > 0)
         {
@@ -101,7 +104,7 @@ public class Sign
 
             ManaReso.SetText("Bb_InfoLab", Coin.ToString());
 
-            ManaReso.Get<Image>("Bb_Info").sprite = ManaReso.Load<Sprite>("金币", Folder.SpriteUI);
+            ManaReso.SetSprite("Bb_Info", ManaReso.Load<Sprite>("金币", Folder.SpriteUI));
         }
         else
         {
@@ -110,7 +113,8 @@ public class Sign
     }
 }
 
-public class ManaUI : MonoBehaviour
+
+public class ManaUI : Regist
 {
 	#region 变量
 
@@ -120,16 +124,41 @@ public class ManaUI : MonoBehaviour
 
     private void Awake()
     {
-        Initializer.RegistValue += RegistValue;
+        Transform tra = new GameObject("UI").transform;
+
+        ManaReso.Get("Canvas", Folder.PrefabUI, true, tra, false);
+        ManaReso.Get("MainCamera", Folder.Object, false, tra,  false);
+        ManaReso.Get("EventSystem", Folder.PrefabUI, false, tra, false);
     }
 
-    private void RegistValue()
+    public override void RegistValueB()
     {
-        List<XmlAttributeCollection> attributeList = Data.GetSignConfig();
+        #region B
 
-        #region A
+        ManaReso.SetText("Ba_Lab");
+        ManaReso.SetText("Ba_ConfirmLab");
 
-        #region A_Confirm
+        ManaReso.SetText("Bb_Title");
+        ManaReso.SetText("Bb_GetLab");
+        ManaReso.SetText("Bb_ConfirmLab");
+
+        #region B_SignIn
+
+        Tween tween = ManaReso.Get("B_SignIn").CreateTweenCG(0f, 1f, 0.5f, false, true, Curve.EaseOutQuad);
+
+        tween.OnForwardStart += () =>
+        {
+            ManaData.Main++;
+        };
+
+        tween.OnBackwardStart += () =>
+        {
+            ManaData.Main--;
+        };
+
+        #endregion
+
+        #region Ba_Confirm
 
         ManaReso.AddButtonEvent
         (
@@ -144,16 +173,6 @@ public class ManaUI : MonoBehaviour
 
         #endregion
 
-        #endregion
-
-        #region B
-
-        ManaReso.SetText("Ba_Lab");
-        ManaReso.SetText("Ba_ConfirmLab");
-        ManaReso.SetText("Bb_GetLab");
-        ManaReso.SetText("Bb_Title");
-        ManaReso.SetText("Bb_ConfirmLab");
-
         #region Bb_Get
 
         ManaReso.AddButtonEvent
@@ -161,44 +180,26 @@ public class ManaUI : MonoBehaviour
             "Bb_Get",
             () =>
             {
+                SignList[ManaData.Sign].Get();
+
                 ManaReso.SetActive("Bb_Get", false);
                 ManaReso.SetActive("Bb_Info", true);
                 ManaReso.SetActive("Bb_Confirm", true);
-
-                SignList[ManaData.Sign].Get();
             }
         );
 
         #endregion
 
-        #region B_SignIn
-
-        Tween tween = ManaReso.Get("B_SignIn").CreateTweenCG(0f, 1f, 0.5f, false, true, Curve.EaseOutQuad);
-
-        tween.OnForwardStart += () =>
-        {
-            ManaData.Main++;
-        };
-
-        tween.OnBackwardStart += () =>
-        {
-            ManaData.Main--;
-        };
-
-        #endregion
-
         #region Bb_SignIn
 
-        tween = ManaReso.Get("Bb_SignIn").CreateTweenCG(0f, 1f, 0.5f, false, true, Curve.EaseOutQuad);
-
-        tween.OnBackwardStart += () =>
-        {
-            ManaData.Main--;
-        };
+        ManaReso.Get("Bb_SignIn").CreateTweenCG(0f, 1f, 0.5f, false, true, Curve.EaseOutQuad);
 
         Transform tra = ManaReso.Get("Bb_Grid");
 
+        List<XmlAttributeCollection> attributeList = Data.GetSignConfig();
+
         SignList = new List<Sign>();
+
         for (int i = 0; i < attributeList.Count; i++)
         {
             Transform tra1 = ManaReso.Get("SignInItem", Folder.PrefabUI, false, tra, false);
@@ -230,6 +231,24 @@ public class ManaUI : MonoBehaviour
 
         #region C
 
+        ManaReso.SetText("C_MiniGameLab");
+
+        #region C_Main
+
+        tween = ManaReso.Get("C_Main").CreateTweenCG(0, 1, 0.25f, false, true, Curve.EaseOutQuad);
+
+        tween.OnForwardStart += () =>
+        {
+            ManaData.Main = -1;
+        };
+
+        tween.OnBackwardStart += () =>
+        {
+            ManaData.Main = 0;
+        };
+
+        #endregion
+
         #region C_Manage
 
         ManaReso.AddButtonEvent
@@ -238,40 +257,52 @@ public class ManaUI : MonoBehaviour
             () =>
             {
                 ManaReso.Get("C_Main").TweenBacCG();
-                ManaReso.SetActive("F_Manage", true);
 
-                ManaReso.Get("F_Manage").TweenForVec();
+                ManaReso.Get("F_Manage0").TweenForVec();
             }
         );
 
         #endregion
 
-        #region C_Main
+        #region C_MiniGame
 
-        ManaReso.Get("C_Main").CreateTweenCG(0, 1, 0.25f, false, true, Curve.EaseOutQuad);
+        tween = ManaReso.Get("C_MiniGame").CreateTweenCG(0, 1, 0.25f, false, true, Curve.EaseOutQuad);
 
-        #endregion
+        tween.OnForwardStart += () =>
+        {
+            ManaData.Mini = true;
 
-        #region C_MiniGame
+            ManaReso.SetText("Da_CoinLab", "");
+            ManaReso.SetText("Da_FlowerLab", "");
+            ManaReso.SetText("Da_DiamondLab", "");
 
-        ManaReso.SetText("C_MiniGameLab");
+            ManaReso.SetActive("Da_Coin", true);
+            ManaReso.SetActive("Da_Flower", true);
+            ManaReso.SetActive("Da_Diamond", true);
+        };
+
+        tween.OnBackwardStart += () =>
+        {
+            ManaData.Mini = false;
 
-        Button enterGameA = ManaReso.Get<Button>("C_MiniGame");
+            ManaData.MiniTimer = Mathf.Lerp(180, 300, Random.Range(0, 1f));
 
-        enterGameA.onClick.AddListener
+            ManaDebug.Log(string.Format("<color=red>{0:0}</color>秒后激活小游戏", ManaData.MiniTimer));
+        };
+
+        ManaReso.AddButtonEvent
         (
+            "C_MiniGame",
             () =>
             {
-                ManaReso.Get("C_Main").TweenBacCG();
-
-                ManaReso.Get("D_MiniGame").TweenForVec();
                 ManaReso.Get("GardenMini").TweenForVec();
 
-                ManaMiniGame.GamePrepare();
+                ManaReso.Get("D_MiniGame").TweenForVec();
             }
         );
 
-        HudTarget hudTarget = enterGameA.AddComponent<HudTarget>();
+        HudTarget hudTarget = ManaReso.Get("C_MiniGame").AddComponent<HudTarget>();
+
         hudTarget.PosTra = Player.ChildDic["EnterGameTra"];
 
         #endregion
@@ -281,17 +312,14 @@ public class ManaUI : MonoBehaviour
         #region D
 
         ManaReso.SetText("D_QuitLab");
-        ManaReso.SetText("D_BeginLab");
         ManaReso.SetText("D_ScoreTit");
+        ManaReso.SetText("D_BeginLab");
         ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab0"));
 
-        ManaReso.SetText("Da_Tit");
-        ManaReso.SetText("Da_Lab");
         ManaReso.SetText("Da_QuitLab");
         ManaReso.SetText("Da_CancelLab");
         ManaReso.SetText("Da_GetAwardLab");
 
-
         #region D_Rip
 
         ManaReso.AddButtonEvent
@@ -309,11 +337,12 @@ public class ManaUI : MonoBehaviour
             "D_Quit",
             () =>
             {
-                ManaReso.SetText("Da_Tit", "退出游戏");
-                ManaReso.SetText("Da_Lab", "打理完花园可能获得如下奖励,确定要退出?");
+                ManaReso.SetText("Da_Tit", Language.GetStr("UI", "Da_Tit0"));
+                ManaReso.SetText("Da_Lab", Language.GetStr("UI", "Da_Lab0"));
+
+                ManaReso.SetActive("Da_Info", true);
                 ManaReso.SetActive("Da_Quit", true);
                 ManaReso.SetActive("Da_Cancel", true);
-                ManaReso.SetActive("Da_Info", true);
                 ManaReso.SetActive("Da_GetAward", false);
 
                 ManaMiniGame.Pause = true;
@@ -358,7 +387,13 @@ public class ManaUI : MonoBehaviour
 
         tween.OnForwardStart += () =>
         {
+            ManaReso.Get("C_Main").TweenBacCG();
+
             ManaReso.Get("MusicTheme").TweenBacAudio();
+
+            ManaReso.SetActive("E_Debug", false);
+
+            ManaData.Main++;
         };
 
         tween.OnForwardFinish += () =>
@@ -374,18 +409,13 @@ public class ManaUI : MonoBehaviour
         tween.OnBackwardFinish += () =>
         {
             ManaReso.Get("MusicTheme").TweenForAudio();
+
+            ManaReso.SetActive("E_Debug", true);
         };
 
         #endregion
 
 
-        #region Da_Grid
-
-        ManaReso.Get("AwardItem", Folder.PrefabUI, false, ManaReso.Get("Da_Grid"), false);
-        ManaReso.Get("AwardItem", Folder.PrefabUI, false, ManaReso.Get("Da_Grid"), false);
-
-        #endregion
-
         #region Da_Quit
 
         ManaReso.AddButtonEvent
@@ -395,7 +425,9 @@ public class ManaUI : MonoBehaviour
             {
                 ManaReso.Get("C_Main").TweenForCG();
 
+                ManaReso.Get("C_MiniGame").TweenBacCG();
                 ManaReso.Get("D_MiniGame").TweenBacVec();
+
                 ManaReso.Get("GardenMini").TweenBacVec();
 
                 ManaReso.SetActive("Da_Info", false);
@@ -428,6 +460,14 @@ public class ManaUI : MonoBehaviour
             "Da_GetAward",
             () =>
             {
+                ManaReso.Get("C_Main").TweenForCG();
+
+                ManaReso.Get("C_MiniGame").TweenBacCG();
+
+                ManaReso.Get("D_MiniGame").TweenBacVec();
+
+                ManaReso.Get("GardenMini").TweenBacVec();
+
                 ManaReso.SetActive("Da_Info", false);
             }
         );
@@ -438,27 +478,127 @@ public class ManaUI : MonoBehaviour
 
         #region E
 
+        #region E_PauseBtn
+
+        ManaReso.AddButtonEvent
+        (
+            "E_PauseBtn",
+            () =>
+            {
+                ManaDebug.LockBtn();
+            }
+        );
+
+        #endregion
+
+        #region E_CentralBtn
+
+        ManaReso.AddButtonEvent
+        (
+            "E_CentralBtn",
+            () =>
+            {
+                ManaReso.SetActive("Ea_Central", true);
+            }
+        );
+
+        #endregion
+
+
+        #region Ea_Cool
+
+        ManaReso.AddButtonEvent
+        (
+            "Ea_Cool",
+            () =>
+            {
+                for (int i = 0; i < ManaData.SkillList.Count; i++)
+                {
+                    ManaData.SkillList[i].ReceiveCool(1, true, true);
+                }
+            }
+        );
+
+        #endregion
+
+        #region Ea_Save
+        
+        ManaReso.AddButtonEvent
+        (
+            "Ea_Save",
+            () =>
+            {
+                Data.SavePlayerConfig();
+            }
+        );
+
+        #endregion
+
+        #region Ea_Close
+         
+        ManaReso.AddButtonEvent
+        (
+            "Ea_Close",
+            () =>
+            {
+                ManaReso.SetActive("Ea_Central", false);
+            }
+        );
+
+        #endregion
+
+        #region Ea_Reset
+
+        ManaReso.AddButtonEvent
+        (
+            "Ea_Reset",
+            () =>
+            {
+                Data.ResetPlayerConfig();
+            }
+        );
+
+        #endregion
+
+        #region Ea_Current
+
+        ManaReso.AddButtonEvent
+        (
+            "Ea_Current",
+            () =>
+            {
+                ManaData.Coin += 1000;
+                ManaData.Diamond += 1000;
+            }
+        );
+
+        #endregion
+
+        #region Ea_Upgrade
+
         ManaReso.AddButtonEvent
         (
-            "E_LockBtn",
+            "Ea_Upgrade",
             () =>
             {
-                ManaLog.LockBtn();
+                ManaData.Level += 20;
             }
         );
 
         #endregion
 
+        #endregion
+
         #region F
 
+        ManaReso.SetText("F_ElfLab");
         ManaReso.SetText("F_StoreLab");
         ManaReso.SetText("F_MagicLab");
-        ManaReso.SetText("F_ElfLab");
         ManaReso.SetText("F_GardenLab");
 
         ManaReso.SetText("Fg_Tit");
-        ManaReso.SetText("Fg_BtnLab");
         ManaReso.SetText("Fg_Lab");
+        ManaReso.SetText("Fg_BtnLab");
 
         #region F_Close
 
@@ -467,31 +607,38 @@ public class ManaUI : MonoBehaviour
             "F_Close",
             () =>
             {
-                ManaReso.Get("C_Main").TweenForCG();
-                ManaReso.SetActive("F_Manage", false);
-
-                ManaReso.Get("F_Manage").TweenBacVec();
+                ManaReso.Get("F_Manage").TweenBacGra();
             }
         );
 
         #endregion
 
-        #region F_TabBtn
+        #region F_Flower
 
         ManaReso.AddButtonEvent
         (
-            "F_Elf",
+            "F_Flower",
             () =>
             {
-                tra = ManaReso.Get("F_Elf");
+                ManaReso.Get("G_Flower").TweenForCG();
+            }
+        );
 
-                tra.GetComponent<Button>().interactable = false;
+        #endregion
+        
+        #region F_TabBtn
 
+        ManaReso.AddButtonEvent
+        (
+            "F_Elf",
+            () =>
+            {
                 ManaReso.Get("F_Elf").SetAsLastSibling();
                 ManaReso.Get("F_Store").SetSiblingIndex(0);
                 ManaReso.Get("F_Magic").SetSiblingIndex(1);
                 ManaReso.Get("F_Garden").SetSiblingIndex(2);
 
+                ManaReso.Get<Button>("F_Elf").interactable = false;
                 ManaReso.Get<Button>("F_Store").interactable = true;
                 ManaReso.Get<Button>("F_Magic").interactable = true;
                 ManaReso.Get<Button>("F_Garden").interactable = true;
@@ -510,16 +657,13 @@ public class ManaUI : MonoBehaviour
             "F_Store",
             () =>
             {
-                tra = ManaReso.Get("F_Store");
-
-                tra.GetComponent<Button>().interactable = false;
-
                 ManaReso.Get("F_Elf").SetSiblingIndex(1);
                 ManaReso.Get("F_Store").SetAsLastSibling();
                 ManaReso.Get("F_Magic").SetSiblingIndex(0);
                 ManaReso.Get("F_Garden").SetSiblingIndex(2);
 
                 ManaReso.Get<Button>("F_Elf").interactable = true;
+                ManaReso.Get<Button>("F_Store").interactable = false;
                 ManaReso.Get<Button>("F_Magic").interactable = true;
                 ManaReso.Get<Button>("F_Garden").interactable = true;
 
@@ -537,10 +681,6 @@ public class ManaUI : MonoBehaviour
             "F_Magic",
             () =>
             {
-                tra = ManaReso.Get("F_Magic");
-
-                tra.GetComponent<Button>().interactable = false;
-
                 ManaReso.Get("F_Elf").SetSiblingIndex(1);
                 ManaReso.Get("F_Store").SetSiblingIndex(0);
                 ManaReso.Get("F_Magic").SetAsLastSibling();
@@ -548,6 +688,7 @@ public class ManaUI : MonoBehaviour
 
                 ManaReso.Get<Button>("F_Elf").interactable = true;
                 ManaReso.Get<Button>("F_Store").interactable = true;
+                ManaReso.Get<Button>("F_Magic").interactable = false;
                 ManaReso.Get<Button>("F_Garden").interactable = true;
 
                 ManaReso.SetActive("Fd_Elf", false);
@@ -564,10 +705,6 @@ public class ManaUI : MonoBehaviour
             "F_Garden",
             () =>
             {
-                tra = ManaReso.Get("F_Garden");
-
-                tra.GetComponent<Button>().interactable = false;
-
                 ManaReso.Get("F_Elf").SetSiblingIndex(2);
                 ManaReso.Get("F_Store").SetSiblingIndex(0);
                 ManaReso.Get("F_Magic").SetSiblingIndex(1);
@@ -576,6 +713,7 @@ public class ManaUI : MonoBehaviour
                 ManaReso.Get<Button>("F_Elf").interactable = true;
                 ManaReso.Get<Button>("F_Store").interactable = true;
                 ManaReso.Get<Button>("F_Magic").interactable = true;
+                ManaReso.Get<Button>("F_Garden").interactable = false;
 
                 ManaReso.SetActive("Fd_Elf", false);
                 ManaReso.SetActive("Fc_Store", false);
@@ -591,36 +729,29 @@ public class ManaUI : MonoBehaviour
 
         #endregion
 
-        #region F_Flower
-
-        ManaReso.AddButtonEvent
-        (
-            "F_Flower",
-            () =>
-            {
-                ManaReso.Get("G_Flower").TweenForCG();
-            }
-        );
-
-        #endregion
+        #region F_Manage
 
-        #region Fa_Scrr
+        tween = ManaReso.Get("F_Manage").CreateTweenGra(new Color(0, 0, 0, 180/255f), 0.5f, true, true, Curve.EaseOutQuad);
 
-        RectTransform rectTra1 = ManaReso.Get<RectTransform>("Fa_Scrr");
-        RectTransform rectTra2 = ManaReso.Get<RectTransform>("Ff_SkillBar");
+        tween.OnBackwardFinish += () =>
+        {
+            ManaReso.Get("F_Manage0").TweenBacVec();
+        };
 
-        rectTra1.CreateTweenRect(rectTra1.rect.size + new Vector2(0, -rectTra2.rect.height), 0.25f, true, true, Curve.EaseOutQuad);
+         tween = ManaReso.Get("F_Manage0").CreateTweenVec(ManaReso.Get("F_PageTra").position, 0.5f, false, true, Curve.EaseOutQuad);
 
-        #endregion
+        tween.OnForwardStart += () =>
+        {
+            ManaReso.Get("C_Main").TweenBacCG();
 
-        #region F_Manage
+            ManaReso.SetActive("F_Manage", true);
 
-        tween = ManaReso.Get("F_Manage").CreateTweenVec(ManaReso.Get("F_PageTra").position, 0.5f, false, true, Curve.EaseOutQuad);
+            ManaData.Main++;
+        };
 
-        tween.OnForwardStart += () =>
+        tween.OnForwardFinish += () =>
         {
-            ManaData.Main += 2;
-            ManaReso.Get("C_Main").TweenBacCG();
+            ManaReso.Get("F_Manage").TweenForGra();
         };
 
         tween.OnBackwardStart += () =>
@@ -628,9 +759,31 @@ public class ManaUI : MonoBehaviour
             ManaData.Main--;
         };
 
+        tween.OnBackwardFinish += () =>
+        {
+            ManaReso.SetActive("F_Manage", false);
+            ManaReso.SetActive("F_Manage0", false);
+        };
+
         #endregion
 
 
+        #region Fa_Scrr
+
+        RectTransform rectTra1 = ManaReso.Get<RectTransform>("Fa_Scrr");
+        RectTransform rectTra2 = ManaReso.Get<RectTransform>("Ff_SkillBar");
+
+        rectTra1.CreateTweenRect(rectTra1.rect.size + new Vector2(0, -rectTra2.rect.height), 0.25f, true, true, Curve.EaseOutQuad);
+
+        #endregion
+
+
+        #region Fe_Info
+
+        ManaReso.Get("Fe_Info").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
+
+        #endregion
+
         #region Fe_Close
 
         ManaReso.AddButtonEvent
@@ -644,13 +797,8 @@ public class ManaUI : MonoBehaviour
 
         #endregion
 
-        #region Fe_Info
-
-        ManaReso.Get("Fe_Info").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
-
-        #endregion
 
-        ManaReso.Get("Fg_Reconnect").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
+        #region Fg_Btn
 
         ManaReso.AddButtonEvent
         (
@@ -662,6 +810,10 @@ public class ManaUI : MonoBehaviour
             }
         );
 
+        #endregion
+
+        #region Fg_Close
+
         ManaReso.AddButtonEvent
         (
             "Fg_Close",
@@ -673,6 +825,14 @@ public class ManaUI : MonoBehaviour
 
         #endregion
 
+        #region Fg_Reconnect
+
+        ManaReso.Get("Fg_Reconnect").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
+
+        #endregion
+
+        #endregion
+
         #region G
 
         ManaReso.SetText("G_Tit");
@@ -693,6 +853,32 @@ public class ManaUI : MonoBehaviour
 
         #endregion
 
+        #region G_Flower
+
+        tween = ManaReso.Get("G_Flower").CreateTweenCG(0f, 1f, 0.25f, false, true, Curve.EaseOutQuad);
+
+        tween.OnForwardStart += () =>
+        {
+            if (ManaData.Main == -1)
+            {
+                ManaReso.Get("C_Main").TweenBacCG();
+            }
+
+            ManaData.Main++;
+
+            if (ManaGarden.MyFlowerSpec == 0)
+            {
+                ManaReso.SetActive("G_Special", false);
+            }
+        };
+
+        tween.OnBackwardStart += () =>
+        {
+            ManaData.Main--;
+        };
+
+        #endregion
+
         #region G_Special
 
         ManaReso.AddButtonEvent
@@ -736,40 +922,11 @@ public class ManaUI : MonoBehaviour
             "G_Retrieve",
             () =>
             {
-                ManaGarden.RetriveFlowerAll();
-
                 ManaReso.Get("G_Flower").TweenBacCG();
-            }
-        );
-
-        #endregion
-
-        #region G_Flower
-
-        tween = ManaReso.Get("G_Flower").CreateTweenCG(0f, 1f, 0.25f, false, true, Curve.EaseOutQuad);
-
-        tween.OnForwardStart += () =>
-        {
-            if (ManaData.Main == -1)
-            {
-                ManaData.Main += 2;
-                ManaReso.Get("C_Main").TweenBacCG();
-            }
-            else
-            {
-                ManaData.Main++;
-            }
 
-            if (ManaGarden.MyFlowerSpec == 0)
-            {
-                ManaReso.SetActive("G_Special", false);
+                ManaGarden.RetriveFlowerAll();
             }
-        };
-
-        tween.OnBackwardStart += () =>
-        {
-            ManaData.Main--;
-        };
+        );
 
         #endregion
 
@@ -814,8 +971,10 @@ public class ManaUI : MonoBehaviour
             () =>
             {
                 ManaReso.Get("H_FlowerCard").TweenBacCG();
+
                 ManaReso.Get<FlowerCard>("H_FlowerCard").Close();
-                ManaGarden.PlaceFlower();
+
+                ManaGarden.PlantFlower();
             }
         );
 
@@ -829,6 +988,7 @@ public class ManaUI : MonoBehaviour
             () =>
             {
                 ManaReso.Get("H_FlowerCard").TweenBacCG();
+
                 ManaReso.Get<FlowerCard>("H_FlowerCard").Close();
             }
         );
@@ -843,9 +1003,9 @@ public class ManaUI : MonoBehaviour
 
             () =>
             {
-                ManaGarden.RetriveFlower();
-
                 ManaReso.Get("H_FlowerCard").TweenBacCG();
+
+                ManaGarden.RetriveFlower();
             }
         );
 
@@ -861,13 +1021,10 @@ public class ManaUI : MonoBehaviour
         {
             if (ManaData.Main == -1)
             {
-                ManaData.Main += 2;
                 ManaReso.Get("C_Main").TweenBacCG();
             }
-            else
-            {
-                ManaData.Main++;
-            }
+
+            ManaData.Main++;
         };
 
         tween.OnBackwardStart += () =>
@@ -881,9 +1038,9 @@ public class ManaUI : MonoBehaviour
 
         #region I
 
-        tra = ManaReso.Get("I_BlackMask");
-        tra.CreateTweenGra(new Color(0, 0, 0, 0), 0.5f, true, false, Curve.EaseOutQuad);
-        tra.TweenForGra();
+        ManaReso.Get("I_BlackMask").CreateTweenGra(new Color(0, 0, 0, 0), 0.5f, true, false, Curve.EaseOutQuad);
+
+        ManaReso.Get("I_BlackMask").TweenForGra();
 
         #endregion
     }

+ 11 - 11
Assets/Script/Object/Flower.cs

@@ -1,4 +1,5 @@
-using UnityEngine;
+using System;
+using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.Serialization;
 using UnityEngine.EventSystems;
@@ -6,6 +7,7 @@ using UnityEngine.EventSystems;
 using System.Xml;
 using System.Collections;
 using System.Collections.Generic;
+using Random = UnityEngine.Random;
 
 public enum OpType
 {
@@ -64,10 +66,8 @@ public class FlowerInfo
                     ManaGarden.MyFlowerRegu++;
                 }
 
-                ManaGarden.UpdateCollectStatus();
-
                 ManaData.SkillPlus += 0.1f;
-                ManaLog.Log("解锁花朵 收入<color=red>+10%</color>");
+                ManaDebug.Log(string.Format("获得<color=red>{0}</color> 收入<color=red>+10%</color>", Name));
             }
         }
     }
@@ -89,7 +89,7 @@ public class FlowerInfo
 
     public FlowerInfo(XmlAttributeCollection attributes)
     {
-        Transform tra = ManaReso.Get("FlowerHouseItem", Folder.PrefabUI, false, ManaReso.Get("G_RegularGrid"),  false);
+        Transform tra = ManaReso.Get("FlowerItemG", Folder.PrefabUI, false, ManaReso.Get("G_RegularGrid"),  false);
 
         Text = tra.FindChild("Lab").GetComponent<Text>();
         Image = tra.FindChild("Icon").GetComponent<Image>();
@@ -97,7 +97,7 @@ public class FlowerInfo
 
         Id = int.Parse(attributes[0].Value);
         Sprite = ManaReso.Load<Sprite>(attributes[3].Value, Folder.Garden);
-        Name = Language.GetStr("Flower", "Flower" + Id);
+        Name = Language.GetStr("FlowerName", "Flower" + Id);
         Description = attributes[2].Value;
 
         Image.sprite = Sprite;
@@ -110,7 +110,7 @@ public class FlowerInfo
         (
             () =>
             {
-                ManaGarden.PlaceFlower(Id);
+                ManaGarden.PlantFlower(Id);
             }
         );
     }
@@ -135,8 +135,8 @@ public class Flower : ObjRoot, IPointerClickHandler
             }
             else if (Phase == 1)
             {
-                ManaReso.GetHudText("得分+1", ChildDic["ScoreTra"], true, 18, Color.red);
-                ManaMiniGame.Score += 1;
+                ManaReso.GetHudText("得分+15", Color.red, 18, ChildDic["ScoreTra"], ManaReso.Get("D_Status"), true);
+                ManaMiniGame.Score += 15;
 
                 GameReset();
             }
@@ -154,7 +154,7 @@ public class Flower : ObjRoot, IPointerClickHandler
     #endregion
 
     public Vector3 LocalPos;
-    public Transform PosTra;
+    public Transform ParTra;
 
     public int Id
     {
@@ -163,7 +163,7 @@ public class Flower : ObjRoot, IPointerClickHandler
         {
             _Id = value;
 
-            FlowerSr.sprite = ManaGarden.FlowerDic[Id].Sprite;
+            FlowerSr.sprite = ManaGarden.FlowerInfoDic[Id].Sprite;
         }
     }
 

+ 9 - 24
Assets/Script/Object/Garden.cs

@@ -5,7 +5,7 @@ using UnityEngine.UI;
 using System.Collections;
 using System.Collections.Generic;
 
-public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDragHandler
+public class Garden : Regist, IDragHandler, IPointerClickHandler, IEndDragHandler
 {
     #region 变量
 
@@ -31,19 +31,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
 
     #endregion
 
-    private void Awake()
-    {
-        Initializer.RegistValue += RegistValue;
-        Initializer.RegistReference += RegistReference;
-    }
-
-    private void Update()
-    {
-
-    }
-
-
-    private void RegistValue()
+    public override void RegistValueA()
     {
         Flag1 = true;
         Flag2 = true;
@@ -122,7 +110,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
         #endregion
 
         #region GardenMini
-
+        
         tween = ManaReso.Get("GardenMini").CreateTweenVec
         (
             ManaReso.Get("PageTraMini").position,
@@ -134,8 +122,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
 
         tween.OnForwardStart += () =>
         {
-            ManaData.Main += 2;
-            ManaReso.Get("C_Main").TweenBacCG();
+            ManaMiniGame.GamePrepare();
         };
 
         tween.OnForwardFinish += () =>
@@ -153,8 +140,6 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
 
         tween.OnBackwardStart += () =>
         {
-            ManaData.Main--;
-
             ManaReso.SetActive("Player", true);
             ManaReso.SetActive("Cloud1", true);
             ManaReso.SetActive("Cloud2", true);
@@ -186,7 +171,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
         #endregion
     }
 
-    private void RegistReference()
+    public override void RegistReference()
     {
         GardenBk2 = ManaReso.Get("GardenBk2");
         GardenBk3 = ManaReso.Get("GardenBk3");
@@ -308,9 +293,9 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
             FlowerCard flowerCard = ManaReso.Get<FlowerCard>("H_FlowerCard");
             ManaGarden.SeleId = -1;
 
-            for (int i = 1; i < ManaGarden.FlowerDic.Count + 1; i++)
+            for (int i = 1; i < ManaGarden.FlowerInfoDic.Count + 1; i++)
             {
-                FlowerInfo flowerInfo = ManaGarden.FlowerDic[i];
+                FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[i];
                 if (flowerInfo.Plant == false && flowerInfo.Unlock)
                 {
                     ManaGarden.SeleId = i;
@@ -331,7 +316,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
                 ManaReso.SetActive("H_Place", true);
                 ManaReso.SetActive("H_Icon1", false);
                 ManaReso.SetActive("H_Retrieve", false);
-                ManaGarden.SeleFlowerTra = eventData.rawPointerPress.transform;
+                ManaGarden.SelePosTra = eventData.rawPointerPress.transform;
                 ManaGarden.SetFlowerCard(ManaGarden.SeleId);
 
                 ManaReso.Get("H_FlowerCard").TweenForCG();
@@ -352,7 +337,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
                 );
             }
         }
-    } //点击土堆
+    }
 
 
     private void Return()

+ 92 - 96
Assets/Script/Object/Skill/Ability.cs

@@ -30,6 +30,7 @@ public class Ability : SkillRoot
     protected Current UpgradeCur;
     protected Current UnlockAheadCur;
 
+    protected bool Article;
     protected string Desc;
     protected string Label;
     protected string Anim;
@@ -58,15 +59,15 @@ public class Ability : SkillRoot
 
             if (_ItemStatus == SkillStatus.Lock)
             {
-                ItemBtnLab.text = string.Format("提前解锁\n等级{0}", UnlockLv);
+                ItemBtnLab.text = string.Format("{0}\n{1}{2}", Language.GetStr("UI", "Fe_BtnLab0"), Language.GetStr("UI", "Fe_BtnLab4"), UnlockLv);
             }
             else if (_ItemStatus == SkillStatus.UnLock)
             {
-                ItemBtnLab.text = string.Format("解锁");
+                ItemBtnLab.text = string.Format(Language.GetStr("UI", "Fe_BtnLab1"));
             }
             else if (_ItemStatus == SkillStatus.Upgrade)
             {
-                ItemBtnLab.text = string.Format("升级");
+                ItemBtnLab.text = string.Format(Language.GetStr("UI", "Fe_BtnLab2"));
             }
             else
             {
@@ -99,11 +100,11 @@ public class Ability : SkillRoot
         ClassID = IntParse(attributes[3].Value);
         UnlockLv = IntParse(attributes[7].Value);
 
-        UnlockAmt = FloatParse(attributes[11].Value); //Sa0
+        UnlockAmt = FloatParse(attributes[11].Value);
         UnlockAheadAmt = FloatParse(attributes[9].Value);
 
-        Tab = SkillClassParse(attributes[2].Value);
-        UpgradeAmt = UpgradeAmtParse(attributes[14].Value); //Sa1
+        SkillTab = SkillClassParse(attributes[2].Value);
+        UpgradeAmt = UpgradeAmtParse(attributes[14].Value);
         
         UnlockCur = CurrentParse(attributes[10].Value);
         UpgradeCur = CurrentParse(attributes[13].Value);
@@ -123,10 +124,10 @@ public class Ability : SkillRoot
     }
 
 
-    public override void RegistValue(double elapse, List<List<SkillRoot>> ffList)
+    public override void RegistValue(float elapse, List<List<SkillRoot>> ffList)
     {
         ItemTit.text = Name;
-        ItemLab.text = GetDescription(0);
+        ItemLab.text = Description(0);
         ItemBtn.onClick.AddListener(OnClick);
 
         NewPlus = Plus;
@@ -139,13 +140,13 @@ public class Ability : SkillRoot
 
         if (ItemStatus == SkillStatus.Upgrade)
         {
-            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+            ManaDebug.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
 
             if (!string.IsNullOrEmpty(UpgradeFml))
             {
                 for (int i = 0; i < Level; i++)
                 {
-                    NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+                    NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
                 }
             }
 
@@ -157,26 +158,21 @@ public class Ability : SkillRoot
             UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
             UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
             
-            Effect();
+            UsePerma();
         }
     }
 
-    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
+    public override void UpdateStatus()
     {
-        
-    }
-
-    public override void OnLevelChange()
-    {
-        if (ManaData.Level >= UnlockLv) //到达解锁等级
+        if (ManaData.Level >= UnlockLv)
         {
             if (ItemStatus == SkillStatus.Lock)
             {
-                if (UnlockCur == Current.Free) //自动解锁
+                if (UnlockCur == Current.Free)
                 {
                     Unlock();
                 }
-                else //付费解锁
+                else
                 {
                     ItemStatus = SkillStatus.UnLock;
                 }
@@ -189,11 +185,11 @@ public class Ability : SkillRoot
     {
         if (ManaData.Pay(UnlockAmt, UnlockCur))
         {
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
 
-            Effect();
+            UsePerma();
 
-            if (UpgradeCur != Current.Free) //升级类型
+            if (UpgradeCur != Current.Free)
             {
                 ItemStatus = SkillStatus.Upgrade;
             }
@@ -204,33 +200,6 @@ public class Ability : SkillRoot
         }
     }
 
-    protected void UnlockAhead()
-    {
-        if (ItemStatus != SkillStatus.Lock)
-        {
-            ManaLog.Log("您并不需要提前解锁");
-
-            return;
-        }
-
-        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
-        {
-            Effect();
-
-            if (UpgradeCur != Current.Free) //升级类型
-            {
-                ItemStatus = SkillStatus.Upgrade;
-            }
-            else
-            {
-                throw new Exception();
-            }
-
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
-        }
-    }
-
-
     protected void OnClick()
     {
         if (ManaData.Connect == false)
@@ -246,7 +215,7 @@ public class Ability : SkillRoot
         if (ItemStatus == SkillStatus.Lock)
         {
             ManaReso.SetText("Fe_Lab0", "");
-            ManaReso.SetText("Fe_Lab1", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", Description(0));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2})", Language.GetStr("UI", "Fe_BtnLab0"), UnlockAheadCur, UnlockAheadAmt));
 
             ManaReso.SetButtonEvent
@@ -262,7 +231,7 @@ public class Ability : SkillRoot
         else if (ItemStatus == SkillStatus.UnLock)
         {
             ManaReso.SetText("Fe_Lab0", "");
-            ManaReso.SetText("Fe_Lab1", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", Description(0));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2})", Language.GetStr("UI", "Fe_BtnLab1"), UnlockCur, UnlockAmt));
 
             ManaReso.SetButtonEvent
@@ -277,8 +246,8 @@ public class Ability : SkillRoot
         }
         else if (ItemStatus == SkillStatus.Upgrade)
         {
-            ManaReso.SetText("Fe_Lab0", GetDescription(0));
-            ManaReso.SetText("Fe_Lab1", GetDescription(1));
+            ManaReso.SetText("Fe_Lab0", Description(0));
+            ManaReso.SetText("Fe_Lab1", Description(1));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), UpgradeCur, NewUpgradeAmt));
 
             ManaReso.SetButtonEvent
@@ -302,7 +271,7 @@ public class Ability : SkillRoot
         {
             Level++;
 
-            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+            NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
             UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
             UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
             UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
@@ -311,32 +280,33 @@ public class Ability : SkillRoot
             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));
+            ItemLab.text = Description(0);
+            ManaReso.SetText("Fe_Lab0", Description(0));
+            ManaReso.SetText("Fe_Lab1", Description(1));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), UpgradeCur, NewUpgradeAmt));
 
-            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+            ManaDebug.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
 
-            if (ItemStatus == SkillStatus.Use) //更新技能效果
+            if (ItemStatus == SkillStatus.Use)
             {
                 Annul();
-                Effect();
+                UsePerma();
             }
         }
     }
 
-
-    public override bool DoUse()
+    protected void UsePerma()
     {
-        return true;
-    }
-
-    protected void Effect()
-    {
-        if (!string.IsNullOrEmpty(Anim))
+        if (Article == false)
         {
-            ManaReso.Get(Anim, Folder.Object, false, ManaReso.Get("Garden"), true);
+            Article = true;
+
+            if (!string.IsNullOrEmpty(Anim))
+            {
+                string[] strings = Anim.Split(',');
+
+                ManaReso.Get(strings[0], Folder.Object, false, ManaReso.Get(strings[1]), true);
+            }
         }
 
         if (Name == "花园")
@@ -407,14 +377,63 @@ public class Ability : SkillRoot
 
         strb.Append(" <color=red>永久有效</color>");
 
-        ManaLog.Log(strb.ToString());
+        ManaDebug.Log(strb.ToString());
 
         #endregion
     }
 
+    protected void UnlockAhead()
+    {
+        if (ItemStatus != SkillStatus.Lock)
+        {
+            ManaDebug.Log("您并不需要提前解锁");
+
+            return;
+        }
+
+        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
+        {
+            UsePerma();
+
+            if (UpgradeCur != Current.Free)
+            {
+                ItemStatus = SkillStatus.Upgrade;
+            }
+            else
+            {
+                throw new Exception();
+            }
+
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+        }
+    }
+
     #region 解读器
 
-    protected string GetDescription(int offset)
+    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;
+        }
+    }
+
+    protected string Description(int offset)
     {
         float temp;
         string[] strings = Desc.Split('[', ']');
@@ -509,7 +528,7 @@ public class Ability : SkillRoot
         }
 
         return stringBuilder.ToString();
-    } //得到说明
+    }
 
     protected double UpgradeAmtParse(string str)
     {
@@ -523,28 +542,5 @@ 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
 }

+ 126 - 167
Assets/Script/Object/Skill/BigSkill.cs

@@ -38,57 +38,31 @@ public class BigSkill : Skill
             }
             else if (_BarStatus == SkillStatus.Buy)
             {
-                if (Tab != SkillTab.Null) //有技能条
+                if (SkillTab != SkillTab.Null && ItemStatus != SkillStatus.Upgrade)
                 {
-                    #region MyRegion
-
-                    if (ItemStatus == SkillStatus.Upgrade) //可以使用
-                    {
-                        BarBk0.SetActive(false);
-                        BarBk1.SetActive(true);
-                        BarBtn.interactable = true;
-                        BarLab.text = "";
-                    }
-                    else if (ItemStatus == SkillStatus.Buy) //需要购买
-                    {
-                        BarBk0.SetActive(false);
-                        BarBk1.SetActive(true);
-                        BarBtn.interactable = true;
-                        BarLab.text = "";
-                    }
-                    else //未解锁
-                    {
                         BarBk0.SetActive(false);
                         BarBk1.SetActive(true);
                         BarBtn.interactable = false;
                         BarLab.text = "";
 
                         BarBk1.material = ManaReso.Load<Material>("Gray", Folder.Shader);
-                    }
-
-                    #endregion
                 }
-                else //没有技能条
+                else
                 {
-                    #region MyRegion
-
                     BarBk0.SetActive(false);
                     BarBk1.SetActive(true);
                     BarBtn.interactable = true;
                     BarLab.text = "";
-
-                    #endregion
                 }
             }
             else if (_BarStatus == SkillStatus.Use)
             {
-                ManaData.UsingList.Add(this);
+                ManaData.UseList.Add(this);
             }
             else
             {
                 throw new Exception();
             }
-
         }
     }
 
@@ -99,24 +73,22 @@ public class BigSkill : Skill
         {
             _ItemStatus = value;
 
-            if (Tab == SkillTab.Null) //该技能不生成技能条
+            if (SkillTab == SkillTab.Null)
             {
                 return;
             }
 
             if (_ItemStatus == SkillStatus.Lock)
             {
-                ItemBtnLab.text = string.Format("提前解锁\n等级{0}", UnlockLv);
+                ItemBtnLab.text = string.Format("{0}\n{1}{2}", Language.GetStr("UI", "Fe_BtnLab0"), Language.GetStr("UI", "Fe_BtnLab4"), UnlockLv);
             }
             else if (_ItemStatus == SkillStatus.UnLock)
             {
-                ItemBtnLab.text = string.Format("解锁");
+                ItemBtnLab.text = string.Format(Language.GetStr("UI", "Fe_BtnLab1"));
             }
             else if (_ItemStatus == SkillStatus.Upgrade)
             {
-                ItemBtnLab.text = string.Format("升级");
-
-                BarStatus = SkillStatus.Buy;
+                ItemBtnLab.text = string.Format(Language.GetStr("UI", "Fe_BtnLab2"));
             }
             else
             {
@@ -137,6 +109,58 @@ public class BigSkill : Skill
     }
 
 
+    public override void Annul()
+    {
+        CoolTimer = CD * (1 + CdBuff);
+
+        BarLab.color = Color.white;
+
+        BarStatus = SkillStatus.Cool;
+
+        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);
+            }
+        }
+
+        ManaDebug.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
+    }
+
+    public override bool DoUse()
+    {
+        UseTimer -= Time.deltaTime;
+
+        BarLab.text = UseTimer.ToString("0.0");
+
+        if (UseTimer <= 0)
+        {
+            Annul();
+
+            ManaData.UseList.Remove(this);
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
     public override bool DoCool()
     {
         CoolTimer -= Time.deltaTime;
@@ -145,7 +169,7 @@ public class BigSkill : Skill
 
         BarLab.text = string.Format("{0} : {1}", timeSpan.Minutes, timeSpan.Seconds);
 
-        BarBk0.fillAmount = (float)CoolTimer / CD;
+        BarBk0.fillAmount = CoolTimer / CD;
 
         if (CoolTimer <= 0)
         {
@@ -161,9 +185,10 @@ public class BigSkill : Skill
         }
     }
 
-    public override void RegistValue(double elapse, List<List<SkillRoot>> ffList)
+    public override void RegistValue(float elapse, List<List<SkillRoot>> ffList)
     {
-        BarBtn.onClick.AddListener(Use);
+        BarBtn.onClick.AddListener(Buy);
+
         BarBk1.sprite = ManaReso.Load<Sprite>(Icon + "副", Folder.Skill);
         
         NewPlus = Plus;
@@ -181,7 +206,7 @@ public class BigSkill : Skill
         {
             for (int i = 0; i < Level; i++)
             {
-                NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+                NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
             }
         }
         
@@ -196,10 +221,10 @@ public class BigSkill : Skill
         UpgradeValue(ref NewCoinOnce, CoinOnce, UpgradeCoinOnce, Level);
         UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
 
-        if (Tab != SkillTab.Null)
+        if (SkillTab != SkillTab.Null)
         {
             ItemTit.text = Name;
-            ItemLab.text = GetDescription(0);
+            ItemLab.text = Description(0);
             ItemBtn.onClick.AddListener(OnClick);
         }
 
@@ -214,25 +239,26 @@ public class BigSkill : Skill
 
         if (_ItemStatus == SkillStatus.Upgrade)
         {
-            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁 等级 : {1}", Name, Level));
 
             ShowSkillBar();
         }
 
         if (_BarStatus == SkillStatus.Use)
         {
-            Effect();
-            if (UsingTimer < elapse)
+            UsePerma();
+
+            if (UseTimer < elapse)
             {
                 if (ffList.Count > 0)
                 {
-                    if (UsingTimer < ManaData.CircleTimer)
+                    if (UseTimer < ManaData.CircleTimer)
                     {
                         ffList[0].UniqueAdd(this);
                     }
                     else
                     {
-                        int ffCircle = 1 + Mathf.FloorToInt((float)((UsingTimer - ManaData.CircleTimer) / ManaData.CircleTime));
+                        int ffCircle = 1 + Mathf.FloorToInt(((UseTimer - ManaData.CircleTimer) / ManaData.CircleTime));
 
                         ffList[ffCircle].UniqueAdd(this);
                     }
@@ -240,11 +266,9 @@ public class BigSkill : Skill
             }
             else
             {
-                ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+                UseTimer -= elapse;
 
-                UsingTimer -= elapse;
-
-                BarLab.color = new Color(38 / 255f, 155 / 255f, 1, 1);
+                BarLab.color = Color.blue;
             }
         }
         else if (_BarStatus == SkillStatus.Cool)
@@ -256,45 +280,61 @@ public class BigSkill : Skill
         BarStatus = BarStatus;
     }
 
-    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
+    public override void ReceiveCool(float amt, bool current, bool buff)
     {
         if (!ReduceCD)
         {
             return;
         }
         
-        if (isCurrent) //减少当前值
+        if (current)
         {
-            if (isBuff) //按比例减少
+            if (BarStatus != SkillStatus.Cool)
+            {
+                return;
+            }
+
+            if (buff)
             {
                 CoolTimer -= CD * amt;
             }
-            else //按数值减少
+            else
             {
                 CoolTimer -= amt;
             }
         }
-        else //减少最大值
+        else
         {
-            if (isBuff) //按比例减少
+            if (buff)
             {
                 CdBuff -= amt;
             }
-            else //按数值减少
+            else
             {
                 CD -= amt;
             }
         }
     }
 
+    public override void RegistReference()
+    {
+        base.RegistReference();
+
+        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>();
+    }
+
+
     private void ShowSkillBar()
     {
         if (!ManaData.SkillBar)
         {
-            ManaReso.Get("Fa_Scrr").TweenForRect();
-
             ManaData.SkillBar = true;
 
+            ManaReso.Get("Fa_Scrr").TweenForRect();
+
             if (ManaReso.Get("Fa_Garden").gameObject.activeSelf)
             {
                 ManaReso.SetActive("Ff_SkillBar", true);
@@ -302,16 +342,8 @@ public class BigSkill : Skill
         }
     }
 
-    public override void RegistReference()
-    {
-        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()
+    protected override void Buy()
     {
         if (ManaData.Connect == false)
         {
@@ -320,15 +352,9 @@ public class BigSkill : Skill
             return;
         }
 
-        if (BarStatus == SkillStatus.Use)
-        {
-            return;
-        }
-
         if (ManaData.Pay(UseAmt, UseCur))
         {
-            CoolTimer = CD * (1 + CdBuff);
-            UsingTimer = NewDuration;
+            UseTimer = NewDuration;
 
             if (Math.Abs(Duration) < 0.0005f)
             {
@@ -337,11 +363,11 @@ public class BigSkill : Skill
             else
             {
                 BarStatus = SkillStatus.Use;
-                BarLab.color = new Color(38/255f, 155/255f, 1, 1);
+                BarLab.color = Color.blue;
             }
 
-            Effect();
-            EffectOnce();
+            UsePerma();
+            UseImmed();
 
             #region 调试输出
 
@@ -403,7 +429,7 @@ public class BigSkill : Skill
                 strb.Append(" <color=red>永久有效</color>");
             }
 
-            ManaLog.Log(strb.ToString());
+            ManaDebug.Log(strb.ToString());
 
             #endregion
         }
@@ -415,55 +441,17 @@ public class BigSkill : Skill
         {
             ShowSkillBar();
 
-            BarStatus = SkillStatus.Buy;
-
-            if (Tab != SkillTab.Null) //该技能有技能条
-            {
-                if (UpgradeCur != Current.Free) //升级类型
-                {
-                    ItemStatus = SkillStatus.Upgrade;
-                }
-                else
-                {
-                    throw new Exception();
-                }
-            }
-            else
-            {
-                ItemStatus = SkillStatus.Buy;
-            }
-
             BarBk1.material = null;
 
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
-        }
-    }
-
-    protected override void UnlockAhead()
-    {
-        if (ItemStatus != SkillStatus.Lock)
-        {
-            ManaLog.Log("您并不需要提前解锁");
-
-            return;
-        }
-
-        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
-        {
+            ItemStatus = SkillStatus.Upgrade;
             BarStatus = SkillStatus.Buy;
 
-            ManaReso.Get("Fe_Info").TweenBacCG();
-
-            if (UpgradeCur != Current.Free) //升级类型
+            if (SkillTab != SkillTab.Null)
             {
                 ItemStatus = SkillStatus.Upgrade;
             }
-            else
-            {
-                throw new Exception();
-            }
-
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+            
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
     }
 
@@ -473,7 +461,7 @@ public class BigSkill : Skill
         {
             Level++;
 
-            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+            NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
 
             UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
             UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
@@ -486,68 +474,39 @@ public class BigSkill : Skill
             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));
+            ItemLab.text = Description(0);
+            ManaReso.SetText("Fe_Lab0", Description(0));
+            ManaReso.SetText("Fe_Lab1", Description(1));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), UpgradeCur, NewUpgradeAmt));
 
-            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+            ManaDebug.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
 
-            if (BarStatus == SkillStatus.Use) //更新技能效果
+            if (BarStatus == SkillStatus.Use)
             {
                 Annul();
-                Effect();
+                UsePerma();
             }
         }
     }
 
-
-    public override void Annul() //注销技能
+    protected override void UnlockAhead()
     {
-        BarLab.color = new Color(1, 1, 1, 1);
-        BarStatus = SkillStatus.Cool;
-
-        ManaData.SkillPlus -= NewPlus;
-        ManaData.SkillPerson -= NewPerson;
-        ManaData.SkillPersonBuff -= NewPersonBuff;
-        ManaData.SkillCoinPerson -= NewCoinPerson;
-
-        if (Math.Abs(NewSkillCD) > 0.0005f)
+        if (ItemStatus != SkillStatus.Lock)
         {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].ReceiveCool(-NewSkillCD, true, false);
-            }
-        }
+            ManaDebug.Log("您并不需要提前解锁");
 
-        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].ReceiveCool(-NewSkillCdBuff, true, true);
-            }
+            return;
         }
 
-        ManaLog.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
-    }
-
-    public override bool DoUse()
-    {
-        UsingTimer -= Time.deltaTime;
-
-        BarLab.text = UsingTimer.ToString("0.0");
-
-        if (UsingTimer <= 0)
+        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
         {
-            Annul();
+            BarStatus = SkillStatus.Buy;
 
-            ManaData.UsingList.Remove(this);
+            ItemStatus = SkillStatus.Upgrade;
 
-            return true;
-        }
-        else
-        {
-            return false;
+            ManaReso.Get("Fe_Info").TweenBacCG();
+
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
     }
 }

+ 64 - 55
Assets/Script/Object/Skill/Pack.cs

@@ -12,7 +12,6 @@ public class Pack : SkillRoot
 
     #region 配置
 
-    protected int Flower;
     protected int MinUseLv;
     protected int MaxUseLv;
 
@@ -30,6 +29,7 @@ public class Pack : SkillRoot
     protected string Desc;
     protected string Label;
     protected string Anim;
+    protected string Flower;
     protected Current UseCur;
 
     #endregion
@@ -47,13 +47,13 @@ public class Pack : SkillRoot
             {
                 ItemBtn.interactable = true;
 
-                ItemBtnLab.text = string.Format("购买\n{0}{1}", UseCur, UseAmt);
+                ItemBtnLab.text = string.Format("{0}\n{1}{2}", Language.GetStr("UI", "Fe_BtnLab3"), UseCur, UseAmt);
             }
             else if (_ItemStatus == SkillStatus.Lock)
             {
                 ItemBtn.interactable = false;
 
-                ItemBtnLab.text = string.Format("无法使用\n等级{0}-{1}", MinUseLv, MaxUseLv);
+                ItemBtnLab.text = string.Format("{0}\n{1}{2}-{3}", Language.GetStr("UI", "Fe_BtnLab5"), Language.GetStr("UI", "Fe_BtnLab4"), MinUseLv, MaxUseLv);
             }
             else
             {
@@ -74,14 +74,14 @@ public class Pack : SkillRoot
         Anim = attributes[15].Value;
         Label = attributes[16].Value;
         Name = Language.GetStr("SkillName", "Pack" + ID);
+        Flower = attributes[9].Value;
 
-        Flower = IntParse(attributes[9].Value);
         ClassID = IntParse(attributes[3].Value);
         UseAmt = FloatParse(attributes[12].Value);
         CoinOnce = FloatParse(attributes[7].Value);
         DiamondOnce = FloatParse(attributes[8].Value);
         
-        Tab = SkillClassParse(attributes[2].Value);
+        SkillTab = SkillClassParse(attributes[2].Value);
         UseCur = CurrentParse(attributes[11].Value);
         MinUseLv = MinLevelParse(attributes[10].Value);
         MaxUseLv = MaxLevelParse(attributes[10].Value);
@@ -96,25 +96,20 @@ public class Pack : SkillRoot
     }
 
 
-    public override void RegistValue(double elapse, List<List<SkillRoot>> ffList)
+    public override void RegistValue(float elapse, List<List<SkillRoot>> ffList)
     {
         ItemTit.text = Name;
-        ItemLab.text = GetDescription(0);
+        ItemLab.text = Description(0);
         ItemBtn.onClick.AddListener(OnClick);
 
         for (int i = 0; i < Level; i++)
         {
-            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
-            Effect();
+            ManaDebug.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+            UsePerma();
         }
     }
 
-    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
-    {
-        
-    }
-
-    public override void OnLevelChange()
+    public override void UpdateStatus()
     {
         if (MaxUseLv == MinUseLv)
         {
@@ -122,7 +117,7 @@ public class Pack : SkillRoot
         }
         else
         {
-            if (ManaData.Level > MaxUseLv || ManaData.Level < MinUseLv) //无法使用
+            if (ManaData.Level > MaxUseLv || ManaData.Level < MinUseLv)
             {
                 ItemStatus = SkillStatus.Lock;
             }
@@ -146,7 +141,7 @@ public class Pack : SkillRoot
         ManaReso.Get("Fe_Info").TweenForCG();
         ManaReso.SetText("Fe_Tit", Name);
 
-        if (MinUseLv != MaxUseLv) //有等级限制
+        if (MinUseLv != MaxUseLv)
         {
             ManaReso.SetText("Fe_Lab0", string.Format("{0}-{1}级可用", MinUseLv, MaxUseLv));
             ManaReso.SetActive("Fe_Lab0", true);
@@ -158,7 +153,7 @@ public class Pack : SkillRoot
 
         if (ItemStatus == SkillStatus.Buy)
         {
-            ManaReso.SetText("Fe_Lab1", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", Description(0));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2})", Language.GetStr("UI", "Fe_BtnLab3"), UseCur, UseAmt));
 
             ManaReso.SetButtonEvent
@@ -166,7 +161,7 @@ public class Pack : SkillRoot
                 "Fe_Btn",
                 () =>
                 {
-                    Use();
+                    Buy();
                     ManaReso.Get("Fe_Info").TweenBacCG();
                 }
             );
@@ -177,15 +172,10 @@ public class Pack : SkillRoot
         }
     }
 
-    protected virtual void Use()
+    protected virtual void Buy()
     {
         if (ManaData.Pay(UseAmt, UseCur))
         {
-            Effect();
-            EffectOnce();
-
-            Level++;
-
             #region 调试输出
 
             StringBuilder strb = new StringBuilder();
@@ -232,22 +222,47 @@ public class Pack : SkillRoot
                 strb.AppendFormat(" 获得钻石<color=red>{0}</color>", DiamondOnce);
             }
 
+            if (!string.IsNullOrEmpty(Flower))
+            {
+                string[] strings = Flower.Split(' ');
+
+                for (int i = 0; i < strings.Length; i++)
+                {
+                    strb.AppendFormat(" 获得<color=red>{0}</color>", ManaGarden.FlowerInfoDic[int.Parse(strings[i])].Name);
+                }
+            }
+
             strb.Append(" <color=red>永久有效</color>");
 
-            ManaLog.Log(strb.ToString());
+            ManaDebug.Log(strb.ToString());
 
             #endregion
+
+            UsePerma();
+            UseImmed();
+
+            Level++;
         }
     }
 
 
-    public override bool DoUse()
+    protected void UsePerma()
     {
-        return true;
-    }
+        if (!string.IsNullOrEmpty(Flower))
+        {
+            string[] strings = Flower.Split(' ');
 
-    protected void Effect()
-    {
+            for (int i = 0; i < strings.Length; i++)
+            {
+                FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[int.Parse(strings[i])];
+
+                if (flowerInfo.Unlock == false)
+                {
+                    flowerInfo.Unlock = true;
+                }
+            }
+        }
+        
         ManaData.SkillPlus += Plus;
         ManaData.SkillPerson += Person;
         ManaData.SkillPersonBuff += PersonBuff;
@@ -270,7 +285,7 @@ public class Pack : SkillRoot
         }
     }
 
-    protected void EffectOnce()
+    protected void UseImmed()
     {
         ManaData.Coin += CoinOnce;
         ManaData.Diamond += DiamondOnce;
@@ -278,7 +293,7 @@ public class Pack : SkillRoot
 
     #region 解读器
 
-    private int MinLevelParse(string str)
+    protected int MinLevelParse(string str)
     {
         if (string.IsNullOrEmpty(str))
         {
@@ -290,7 +305,7 @@ public class Pack : SkillRoot
         }
     }
 
-    private int MaxLevelParse(string str)
+    protected int MaxLevelParse(string str)
     {
         if (string.IsNullOrEmpty(str))
         {
@@ -302,10 +317,10 @@ public class Pack : SkillRoot
         }
     }
 
-    protected string GetDescription(int offset)
+    protected string Description(int offset)
     {
         string[] strings = Desc.Split('[', ']');
-
+        
         StringBuilder stringBuilder = new StringBuilder();
 
         for (int i = 0; i < strings.Length; i++)
@@ -322,10 +337,6 @@ public class Pack : SkillRoot
                 {
                     stringBuilder.Append(CoinOnce);
                 }
-                else
-                {
-
-                }
 
                 #endregion
             }
@@ -333,13 +344,19 @@ public class Pack : SkillRoot
             {
                 #region MyRegion
 
-                if (Math.Abs(Flower) > 0.0005f)
-                {
-                    stringBuilder.Append(Flower);
-                }
-                else
+                if (!string.IsNullOrEmpty(Flower))
                 {
+                    string[] strings1 = Flower.Split(' ');
 
+                    for (int j = 0; j < strings1.Length; j++)
+                    {
+                        stringBuilder.Append(Language.GetStr("FlowerName", "Flower" + strings1[j]));
+
+                        if (j != strings1.Length - 1)
+                        {
+                            stringBuilder.Append(",");
+                        }
+                    }
                 }
 
                 #endregion
@@ -352,10 +369,6 @@ public class Pack : SkillRoot
                 {
                     stringBuilder.Append(DiamondOnce);
                 }
-                else
-                {
-
-                }
 
                 #endregion
             }
@@ -371,10 +384,6 @@ public class Pack : SkillRoot
                 {
                     stringBuilder.Append(CoinPerson);
                 }
-                else
-                {
-
-                }
 
                 #endregion
             }
@@ -383,9 +392,9 @@ public class Pack : SkillRoot
                 stringBuilder.Append(strings[i]);
             }
         }
-
+        
         return stringBuilder.ToString();
-    } //得到说明
+    }
 
     #endregion
 }

+ 238 - 226
Assets/Script/Object/Skill/Skill.cs

@@ -3,10 +3,10 @@ using UnityEngine.UI;
 
 using System;
 using System.Xml;
+using System.Linq;
 using System.Text;
 using System.Collections;
 using System.Collections.Generic;
-using System.Linq;
 
 public class Skill : SkillRoot
 {
@@ -22,8 +22,8 @@ public class Skill : SkillRoot
     protected float CoinOnce;
     protected float CoinPerson;
     protected float DiamondOnce;
-    protected double UpgradeAmt;
     protected bool ReduceCD;
+    protected double UpgradeAmt;
 
     protected float Plus;
     protected float CdBuff;
@@ -54,8 +54,8 @@ public class Skill : SkillRoot
 
     #endregion
 
-    public double CoolTimer; //冷却计时
-    public double UsingTimer; //冷却计时
+    public float UseTimer;
+    public float CoolTimer;
 
     protected float NewPlus;
     protected float NewPerson;
@@ -75,7 +75,7 @@ public class Skill : SkillRoot
         {
             _ItemStatus = value;
 
-            if (Tab == SkillTab.Null) //该技能不生成技能条
+            if (SkillTab == SkillTab.Null)
             {
                 return;
             }
@@ -86,23 +86,23 @@ public class Skill : SkillRoot
             }
             else if (_ItemStatus == SkillStatus.Buy)
             {
-                ItemBtnLab.text = string.Format("购买\n{0}{1}", UseCur, UseAmt);
+                ItemBtnLab.text = string.Format("{0}\n{1}{2}", Language.GetStr("UI", "Fe_BtnLab3"),UseCur, UseAmt);
             }
             else if (_ItemStatus == SkillStatus.Use)
             {
-                ManaData.UsingList.Add(this);
+                ManaData.UseList.Add(this);
             }
             else if (_ItemStatus == SkillStatus.Lock)
             {
-                ItemBtnLab.text = string.Format("提前解锁\n等级{0}", UnlockLv);
+                ItemBtnLab.text = string.Format("{0}\n{1}{2}", Language.GetStr("UI", "Fe_BtnLab0"), Language.GetStr("UI", "Fe_BtnLab4"), UnlockLv);
             }
             else if (_ItemStatus == SkillStatus.UnLock)
             {
-                ItemBtnLab.text = string.Format("解锁");
+                ItemBtnLab.text = string.Format(Language.GetStr("UI", "Fe_BtnLab1"));
             }
             else if (_ItemStatus == SkillStatus.Upgrade)
             {
-                ItemBtnLab.text = string.Format("升级");
+                ItemBtnLab.text = string.Format(Language.GetStr("UI", "Fe_BtnLab2"));
             }
             else
             {
@@ -140,13 +140,13 @@ public class Skill : SkillRoot
         CD = FloatParse(attributes[12].Value);
         UseAmt = FloatParse(attributes[20].Value);
         Duration = FloatParse(attributes[11].Value);
-        UnlockAmt = FloatParse(attributes[17].Value); //Sa0
+        UnlockAmt = FloatParse(attributes[17].Value);
         DiamondOnce = FloatParse(attributes[9].Value);
         UnlockAheadAmt = FloatParse(attributes[15].Value);
 
-        Tab = SkillClassParse(attributes[2].Value);
+        SkillTab = SkillClassParse(attributes[2].Value);
         ReduceCD = BoolParse(attributes[5].Value);
-        UpgradeAmt = UpgradeAmtParse(attributes[22].Value); //Sa1
+        UpgradeAmt = UpgradeAmtParse(attributes[22].Value);
         
         UseCur = CurrentParse(attributes[19].Value);
         UnlockCur = CurrentParse(attributes[16].Value);
@@ -164,7 +164,99 @@ public class Skill : SkillRoot
     }
 
 
-    public override void RegistValue(double elapse, List<List<SkillRoot>> ffList)
+    public virtual bool DoCool()
+    {
+        CoolTimer -= Time.deltaTime;
+
+        TimeSpan timeSpan = new TimeSpan(0, 0, (int)CoolTimer);
+
+        ItemBtnLab.text = string.Format("{0}\n{1}({2}:{3})", Language.GetStr("UI", "Fe_BtnLab6"), Language.GetStr("UI", "Fe_BtnLab7"), timeSpan.Minutes, timeSpan.Seconds);
+
+        if (CoolTimer <= 0)
+        {
+            ItemStatus = SkillStatus.Buy;
+
+            ManaData.CoolList.Remove(this);
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+
+    public override void Annul()
+    {
+        CoolTimer = CD * (1 + CdBuff);
+
+        ItemStatus = SkillStatus.Cool;
+        ItemBtnLab.color = Color.white;
+
+        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);
+            }
+        }
+
+        ManaDebug.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
+    }
+
+    public override bool DoUse()
+    {
+        UseTimer -= Time.deltaTime;
+
+        ItemLab.text = UseTimer.ToString("0.0");
+
+        if (UseTimer <= 0)
+        {
+            Annul();
+
+            ManaData.UseList.Remove(this);
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    public override void UpdateStatus()
+    {
+        if (ManaData.Level >= UnlockLv)
+        {
+            if (ItemStatus == SkillStatus.Lock)
+            {
+                if (UnlockCur == Current.Free)
+                {
+                    Unlock();
+                }
+                else
+                {
+                    ItemStatus = SkillStatus.UnLock;
+                }
+            }
+        }
+    }
+
+    public override void RegistValue(float elapse, List<List<SkillRoot>> ffList)
     {
         NewPlus = Plus;
         NewPerson = Person;
@@ -181,7 +273,7 @@ public class Skill : SkillRoot
         {
             for (int i = 0; i < Level; i++)
             {
-                NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+                NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
             }
         }
 
@@ -197,29 +289,29 @@ public class Skill : SkillRoot
         UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
 
         ItemTit.text = Name;
-        ItemLab.text = GetDescription(0);
+        ItemLab.text = Description(0);
         ItemBtn.onClick.AddListener(OnClick);
 
         if (_ItemStatus != SkillStatus.Lock && _ItemStatus != SkillStatus.UnLock)
         {
-            ManaLog.Log(string.Format("初始化<color=red>{0}</color> 等级 : {1}", Name, Level));
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁 等级 : {1}", Name, Level));
         }
 
         if (_ItemStatus == SkillStatus.Use)
         {
-            Effect();
+            UsePerma();
 
-            if (UsingTimer < elapse)
+            if (UseTimer < elapse)
             {
                 if (ffList.Count > 0)
                 {
-                    if (UsingTimer < ManaData.CircleTimer)
+                    if (UseTimer < ManaData.CircleTimer)
                     {
                         ffList[0].UniqueAdd(this);
                     }
                     else
                     {
-                        int ffCircle = 1 + Mathf.FloorToInt((float)(UsingTimer - ManaData.CircleTimer / ManaData.CircleTime));
+                        int ffCircle = 1 + Mathf.FloorToInt((float)(UseTimer - ManaData.CircleTimer / ManaData.CircleTime));
 
                         ffList[ffCircle].UniqueAdd(this);
                     }
@@ -227,9 +319,9 @@ public class Skill : SkillRoot
             }
             else
             {
-                UsingTimer -= elapse;
+                UseTimer -= elapse;
 
-                ItemBtnLab.color = new Color(38 / 255f, 155 / 255f, 1, 1);
+                ItemBtnLab.color = Color.blue;
             }
         }
         else if (_ItemStatus == SkillStatus.Cool)
@@ -240,77 +332,42 @@ public class Skill : SkillRoot
         ItemStatus = ItemStatus;
     }
 
-    public virtual bool DoCool()
-    {
-        CoolTimer -= Time.deltaTime;
-
-        TimeSpan timeSpan = new TimeSpan(0, 0, (int)CoolTimer);
-
-        ItemBtnLab.text = string.Format("冷却中\n剩余时间({0}:{1})", timeSpan.Minutes, timeSpan.Seconds);
-
-        if (CoolTimer <= 0)
-        {
-            ItemStatus = SkillStatus.Buy;
-
-            ManaData.CoolList.Remove(this);
-
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-
-    public override void ReceiveCool(float amt, bool isCurrent, bool isBuff)
+    public override void ReceiveCool(float amt, bool current, bool buff)
     {
-        if (!ReduceCD && ItemStatus == SkillStatus.Cool)
+        if (!ReduceCD)
         {
             return;
         }
 
-        if (isCurrent) //减少当前值
+        if (current)
         {
-            if (isBuff) //按比例减少
+            if (ItemStatus != SkillStatus.Cool)
+            {
+                return;
+            }
+
+            if (buff)
             {
                 CoolTimer -= CD * amt;
             }
-            else //按数值减少
+            else
             {
                 CoolTimer -= amt;
             }
         }
-        else //减少最大值
+        else
         {
-            if (isBuff) //按比例减少
+            if (buff)
             {
                 CdBuff -= amt;
             }
-            else //按数值减少
+            else
             {
                 CD -= amt;
             }
         }
     }
 
-    public override void OnLevelChange()
-    {
-        if (ManaData.Level >= UnlockLv) //到达解锁等级
-        {
-            if (ItemStatus == SkillStatus.Lock)
-            {
-                if (UnlockCur == Current.Free) //自动解锁
-                {
-                    Unlock();
-                }
-                else //付费解锁
-                {
-                    ItemStatus = SkillStatus.UnLock;
-                }
-            }
-        }
-    }
-
 
     protected void OnClick()
     {
@@ -322,11 +379,12 @@ public class Skill : SkillRoot
         }
 
         ManaReso.Get("Fe_Info").TweenForCG();
+
         ManaReso.SetText("Fe_Tit", Name);
 
         if (ItemStatus == SkillStatus.Buy)
         {
-            ManaReso.SetText("Fe_Lab1", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", Description(0));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2})", Language.GetStr("UI", "Fe_BtnLab3"), UseCur, UseAmt));
 
             ManaReso.SetButtonEvent
@@ -334,19 +392,16 @@ public class Skill : SkillRoot
                 "Fe_Btn",
                 () =>
                 {
-                    Use();
+                    Buy();
+
                     ManaReso.Get("Fe_Info").TweenBacCG();
                 }
             );
         }
-        else if (ItemStatus == SkillStatus.Use)
-        {
-
-        }
         else if (ItemStatus == SkillStatus.Lock)
         {
             ManaReso.SetText("Fe_Lab0", "");
-            ManaReso.SetText("Fe_Lab1", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", Description(0));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2})", Language.GetStr("UI", "Fe_BtnLab0"), UnlockAheadCur, UnlockAheadAmt));
 
             ManaReso.SetButtonEvent
@@ -355,6 +410,7 @@ public class Skill : SkillRoot
                 () =>
                 {
                     UnlockAhead();
+
                     ManaReso.Get("Fe_Info").TweenBacCG();
                 }
             );
@@ -362,7 +418,7 @@ public class Skill : SkillRoot
         else if (ItemStatus == SkillStatus.UnLock)
         {
             ManaReso.SetText("Fe_Lab0", "");
-            ManaReso.SetText("Fe_Lab1", GetDescription(0));
+            ManaReso.SetText("Fe_Lab1", Description(0));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2})", Language.GetStr("UI", "Fe_BtnLab1"), UnlockCur, UnlockAmt));
 
             ManaReso.SetButtonEvent
@@ -371,14 +427,15 @@ public class Skill : SkillRoot
                 () =>
                 {
                     Unlock();
+
                     ManaReso.Get("Fe_Info").TweenBacCG();
                 }
             );
         }
         else if (ItemStatus == SkillStatus.Upgrade)
         {
-            ManaReso.SetText("Fe_Lab0", GetDescription(0));
-            ManaReso.SetText("Fe_Lab1", GetDescription(1));
+            ManaReso.SetText("Fe_Lab0", Description(0));
+            ManaReso.SetText("Fe_Lab1", Description(1));
             ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), UpgradeCur, NewUpgradeAmt));
 
             ManaReso.SetButtonEvent
@@ -390,52 +447,76 @@ public class Skill : SkillRoot
                 }
             );
         }
+        else if (ItemStatus == SkillStatus.Use)
+        {
+
+        }
         else
         {
             throw new Exception();
         }
     }
 
-    protected virtual void Upgrade()
+    protected void UsePerma()
     {
-        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
+        ManaData.SkillPlus += NewPlus;
+        ManaData.SkillPerson += NewPerson;
+        ManaData.SkillPersonBuff += NewPersonBuff;
+        ManaData.SkillCoinPerson += NewCoinPerson;
+
+        if (Math.Abs(NewSkillCD) > 0.0005f)
         {
-            Level++;
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(NewSkillCD, true, false);
+            }
+        }
 
-            NewUpgradeAmt = FmlParse(UpgradeFml, NewUpgradeAmt);
+        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
+        {
+            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            {
+                ManaData.SkillList[i].ReceiveCool(NewSkillCdBuff, true, true);
+            }
+        }
+    }
 
-            UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
-            UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
-            UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
-            UpgradeValue(ref NewCoinOnceBuff, UpgradeCoinOnce, 1);
+    protected void UseImmed()
+    {
+        ManaData.Coin += NewCoinOnce;
+        ManaData.Coin += ManaData.CoinPerson * NewCoinOnceBuff;
+        ManaData.Diamond += DiamondOnce;
+    }
 
-            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);
+    protected void UpgradeValue(ref float target, float baseValue, string fml, int offset)
+    {
+        if (Math.Abs(target) < 0.0005f)
+        {
+            return;
+        }
 
-            ItemLab.text = GetDescription(0);
-            ManaReso.SetText("Fe_Lab0", GetDescription(0));
-            ManaReso.SetText("Fe_Lab1", GetDescription(1));
-            ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), UpgradeCur, NewUpgradeAmt));
+        if (string.IsNullOrEmpty(fml))
+        {
 
-            ManaLog.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
+        }
+        else if (fml.Contains("%"))
+        {
+            float step = float.Parse(fml.Replace("%", "")) / 100;
 
-            if (ItemStatus == SkillStatus.Use) //更新技能效果
-            {
-                Annul();
-                Effect();
-            }
+            target += baseValue * step * offset;
+        }
+        else
+        {
+            target += float.Parse(fml) * offset;
         }
     }
 
-    protected virtual void Use()
+
+    protected virtual void Buy()
     {
         if (ManaData.Pay(UseAmt, UseCur))
         {
-            CoolTimer = CD * (1 + CdBuff);
-            UsingTimer = NewDuration;
+            UseTimer = NewDuration;
 
             if (Math.Abs(Duration) < 0.0005f)
             {
@@ -444,13 +525,14 @@ public class Skill : SkillRoot
             else
             {
                 ItemStatus = SkillStatus.Use;
-                ItemBtnLab.color = new Color(38/255f, 155/255f, 1, 1);
+
+                ItemBtnLab.color = Color.blue;
             }
 
-            Effect();
-            EffectOnce();
+            UsePerma();
+            UseImmed();
 
-            #region 调试输出
+            #region 调试
 
             StringBuilder strb = new StringBuilder();
 
@@ -510,7 +592,7 @@ public class Skill : SkillRoot
                 strb.Append(" <color=red>永久有效</color>");
             }
 
-            ManaLog.Log(strb.ToString());
+            ManaDebug.Log(strb.ToString());
 
             #endregion
         }
@@ -520,11 +602,11 @@ public class Skill : SkillRoot
     {
         if (ManaData.Pay(UnlockAmt, UnlockCur))
         {
-            if (UseCur != Current.Free) //使用类型
+            if (UseCur != Current.Free)
             {
                 ItemStatus = SkillStatus.Buy;
             }
-            else if (UpgradeCur != Current.Free) //升级类型
+            else if (UpgradeCur != Current.Free)
             {
                 ItemStatus = SkillStatus.Upgrade;
             }
@@ -533,150 +615,80 @@ public class Skill : SkillRoot
                 throw new Exception();
             }
 
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
         }
     }
 
-    protected virtual void UnlockAhead()
-    {
-        if (ItemStatus != SkillStatus.Lock)
-        {
-            ManaLog.Log("您并不需要提前解锁");
-
-            return;
-        }
-
-        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
-        {
-            if (UseCur != Current.Free) //使用类型
-            {
-                ItemStatus = SkillStatus.Buy;
-            }
-            else if (UpgradeCur != Current.Free) //升级类型
-            {
-                ItemStatus = SkillStatus.Upgrade;
-            }
-            else
-            {
-                throw new Exception();
-            }
-
-            ManaLog.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
-        }
-    }
-
-
-    protected void UpgradeValue(ref float target, float baseValue, string fml, int offset)
+    protected virtual void Upgrade()
     {
-        if (Math.Abs(target) < 0.0005f)
-        {
-            return;
-        }
-
-        if (string.IsNullOrEmpty(fml))
+        if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
         {
+            Level++;
 
-        }
-        else if (fml.Contains("%"))
-        {
-            float step = float.Parse(fml.Replace("%", "")) / 100;
+            NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
 
-            target += baseValue * step * offset;
-        }
-        else
-        {
-            target += float.Parse(fml) * offset;
-        }
-    }
+            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);
 
-    public override void Annul() //注销技能
-    {
-        ItemBtnLab.color = new Color(1, 1, 1, 1);
-        ItemStatus = SkillStatus.Cool;
+            ItemLab.text = Description(0);
+            ManaReso.SetText("Fe_Lab0", Description(0));
+            ManaReso.SetText("Fe_Lab1", Description(1));
+            ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), UpgradeCur, NewUpgradeAmt));
 
-        ManaData.SkillPlus -= NewPlus;
-        ManaData.SkillPerson -= NewPerson;
-        ManaData.SkillPersonBuff -= NewPersonBuff;
-        ManaData.SkillCoinPerson -= NewCoinPerson;
+            ManaDebug.Log(string.Format("<color=red>{0}</color>升级 : {1}", Name, Level));
 
-        if (Math.Abs(NewSkillCD) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            if (ItemStatus == SkillStatus.Use)
             {
-                ManaData.SkillList[i].ReceiveCool(-NewSkillCD, true, false);
-            }
-        }
+                Annul();
 
-        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
-            {
-                ManaData.SkillList[i].ReceiveCool(-NewSkillCdBuff, true, true);
+                UsePerma();
             }
         }
-
-        ManaLog.Log(string.Format("技能结束 <color=red>{0}</color>", Name));
     }
 
-    public override bool DoUse()
+    protected virtual void UnlockAhead()
     {
-        UsingTimer -= Time.deltaTime;
-
-        ItemLab.text = UsingTimer.ToString("0.0");
-
-        if (UsingTimer <= 0)
+        if (ItemStatus != SkillStatus.Lock)
         {
-            Annul();
-
-            ManaData.UsingList.Remove(this);
+            ManaDebug.Log("您并不需要提前解锁");
 
-            return true;
-        }
-        else
-        {
-            return false;
+            return;
         }
-    }
-
-    protected void Effect()
-    {
-        ManaData.SkillPerson += NewPerson;
-        ManaData.SkillPlus += NewPlus;
-        ManaData.SkillPersonBuff += NewPersonBuff;
-        ManaData.SkillCoinPerson += NewCoinPerson;
 
-        if (Math.Abs(NewSkillCD) > 0.0005f)
+        if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
         {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            if (UseCur != Current.Free)
             {
-                ManaData.SkillList[i].ReceiveCool(NewSkillCD, true, false);
+                ItemStatus = SkillStatus.Buy;
             }
-        }
-
-        if (Math.Abs(NewSkillCdBuff) > 0.0005f)
-        {
-            for (int i = 0; i < ManaData.SkillList.Count; i++)
+            else if (UpgradeCur != Current.Free)
             {
-                ManaData.SkillList[i].ReceiveCool(NewSkillCdBuff, true, true);
+                ItemStatus = SkillStatus.Upgrade;
+            }
+            else
+            {
+                throw new Exception();
             }
-        }
-    }
 
-    protected void EffectOnce()
-    {
-        ManaData.Coin += NewCoinOnce;
-        ManaData.Coin += ManaData.Person * ManaData.CoinPerson * ManaData.CircleTime * NewCoinOnceBuff;
-        ManaData.Diamond += DiamondOnce;
+            ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
+        }
     }
 
     #region 解读器
 
-    protected string GetDescription(int offset)
+    protected string Description(int offset)
     {
         float temp;
         string[] strings = Desc.Split('[', ']');
-
+        
         StringBuilder stringBuilder = new StringBuilder();
 
         for (int i = 0; i < strings.Length; i++)
@@ -745,7 +757,7 @@ public class Skill : SkillRoot
                     
                     UpgradeValue(ref temp, CoinOnceBuff, UpgradeCoinOnce, offset);
 
-                    stringBuilder.Append(temp + "倍");
+                    stringBuilder.Append(temp);
                 }
                 else
                 {
@@ -796,14 +808,14 @@ public class Skill : SkillRoot
         }
 
         return stringBuilder.ToString();
-    } //得到说明
+    }
 
 
     protected double UpgradeAmtParse(string str)
     {
         if (string.IsNullOrEmpty(str))
         {
-            return UnlockAmt; //Sa
+            return UnlockAmt;
         }
         else
         {

+ 37 - 178
Assets/Script/Object/Skill/SkillRoot.cs

@@ -15,14 +15,6 @@ public enum Current
     Diamond,
 }
 
-public enum SkillType
-{
-    Skill,
-    Pack,
-    Ability,
-    BigSkill,
-}
-
 public enum SkillTab
 {
     Elf,
@@ -32,6 +24,14 @@ public enum SkillTab
     Garden,
 }
 
+public enum SkillType
+{
+    Skill,
+    Pack,
+    Ability,
+    BigSkill,
+}
+
 public enum SkillStatus
 {
     Buy,
@@ -52,7 +52,6 @@ public abstract class SkillRoot
     public int ClassID;
     public string Icon;
     public string Name;
-    public SkillTab Tab;
 
     #endregion
 
@@ -62,15 +61,16 @@ public abstract class SkillRoot
     public Text ItemBtnLab;
     public Image ItemIcon;
     public Button ItemBtn;
+    public SkillTab SkillTab;
     public SkillType SkillType;
+    public Transform SkillItem;
 
-    public abstract bool DoUse();
-    public abstract void RegistValue(double elapse, List<List<SkillRoot>> ffList);
-    public abstract void OnLevelChange();
+    public abstract void RegistValue(float elapse, List<List<SkillRoot>> ffList);
+    public abstract void UpdateStatus();
 
     #endregion
 
-    public static int SortByClassID(SkillRoot skillRootA, SkillRoot skillRootB)
+    public static int Sort(SkillRoot skillRootA, SkillRoot skillRootB)
     {
         if (skillRootA.ClassID == skillRootB.ClassID)
         {
@@ -90,160 +90,46 @@ public abstract class SkillRoot
         }
     }
 
-    public static int SortByTimer(SkillRoot skillRootA, SkillRoot skillRootB)
-    {
-        Skill skillA = (Skill) skillRootA;
-        Skill skillB = (Skill) skillRootB;
-
-        if (skillA == null || skillB == null)
-        {
-            return 0;
-        }
-
-        if (Math.Abs(skillA.UsingTimer - skillB.UsingTimer) < 0.0005f)
-        {
-            return 0;
-        }
-        else if (skillA.UsingTimer > skillB.UsingTimer)
-        {
-            return 1;
-        }
-        else if (skillA.UsingTimer < skillB.UsingTimer)
-        {
-            return -1;
-        }
-        else
-        {
-            throw new Exception();
-        }
-    }
-
 
     public virtual void Annul()
     {
 
     }
 
-    public virtual void ReceiveCool(float amt, bool isCurrent, bool isBuff)
+    public virtual bool DoUse()
     {
-        
+        return true;
     }
 
-    public virtual void FastForward(List<List<SkillRoot>> ffList, float time, int index)
+    public virtual void ReceiveCool(float amt, bool current, bool buff)
     {
         
     }
 
     public virtual void RegistReference()
     {
-        
-    }
-
-    #region 解读器
-
-    private string Calculate1(string str)
-    {
-        int index = 0;
-        int openIndex = 0;
-        bool flag = false;
-        bool group = false;
-
-        for (int i = 0; i < str.Length; i++)
+        if (SkillItem == null)
         {
-            if (group)
-            {
-                if (str[i] == '+' || str[i] == '-' || str[i] == '*' || str[i] == '/')
-                {
-                    str = str.Replace(openIndex, i - 1, Calculate2(str[index], str.Between(openIndex, index - 1), str.Between(index + 1, i - 1)));
-
-                    i = 0;
-                    group = false;
-                }
-                else if (i == str.Length - 1)
-                {
-                    str = str.Replace(openIndex, i, Calculate2(str[index], str.Between(openIndex, index - 1), str.Between(index + 1, i)));
-
-                    break;
-                }
-            }
-            else
-            {
-                if (str[i] == '+' || str[i] == '-')
-                {
-                    flag = true;
-                    openIndex = i + 1;
-                }
-                else if (str[i] == '*' || str[i] == '/')
-                {
-                    index = i;
-                    group = true;
-
-                    if (!flag)
-                    {
-                        openIndex = 0;
-                    }
-                }
-            }
+            return;
         }
 
-        group = false;
+        Dictionary<string, Transform> childDic = new Dictionary<string, Transform>();
 
-        for (int i = 0; i < str.Length; i++)
-        {
-            if (group)
-            {
-                if (str[i] == '+' || str[i] == '-')
-                {
-                    str = str.Replace(0, i - 1, Calculate2(str[index], str.Between(0, index - 1), str.Between(index + 1, i - 1)));
-
-                    i = -1;
-                    group = false;
-                }
-                else if (i == str.Length - 1)
-                {
-                    return Calculate2(str[index], str.Between(0, index - 1), str.Between(index + 1, i));
-                }
-            }
-            else
-            {
-                if (str[i] == '+' || str[i] == '-')
-                {
-                    index = i;
-                    group = true;
-                }
-            }
-        }
+        Auxiliary.CompileDic(SkillItem, childDic);
 
-        return str;
-    }
-
-    private string Calculate2(char operatorR, string str1, string str2)
-    {
-        double var1 = double.Parse(str1);
-        double var2 = double.Parse(str2);
+        ItemTit = childDic["Tit"].GetComponent<Text>();
+        ItemBtn = childDic["Btn"].GetComponent<Button>();
+        ItemLab = childDic["Lab"].GetComponent<Text>();
+        ItemIcon = childDic["Icon"].GetComponent<Image>();
+        ItemBtnLab = childDic["BtnLab"].GetComponent<Text>();
 
-        if (operatorR == '+')
+        if (!string.IsNullOrEmpty(Icon))
         {
-            return (var1 + var2).ToString();
-        }
-        else if (operatorR == '-')
-        {
-            return (var1 - var2).ToString();
-        }
-        else if (operatorR == '*')
-        {
-            return (var1 * var2).ToString();
-        }
-        else if (operatorR == '/')
-        {
-            return (var1 / var2).ToString();
-        }
-        else
-        {
-            throw new Exception(operatorR.ToString());
+            ItemIcon.sprite = ManaReso.Load<Sprite>(Icon, Folder.Skill);
         }
     }
 
+    #region 解读器
 
     protected int IntParse(string str)
     {
@@ -257,54 +143,27 @@ public abstract class SkillRoot
         }
     }
 
-    protected float FloatParse(string str)
+    protected bool BoolParse(string str)
     {
         if (string.IsNullOrEmpty(str))
         {
-            return 0;
+            return false;
         }
         else
         {
-            return float.Parse(str);
-        }
-    }
-
-    protected double FmlParse(string str, params double[] vars)
-    {
-        for (int i = 0; i < vars.Length; i++)
-        {
-            str = str.Replace(((char) (97 + i)).ToString(), vars[i].ToString());
-        }
-
-        int openIndex = 0;
-
-        for (int i = 0; i < str.Length; i++)
-        {
-            if (str[i] == '(')
-            {
-                openIndex = i;
-            }
-            else if (str[i] == ')')
-            {
-                str = str.Replace(openIndex, i, Calculate1(str.Between(openIndex + 1, i - 1)));
-
-                i = -1;
-            }
+            return Convert.ToBoolean(int.Parse(str));
         }
-
-        return double.Parse(Calculate1(str));
     }
 
-
-    protected bool BoolParse(string str)
+    protected float FloatParse(string str)
     {
         if (string.IsNullOrEmpty(str))
         {
-            return false;
+            return 0;
         }
         else
         {
-            return Convert.ToBoolean(int.Parse(str));
+            return float.Parse(str);
         }
     }
 
@@ -389,7 +248,7 @@ public abstract class SkillRoot
         {
             target /= float.Parse(fml.Split('/')[1]);
         }
-    } //进行单位换算
+    }
 
     protected void UpgradeValue(ref float target, string fml, int offet)
     {
@@ -410,14 +269,14 @@ public abstract class SkillRoot
 
     protected void ValueBuffParse(out float value, out float buff, string str)
     {
-        if (str.Contains("%")) //比例加成
+        if (str.Contains("%"))
         {
             float step = float.Parse(str.Replace("%", "")) / 100;
 
             buff = step;
             value = 0;
         }
-        else //数值加成
+        else
         {
             buff = 0;
             value = FloatParse(str);

+ 140 - 13
Assets/Script/Tool/Auxiliary.cs

@@ -53,6 +53,8 @@ public class Auxiliary : MonoBehaviour
 
     private void Update()
     {
+        #region 输入检测
+
         if (AnyKeyUp)
         {
             if (Input.anyKey == false)
@@ -75,9 +77,13 @@ public class Auxiliary : MonoBehaviour
             }
         }
 
+        #endregion
+
+        #region 调试
+
         if (Input.GetKeyDown(KeyCode.P))
         {
-            ManaData.Level += 10;
+            ManaData.Level += 20;
         }
 
         if (Input.GetKeyDown(KeyCode.O))
@@ -106,19 +112,10 @@ public class Auxiliary : MonoBehaviour
 
         if (Input.GetKeyDown(KeyCode.T))
         {
-            if (Math.Abs(Time.timeScale) < 0.0005f)
-            {
-                Time.timeScale = 1;
-
-                ManaLog.Log("<color=red>游戏已恢复</color>");
-            }
-            else
-            {
-                Time.timeScale = 0;
-
-                ManaLog.Log("<color=red>游戏已暂停</color>");
-            }
+            ManaData.Pause = !ManaData.Pause;
         }
+
+        #endregion
     }
 
 
@@ -219,4 +216,134 @@ public class Auxiliary : MonoBehaviour
 
         function.Invoke();
     }
+
+
+    private static string FmlParse1(string str)
+    {
+        int index = 0;
+        int openIndex = 0;
+        bool flag = false;
+        bool group = false;
+
+        for (int i = 0; i < str.Length; i++)
+        {
+            if (group)
+            {
+                if (str[i] == '+' || str[i] == '-' || str[i] == '*' || str[i] == '/')
+                {
+                    str = str.Replace(openIndex, i - 1, FmlParse2(str[index], str.Between(openIndex, index - 1), str.Between(index + 1, i - 1)));
+
+                    i = 0;
+                    group = false;
+                }
+                else if (i == str.Length - 1)
+                {
+                    str = str.Replace(openIndex, i, FmlParse2(str[index], str.Between(openIndex, index - 1), str.Between(index + 1, i)));
+
+                    break;
+                }
+            }
+            else
+            {
+                if (str[i] == '+' || str[i] == '-')
+                {
+                    flag = true;
+                    openIndex = i + 1;
+                }
+                else if (str[i] == '*' || str[i] == '/')
+                {
+                    index = i;
+                    group = true;
+
+                    if (!flag)
+                    {
+                        openIndex = 0;
+                    }
+                }
+            }
+        }
+
+        group = false;
+
+        for (int i = 0; i < str.Length; i++)
+        {
+            if (group)
+            {
+                if (str[i] == '+' || str[i] == '-')
+                {
+                    str = str.Replace(0, i - 1, FmlParse2(str[index], str.Between(0, index - 1), str.Between(index + 1, i - 1)));
+
+                    i = -1;
+                    group = false;
+                }
+                else if (i == str.Length - 1)
+                {
+                    return FmlParse2(str[index], str.Between(0, index - 1), str.Between(index + 1, i));
+                }
+            }
+            else
+            {
+                if (str[i] == '+' || str[i] == '-')
+                {
+                    index = i;
+                    group = true;
+                }
+            }
+        }
+
+        return str;
+    }
+
+    private static string FmlParse2(char op, string str1, string str2)
+    {
+        double var1 = double.Parse(str1);
+        double var2 = double.Parse(str2);
+
+        if (op == '+')
+        {
+            return (var1 + var2).ToString();
+        }
+        else if (op == '-')
+        {
+            return (var1 - var2).ToString();
+        }
+        else if (op == '*')
+        {
+            return (var1 * var2).ToString();
+        }
+        else if (op == '/')
+        {
+            return (var1 / var2).ToString();
+        }
+        else
+        {
+            throw new Exception(op.ToString());
+        }
+    }
+
+    public static double FmlParse(string str, params string[] strings)
+    {
+        for (int i = 0; i < strings.Length; i += 2)
+        {
+            str = str.Replace(strings[i], strings[i + 1]);
+        }
+
+        int openIndex = 0;
+
+        for (int i = 0; i < str.Length; i++)
+        {
+            if (str[i] == '(')
+            {
+                openIndex = i;
+            }
+            else if (str[i] == ')')
+            {
+                str = str.Replace(openIndex, i, FmlParse1(str.Between(openIndex + 1, i - 1)));
+
+                i = -1;
+            }
+        }
+
+        return double.Parse(FmlParse1(str));
+    }
 }

+ 19 - 6
Assets/Script/Tool/Data.cs

@@ -76,7 +76,7 @@ public class Data
                 xmlAttribute.Value = skill.CoolTimer.ToString();
 
                 xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("EffectTimer"));
-                xmlAttribute.Value = skill.UsingTimer.ToString();
+                xmlAttribute.Value = skill.UseTimer.ToString();
 
                 xmlNode = PlayerNode.SelectSingleNode("SkillList");
 
@@ -151,7 +151,7 @@ public class Data
                 xmlAttribute.Value = bigSkill.CoolTimer.ToString();
 
                 xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("EffectTimer"));
-                xmlAttribute.Value = bigSkill.UsingTimer.ToString();
+                xmlAttribute.Value = bigSkill.UseTimer.ToString();
 
                 xmlNode = PlayerNode.SelectSingleNode("SkillList");
 
@@ -169,7 +169,7 @@ public class Data
 
         for (int i = 0; i < ManaGarden.PlantList.Count; i++)
         {
-            attributes.Append(PlayerDoc.CreateAttribute(ManaGarden.PlantList[i].PosTra.name));
+            attributes.Append(PlayerDoc.CreateAttribute(ManaGarden.PlantList[i].ParTra.name));
             attributes[i].Value = ManaGarden.PlantList[i].Id.ToString();
         }
 
@@ -197,7 +197,7 @@ public class Data
 
         XmlAttribute xmlAttribute = attributes.Append(PlayerDoc.CreateAttribute("ID"));
         
-        foreach (var kv in ManaGarden.FlowerDic)
+        foreach (var kv in ManaGarden.FlowerInfoDic)
         {
             if (kv.Value.Unlock)
             {
@@ -205,7 +205,8 @@ public class Data
             }
         }
 
-        xmlAttribute.Value.Trim(' ');
+        xmlAttribute.Value = xmlAttribute.Value.Trim(' ');
+
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
     }
 
@@ -389,7 +390,7 @@ public class Data
         attributes[0].RemoveAll();
 
         XmlAttribute xmlAttribute = attributes.Append(PlayerDoc.CreateAttribute("ID"));
-        xmlAttribute.Value = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20";
+        xmlAttribute.Value = "1 2 3 4 5 6 7 8 9 10";
 
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
     }
@@ -405,6 +406,18 @@ public class Data
     }
 
 
+    public static XmlAttributeCollection GetMiniGameConfig()
+    {
+        TextAsset textAsset;
+        XmlDocument xmlDoc = new XmlDocument();
+
+        textAsset = (TextAsset)Resources.Load(@"XML\Config\minigame_config");
+        xmlDoc.LoadXml(textAsset.text);
+        XmlNode xmlNode = xmlDoc.SelectSingleNode("data").SelectSingleNode("item");
+
+        return xmlNode.Attributes;
+    }
+
     public static List<XmlAttributeCollection> GetSignConfig()
     {
         TextAsset textAsset;

+ 0 - 24
Assets/Script/Tool/ExcelExport.cs

@@ -1,24 +0,0 @@
-using UnityEngine;
-
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-
-public class ExcelExport : MonoBehaviour
-{
-	#region 变量
-
-    
-
-    #endregion
-
-	private void Awake()
-	{
-	    
-	}
-	
-	private void FixedUpdate()
-    {
-		
-	}
-}

+ 0 - 12
Assets/Script/Tool/ExcelExport.cs.meta

@@ -1,12 +0,0 @@
-fileFormatVersion: 2
-guid: 63c174b897055aa4b8766d44dd322b85
-timeCreated: 1490160947
-licenseType: Pro
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 19 - 0
Assets/Script/Tool/Extension.cs

@@ -100,6 +100,25 @@ public static class Extension
 
     #endregion
 
+    #region Regist
+
+    public static void AddScript<T>(this Component comp)
+    {
+        AddScript<T>(comp.gameObject);
+    }
+
+    public static void AddScript<T>(this GameObject go)
+    {
+        Component comp = go.AddComponent(typeof(T));
+
+        if (comp is Regist)
+        {
+            Initializer.RegistList.Add((Regist) comp);
+        }
+    }
+
+    #endregion
+
     #region String
 
     public static string Replace(this string str, int startIndex, int endIndex, string newStr)

+ 1 - 2
Assets/Script/Tool/SpriteAsset.cs

@@ -1,5 +1,4 @@
-using UnityEditor;
-using UnityEngine;
+using UnityEngine;
 
 using System;
 using System.Collections;

+ 1 - 1
Assets/Script/Tool/UI/FlowerCard.cs

@@ -52,7 +52,7 @@ public class FlowerCard : MonoBehaviour
 
     public void Add(FlowerInfo flowerInfo)
     {
-        Transform tra = ManaReso.GetFlowerCardItem();
+        Transform tra = ManaReso.GetFlowerItemH();
 
         tra.CreateTweenScale(new Vector3(1, 1, 1), new Vector3(1.25f, 1.25f, 1), 0.25f, true, true, Curve.EaseOutQuad);
         

BIN
Assets/XlsxSource/ability_config.xlsx


BIN
Assets/XlsxSource/language_config.xlsx


BIN
Assets/XlsxSource/minigame_config.xlsx


+ 3 - 3
Assets/Resources/Prefab/PrefabUI/AwardItem.prefab.meta → Assets/XlsxSource/minigame_config.xlsx.meta

@@ -1,8 +1,8 @@
 fileFormatVersion: 2
-guid: 63aedf1e71ba0ae419cd55ae1dde1241
-timeCreated: 1489664129
+guid: 8fec33850f74bfc4d915f280e76d2cda
+timeCreated: 1490249265
 licenseType: Pro
-NativeFormatImporter:
+DefaultImporter:
   userData: 
   assetBundleName: 
   assetBundleVariant: 

BIN
Assets/XlsxSource/skill_config.xlsx


+ 4 - 0
MyLovelyGarden.Editor.csproj

@@ -161,9 +161,13 @@
     <None Include="Assets\Resources\XML\Config\PlayerConfig.xml" />
     <None Include="Assets\Resources\XML\Config\ability_config.xml" />
     <None Include="Assets\Resources\XML\Config\flower_config.xml" />
+    <None Include="Assets\Resources\XML\Config\minigame_config.xml" />
+    <None Include="Assets\Resources\XML\Config\offline_config.xml" />
     <None Include="Assets\Resources\XML\Config\pack_config.xml" />
+    <None Include="Assets\Resources\XML\Config\signin_config.xml" />
     <None Include="Assets\Resources\XML\Config\skill_config.xml" />
     <None Include="Assets\Resources\XML\lan\ChineseSimplified.xml" />
+    <None Include="Assets\Resources\XML\lan\ChineseTraditional.xml" />
     <None Include="Assets\Resources\XML\lan\English.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 7 - 1
MyLovelyGarden.csproj

@@ -96,13 +96,14 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Assets\Script\Interface\Regist.cs" />
     <Compile Include="Assets\Script\Manage\Initializer.cs" />
     <Compile Include="Assets\Script\Manage\Main.cs" />
     <Compile Include="Assets\Script\Manage\ManaAnim.cs" />
     <Compile Include="Assets\Script\Manage\ManaAudio.cs" />
     <Compile Include="Assets\Script\Manage\ManaData.cs" />
+    <Compile Include="Assets\Script\Manage\ManaDebug.cs" />
     <Compile Include="Assets\Script\Manage\ManaGarden.cs" />
-    <Compile Include="Assets\Script\Manage\ManaLog.cs" />
     <Compile Include="Assets\Script\Manage\ManaMiniGame.cs" />
     <Compile Include="Assets\Script\Manage\ManaPlayer.cs" />
     <Compile Include="Assets\Script\Manage\ManaReso.cs" />
@@ -140,6 +141,7 @@
     <Compile Include="Assets\Script\Tool\UI\FlowerCard.cs" />
     <Compile Include="Assets\Script\Tool\UI\HudTarget.cs" />
     <Compile Include="Assets\Script\Tool\UI\HudText.cs" />
+    <Compile Include="Assets\Script\Tool\UI\ImagePlus.cs" />
     <Compile Include="Assets\Script\Tool\UI\ScrollRectPlus.cs" />
     <Compile Include="Assets\Script\Tool\UI\TextPlus.cs" />
     <Compile Include="Assets\Script\Utils\DGFileUtil.cs" />
@@ -153,9 +155,13 @@
     <None Include="Assets\Resources\XML\Config\PlayerConfig.xml" />
     <None Include="Assets\Resources\XML\Config\ability_config.xml" />
     <None Include="Assets\Resources\XML\Config\flower_config.xml" />
+    <None Include="Assets\Resources\XML\Config\minigame_config.xml" />
+    <None Include="Assets\Resources\XML\Config\offline_config.xml" />
     <None Include="Assets\Resources\XML\Config\pack_config.xml" />
+    <None Include="Assets\Resources\XML\Config\signin_config.xml" />
     <None Include="Assets\Resources\XML\Config\skill_config.xml" />
     <None Include="Assets\Resources\XML\lan\ChineseSimplified.xml" />
+    <None Include="Assets\Resources\XML\lan\ChineseTraditional.xml" />
     <None Include="Assets\Resources\XML\lan\English.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 13 - 16
MyLovelyGarden.sln

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

+ 7 - 5
MyLovelyGarden.txt

@@ -1,14 +1,16 @@
-共享一个动画
+技能使用时间处在边缘时有Bug
 
-RegistValue开分支
+图文混排
 
-图文混排(图文混排的优化)
+Tab的Shader
 
-语言工具(Prefab到Excel,Excel转XML,读XML)
+G_Flower的性能
 
-Ability中的说明使用coin_person Skill中少了一个倍字
+进行到Skill
 
 
+字体
+
 Anchor
 
 使用加密

BIN
ProjectSettings/GraphicsSettings.asset