LiuQilin 8 năm trước cách đây
mục cha
commit
464e2f800a

BIN
.vs/MyLovelyGarden/v14/.suo


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


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


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

@@ -1,32 +1,32 @@
 <PlayerConfig>
-  <Coin value="0" />
-  <Level value="0" />
+  <Coin value="114" />
+  <Level value="10" />
   <Person value="1" />
   <Diamond value="0" />
-  <QuitTime value="3/17/2017 3:30:22 AM" />
+  <QuitTime value="3/17/2017 6:23:20 PM" />
   <CoinPerson value="1" />
-  <CircleTimer value="0" />
+  <CircleTimer value="9.6021184772253" />
   <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" />
+  <FlowerList ID="1 2 3 4 5 6 7 8 9 " />
   <SkillList>
-    <免费获取金币 SkillCato="Skill" ItemStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
-    <免费获取钻石 SkillCato="Skill" ItemStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
-    <技能冷却 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <免费获取金币 SkillCato="Skill" ItemStatus="Buy" Level="0" CdTimer="-2" EffectTimer="-2" />
+    <免费获取钻石 SkillCato="Skill" ItemStatus="Buy" Level="0" CdTimer="-2" EffectTimer="-2" />
+    <技能冷却 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="-2" EffectTimer="-2" />
     <花园 SkillCato="Ability" ItemStatus="Upgrade" Level="0" />
-    <繁花似锦 SkillCato="Skill" ItemStatus="Lock" Level="0" CdTimer="0" EffectTimer="0" />
+    <繁花似锦 SkillCato="Skill" ItemStatus="Lock" Level="0" CdTimer="-2" EffectTimer="-2" />
     <黄色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <人潮涌动 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <人潮涌动 SkillCato="BigSkill" ItemStatus="Upgrade" BarStatus="Use" Level="0" CdTimer="1800" EffectTimer="290.662469377741" />
     <紫色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <礼包 SkillCato="Pack" Name="金币大礼包" ItemStatus="Buy" Level="0" />
     <礼包 SkillCato="Pack" Name="新手礼包" ItemStatus="Lock" Level="0" />
-    <大亨光临 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <大亨光临 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="-2" EffectTimer="-2" />
     <礼包 SkillCato="Pack" Name="天赐大礼包" ItemStatus="Buy" Level="0" />
     <礼包 SkillCato="Pack" Name="中级礼包" ItemStatus="Buy" Level="0" />
     <蓝色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <礼包 SkillCato="Pack" Name="高级礼包" ItemStatus="Buy" Level="0" />
     <礼包 SkillCato="Pack" Name="花神大礼包" ItemStatus="Buy" Level="0" />
     <红色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <花之祝福 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="0" EffectTimer="0" />
+    <花之祝福 SkillCato="BigSkill" ItemStatus="Lock" BarStatus="Buy" Level="0" CdTimer="-2" EffectTimer="-2" />
     <白色小蜜蜂 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <炼金石 SkillCato="Ability" ItemStatus="Lock" Level="0" />
     <礼包 SkillCato="Pack" Name="钻石100" ItemStatus="Buy" Level="0" />
@@ -37,9 +37,9 @@
     <礼包 SkillCato="Pack" Name="钻石2000 赠送500" ItemStatus="Buy" Level="0" />
     <滴哩哩的小黄鹂 SkillCato="Ability" ItemStatus="Upgrade" Level="0" />
     <蓝色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石6000 赠送600" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石6000 赠送600" ItemStatus="Buy" Level="0" />
     <红色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
-    <礼包 SkillCato="Pack" Name="钻石10000 赠送2000" ItemStatus="Lock" Level="0" />
+    <礼包 SkillCato="Pack" Name="钻石10000 赠送2000" ItemStatus="Buy" Level="0" />
     <白色小蝴蝶 SkillCato="Ability" ItemStatus="Lock" Level="0" />
   </SkillList>
 </PlayerConfig>

+ 10 - 10
Assets/Script/Manage/ManaAnim.cs

@@ -30,13 +30,13 @@ public class ManaAnim : MonoBehaviour
     public static Dictionary<Curve, CurveFunctionC> FunctionDicC;
     public static Dictionary<Curve, CurveFunctionV> FunctionDicV;
 
-    private static Dictionary<Transform, MoveVec> MoveVecDic;
-    private static Dictionary<Transform, MoveScrr> MoveScrrDic;
+    public static Dictionary<Transform, MoveVec> MoveVecDic;
+    public static Dictionary<Transform, MoveScrr> MoveScrrDic;
 
-    private static Dictionary<Transform, TweenCG> TweenCgDic;
-    private static Dictionary<Transform, TweenVec> TweenVecDic;
-    private static Dictionary<Transform, TweenGra> TweenGraDic;
-    private static Dictionary<Transform, TweenScale> TweenScaleDic;
+    public static Dictionary<Transform, TweenCG> TweenCgDic;
+    public static Dictionary<Transform, TweenVec> TweenVecDic;
+    public static Dictionary<Transform, TweenGra> TweenGraDic;
+    public static Dictionary<Transform, TweenScale> TweenScaleDic;
 
     #endregion
 
@@ -256,7 +256,7 @@ public class ManaAnim : MonoBehaviour
         }
         else
         {
-            throw new Exception();
+            throw new Exception(target.name);
         }
     }
 
@@ -270,7 +270,7 @@ public class ManaAnim : MonoBehaviour
         }
         else
         {
-            throw new Exception();
+            throw new Exception(target.name);
         }
     }
 
@@ -590,13 +590,13 @@ public class ManaAnim : MonoBehaviour
         {
             TweenScale tween = TweenScaleDic[target];
 
-            tween = new TweenScale(target, target.localScale, destination, duration, originActive, destActive, curve);
+            tween = new TweenScale(target, target.lossyScale, destination, duration, originActive, destActive, curve);
 
             return tween;
         }
         else
         {
-            TweenScale tween = new TweenScale(target, target.localScale, destination, duration, originActive, destActive, curve);
+            TweenScale tween = new TweenScale(target, target.lossyScale, destination, duration, originActive, destActive, curve);
 
             TweenScaleDic.Add(target, tween);
 

+ 20 - 8
Assets/Script/Manage/ManaData.cs

@@ -138,7 +138,7 @@ public class ManaData : MonoBehaviour
             SkillList.Add(skillRoot);
             SkillDic.Add(skillRoot.Name, skillRoot);
         }
-
+        
         SkillList.Sort();
 
         #endregion
@@ -261,7 +261,7 @@ public class ManaData : MonoBehaviour
                 throw new Exception();
             }
         }
-
+        
         for (int i = 0; i < SkillList.Count; i++)
         {
             SkillList[i].Initialize();
@@ -273,14 +273,24 @@ public class ManaData : MonoBehaviour
 
         XmlAttributeCollection attributes = Data.PlayerNode.SelectSingleNode("FlowerList").Attributes;
 
-        string[] strings = attributes[0].Value.Split(' ');
-
-        for (int i = 0; i < strings.Length; i++)
+        if (!string.IsNullOrEmpty(attributes[0].Value))
         {
-            int id = int.Parse(strings[i]);
+            string[] strings = attributes[0].Value.Split(' ');
 
-            FlowerInfo flowerInfo = ManaGarden.FlowerDic[id];
-            flowerInfo.Unlock = true;
+            for (int i = 0; i < strings.Length; i++)
+            {
+                if (string.IsNullOrEmpty(strings[i]))
+                {
+                    continue;
+                }
+
+                int id = int.Parse(strings[i]);
+
+                FlowerInfo flowerInfo = ManaGarden.FlowerDic[id];
+                flowerInfo._Unlock = true;
+
+                SkillPlusPerm += 0.1f;
+            }
         }
 
         #endregion
@@ -330,6 +340,8 @@ public class ManaData : MonoBehaviour
         ManaReso.SetText("A_IconLab", OfflineCoin.ToString("0"));
         
         #endregion
+
+        Debug.Log(OfflineCoin);
     }
 
 

+ 1 - 0
Assets/Script/Manage/ManaMiniGame.cs

@@ -308,6 +308,7 @@ public class ManaMiniGame : MonoBehaviour
     public static void GamePrepare()
     {
         IdleList = new List<Flower>();
+        OpList = new List<Flower>();
         IdleList.Add(ManaReso.GetFlower(1, false, ManaReso.Get("FlowerGameTra1")));
         IdleList.Add(ManaReso.GetFlower(2, false, ManaReso.Get("FlowerGameTra2")));
         IdleList.Add(ManaReso.GetFlower(3, false, ManaReso.Get("FlowerGameTra3")));

+ 62 - 0
Assets/Script/Manage/ManaReso.cs

@@ -122,6 +122,38 @@ public class ManaReso : MonoBehaviour
         }
     }
 
+    public static void SaveUI<T>(T t) where T : Component
+    {
+        GameObject go = t.gameObject;
+
+        ObjRoot objRoot = go.GetComponent<ObjRoot>();
+
+        if (objRoot == null)
+        {
+            throw new Exception();
+        }
+
+        List<GameObject> goList;
+
+        if (ObjectPool.TryGetValue(objRoot.ObjType, out goList))
+        {
+            if (goList.Contains(go))
+            {
+                throw new Exception();
+            }
+
+            go.SetActive(false);
+
+            goList.Add(go);
+
+            go.transform.SetParent(Get("J_ObjPool"));
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
     public static void Save(GameObject go)
     {
         ObjRoot objRoot = go.GetComponent<ObjRoot>();
@@ -152,6 +184,36 @@ public class ManaReso : MonoBehaviour
         }
     }
 
+    public static void SaveUI(GameObject go)
+    {
+        ObjRoot objRoot = go.GetComponent<ObjRoot>();
+
+        if (objRoot == null)
+        {
+            throw new Exception();
+        }
+
+        List<GameObject> goList;
+
+        if (ObjectPool.TryGetValue(objRoot.ObjType, out goList))
+        {
+            if (goList.Contains(go))
+            {
+                throw new Exception();
+            }
+
+            go.SetActive(false);
+
+            goList.Add(go);
+
+            go.transform.SetParent(Get("J_ObjPool"));
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
 
     public static T Get<T>(ObjType objType)
     {

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

@@ -395,36 +395,48 @@ public class ManaUI : MonoBehaviour
 
         #endregion
 
-        #region Fg_Btn
+
+        #region Fe_Close
 
         ManaReso.AddButtonEvent
         (
-            "Fg_Btn",
+            "Fe_Close",
             () =>
             {
-                
+                ManaReso.Get("Fe_Info").TweenBacCG();
             }
         );
 
         #endregion
 
+        #region Fe_Info
+
+        ManaReso.Get("Fe_Info").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
+
+        #endregion
+
+        #region MyRegion
 
-        #region Fe_Close
+        ManaReso.Get("Fg_Reconnect").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
 
         ManaReso.AddButtonEvent
         (
-            "Fe_Close",
+            "Fg_Btn",
             () =>
             {
-                ManaReso.Get("Fe_Info").TweenBacCG();
+                ManaData.Connect = true;
+                ManaReso.Get("Fg_Reconnect").TweenBacCG();
             }
         );
 
-        #endregion
-
-        #region Fe_Info
-
-        ManaReso.Get("Fe_Info").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
+        ManaReso.AddButtonEvent
+        (
+            "Fg_Close",
+            () =>
+            {
+                ManaReso.Get("Fg_Reconnect").TweenBacCG();
+            }
+        );
 
         #endregion
 

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

@@ -59,6 +59,7 @@ public class FlowerInfo
                 ManaGarden.UpdateCollectStatus();
 
                 ManaData.SkillPlusPerm += 0.1f;
+                ManaLog.Log("解锁花朵 收入<color=red>+10%</color>");
             }
         }
     }

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

@@ -339,6 +339,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
                         () =>
                         {
                             flowerCard.Select(0);
+                            ManaReso.Get<ContentSizeFitter>("H_Grid").enabled = false;
                             ManaReso.Get<HorizontalLayoutGroup>("H_Grid").enabled = false;
                         },
                         1

+ 1 - 1
Assets/Script/Object/Hud/HudText.cs

@@ -34,7 +34,7 @@ public class HudText : ObjRoot
 
         if (Text.color.a <= 0.05f)
         {
-            ManaReso.Save(gameObject);
+            ManaReso.SaveUI(gameObject);
         }
     }
 

+ 13 - 6
Assets/Script/Object/Skill/Ability.cs

@@ -124,6 +124,10 @@ public class Ability : SkillRoot
 
     public override void Initialize()
     {
+        ItemTit.text = Name;
+        ItemLab.text = GetDescription(0);
+        ItemBtn.onClick.AddListener(OnClick);
+
         NewPlus = Plus;
         NewPerson = Person;
         NewSkillCD = SkillCD;
@@ -151,16 +155,12 @@ public class Ability : SkillRoot
             UpgradeValue(ref NewPerson, Person, UpgradePerson, Level);
             UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
             UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
-
-            ItemTit.text = Name;
-            ItemLab.text = GetDescription(0);
-            ItemBtn.onClick.AddListener(OnClick);
-
+            
             Effect();
         }
     }
 
-    public override void CollectCoin(int offlineCircle)
+    public override void CollectCoin(double elapse)
     {
 
     }
@@ -241,6 +241,13 @@ public class Ability : SkillRoot
 
     protected void OnClick()
     {
+        if (ManaData.Connect == false)
+        {
+            ManaReso.Get("Fg_Reconnect").TweenForCG();
+
+            return;
+        }
+
         ManaReso.Get("Fe_Info").TweenForCG();
         ManaReso.SetText("Fe_Tit", Name);
 

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

@@ -263,7 +263,7 @@ public class BigSkill : Skill
 
             ManaData.SkillBar = true;
 
-            if (ManaReso.Get("Fa_GardenTab").gameObject.activeSelf)
+            if (ManaReso.Get("Fa_Garden").gameObject.activeSelf)
             {
                 skillBar.SetActive(true);
             }
@@ -283,7 +283,7 @@ public class BigSkill : Skill
     {
         if (ManaData.Connect == false)
         {
-
+            ManaReso.Get("Fg_Reconnect").TweenForCG();
 
             return;
         }

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

@@ -108,7 +108,7 @@ public class Pack : SkillRoot
         }
     }
 
-    public override void CollectCoin(int offlineCircle)
+    public override void CollectCoin(double elapse)
     {
         
     }
@@ -140,6 +140,13 @@ public class Pack : SkillRoot
 
     protected void OnClick()
     {
+        if (ManaData.Connect == false)
+        {
+            ManaReso.Get("Fg_Reconnect").TweenForCG();
+
+            return;
+        }
+
         ManaReso.Get("Fe_Info").TweenForCG();
         ManaReso.SetText("Fe_Tit", Name);
 

+ 24 - 6
Assets/Script/Object/Skill/Skill.cs

@@ -210,13 +210,24 @@ public class Skill : SkillRoot
         }
     } //读取配置时调用
 
-    public override void CollectCoin(int offlineCircle)
+    public override void CollectCoin(double elapse)
     {
-        float newPerson = ManaData.Person * NewPersonBuff + NewPerson;
-        float newCoinPerson = ManaData.CoinPerson + NewCoinPerson;
-        double income = (newPerson * newCoinPerson * offlineCircle * ManaData.Circle ) * (1 + NewPlus + ManaData.SkillPlusPerm);
-
-        ManaData.OfflineCoin += income;
+        CoolTimer -= elapse;
+        UsingTimer -= elapse;
+        //if (elapse < UsingTimer)
+        //{
+        //    float newPerson = ManaData.Person * NewPersonBuff + NewPerson;
+        //    float newCoinPerson = ManaData.CoinPerson + NewCoinPerson;
+        //    double income = (newPerson * newCoinPerson * offlineCircle * ManaData.Circle) * (1 + NewPlus + ManaData.SkillPlusPerm);
+        //    ManaData.OfflineCoin += income;
+        //}
+        //else
+        //{
+        //    float newPerson = ManaData.Person * NewPersonBuff + NewPerson;
+        //    float newCoinPerson = ManaData.CoinPerson + NewCoinPerson;
+        //    double income = (newPerson * newCoinPerson * offlineCircle * ManaData.Circle) * (1 + NewPlus + ManaData.SkillPlusPerm);
+        //    ManaData.OfflineCoin += income;
+        //}
     }
 
     public virtual bool DoCool()
@@ -293,6 +304,13 @@ public class Skill : SkillRoot
 
     protected void OnClick()
     {
+        if (ManaData.Connect == false)
+        {
+            ManaReso.Get("Fg_Reconnect").TweenForCG();
+
+            return;
+        }
+
         ManaReso.Get("Fe_Info").TweenForCG();
         ManaReso.SetText("Fe_Tit", Name);
 

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

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

+ 2 - 0
Assets/Script/Tool/Anim/MoveScrr.cs

@@ -54,6 +54,7 @@ public class MoveScrr : Move
 
     public void StartMove(float destination, float duration, Curve curve)
     {
+        Timer = 0;
         Finish = false;
 
         Delta = destination - Target.horizontalNormalizedPosition;
@@ -68,6 +69,7 @@ public class MoveScrr : Move
             OnStart.Invoke();
         }
 
+        ManaAnim.MoveList.Remove(this);
         ManaAnim.MoveList.Add(this);
     }
 }

+ 6 - 8
Assets/Script/Tool/Anim/Tween.cs

@@ -6,8 +6,8 @@ using System.Collections;
 
 public abstract class Tween 
 {
-    public bool IsForwardFinish;
-    public bool IsBackwardFinish;
+    public bool ForwardFinish;
+    public bool BackwardFinish;
     public UnityAction OnForwardStart;
     public UnityAction OnForwardFinish;
     public UnityAction OnBackwardStart;
@@ -24,21 +24,19 @@ public abstract class Tween
 
     public virtual void StartForward()
     {
-        IsForwardFinish = false;
-        IsBackwardFinish = false;
+        ForwardFinish = false;
         OnForwardStart.Invoke();
 
         ManaAnim.TweenForList.Add(this);
-        //ManaAnim.TweenBacList.Remove(this);
+        ManaAnim.TweenBacList.Remove(this);
     }
 
     public virtual void StartBackward()
     {
-        IsForwardFinish = false;
-        IsBackwardFinish = false;
+        BackwardFinish = false;
         OnBackwardStart.Invoke();
 
         ManaAnim.TweenBacList.Add(this);
-        //ManaAnim.TweenForList.Remove(this);
+        ManaAnim.TweenForList.Remove(this);
     }
 }

+ 2 - 2
Assets/Script/Tool/Anim/TweenCG.cs

@@ -61,7 +61,7 @@ public class TweenCG : Tween
             Target.alpha = Destination;
 
             Timer = 0;
-            IsBackwardFinish = true;
+            BackwardFinish = true;
             OnForwardFinish.Invoke();
 
             ManaAnim.TweenForList.Remove(this);
@@ -84,7 +84,7 @@ public class TweenCG : Tween
             Target.alpha = Origin;
 
             Timer = 0;
-            IsForwardFinish = true;
+            ForwardFinish = true;
             OnBackwardFinish.Invoke();
 
             ManaAnim.TweenBacList.Remove(this);

+ 2 - 2
Assets/Script/Tool/Anim/TweenGra.cs

@@ -56,7 +56,7 @@ public class TweenGra : Tween
             Target.color = Destination;
 
             Timer = 0;
-            IsBackwardFinish = true;
+            BackwardFinish = true;
             OnForwardFinish.Invoke();
 
             ManaAnim.TweenForList.Remove(this);
@@ -79,7 +79,7 @@ public class TweenGra : Tween
             Target.color = Origin;
 
             Timer = 0;
-            IsForwardFinish = true;
+            ForwardFinish = true;
             OnBackwardFinish.Invoke();
 
             ManaAnim.TweenBacList.Remove(this);

+ 23 - 13
Assets/Script/Tool/Anim/TweenScale.cs

@@ -6,18 +6,22 @@ public class TweenScale : Tween
 {
     #region
 
-    protected Vector3 Delta;
-    protected Vector3 Origin;
-    protected Vector3 Destination;
-    protected Transform Target;
-    protected CanvasGroup CanvasGroup;
-    protected CurveFunctionV Func;
+    public Vector3 Delta;
+    public Vector3 Origin;
+    public Vector3 Destination;
+    public Transform Target;
+    public CanvasGroup CanvasGroup;
+    public CurveFunctionV Func;
 
     #endregion
 
     public TweenScale(Transform target, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve)
     {
         Target = target;
+
+        ForwardFinish = true;
+        BackwardFinish = true;
+
         Duration = duration;
         DestActive = destActive;
         OriginActive = originActive;
@@ -76,14 +80,20 @@ public class TweenScale : Tween
     {
         base.StartForward();
 
-        //Timer = (Target.localScale.x - Origin.x/Delta.x)*Duration;
+        if (!BackwardFinish)
+        {
+            Timer = Duration - Timer;
+        }
     }
 
     public override void StartBackward()
     {
-        base.StartForward();
+        base.StartBackward();
 
-        //Timer = (Target.localScale.x - Destination.x / Delta.x) * Duration;
+        if (!ForwardFinish)
+        {
+            Timer = Duration - Timer;
+        }
     }
 
     public override bool DoForward()
@@ -93,7 +103,7 @@ public class TweenScale : Tween
             Target.localScale = Destination;
 
             Timer = 0;
-            IsForwardFinish = true;
+            ForwardFinish = true;
             OnForwardFinish.Invoke();
 
             ManaAnim.TweenForList.Remove(this);
@@ -105,7 +115,7 @@ public class TweenScale : Tween
             Target.localScale = Func(Timer, Duration, Origin, Delta);
 
             Timer += Time.fixedDeltaTime;
-
+            
             return false;
         }
     }
@@ -117,7 +127,7 @@ public class TweenScale : Tween
             Target.localScale = Origin;
 
             Timer = 0;
-            IsBackwardFinish = true;
+            BackwardFinish = true;
             OnBackwardFinish.Invoke();
 
             ManaAnim.TweenBacList.Remove(this);
@@ -128,7 +138,7 @@ public class TweenScale : Tween
             Target.localScale = Func(Timer, Duration, Destination, -Delta);
 
             Timer += Time.fixedDeltaTime;
-
+            
             return false;
         }
     }

+ 2 - 2
Assets/Script/Tool/Anim/TweenVec.cs

@@ -80,7 +80,7 @@ public class TweenVec : Tween
             Target.position = Destination;
 
             Timer = 0;
-            IsForwardFinish = true;
+            ForwardFinish = true;
             OnForwardFinish.Invoke();
 
             ManaAnim.TweenForList.Remove(this);
@@ -104,7 +104,7 @@ public class TweenVec : Tween
             Target.position = Origin;
 
             Timer = 0;
-            IsBackwardFinish = true;
+            BackwardFinish = true;
             OnBackwardFinish.Invoke();
 
             ManaAnim.TweenBacList.Remove(this);

+ 1 - 1
Assets/Script/Tool/Auxiliary.cs

@@ -45,7 +45,7 @@ public class Auxiliary : MonoBehaviour
 
     private void Start()
     {
-
+        
     }
 
     

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

@@ -190,22 +190,20 @@ public class Data
 
     public static void SaveFlowerList()
     {
-        XmlNode xmlNode = PlayerNode.SelectSingleNode("FlowerList");
-        xmlNode.RemoveAll();
+        XmlAttributeCollection attributes = PlayerNode.SelectSingleNode("FlowerList").Attributes;
+        attributes[0].RemoveAll();
+
+        XmlAttribute xmlAttribute = attributes.Append(PlayerDoc.CreateAttribute("ID"));
 
         foreach (var kv in ManaGarden.FlowerDic)
         {
             if (kv.Value.Unlock)
             {
-                xmlNode = xmlNode.AppendChild(PlayerDoc.CreateNode(XmlNodeType.Element, "Flower", ""));
-
-                XmlAttribute xmlAttribute = xmlNode.Attributes.Append(PlayerDoc.CreateAttribute("Id"));
-                xmlAttribute.Value = kv.Value.Id.ToString();
-
-                xmlNode = PlayerNode.SelectSingleNode("FlowerList");
+                xmlAttribute.Value += kv.Key + " ";
             }
         }
 
+        xmlAttribute.Value.Trim(' ');
         PlayerDoc.Save(Application.dataPath + @"\Resources\XML\Config\PlayerConfig.xml");
     }
 

+ 23 - 1
Assets/Script/Tool/Extension.cs

@@ -7,6 +7,28 @@ using System.Collections.Generic;
 
 public static class Extension
 {
+    #region Scale
+
+    public static Vector3 GetScale(this Transform tra)
+    {
+        Vector3 scale = tra.localScale;
+
+        while (tra.parent != null)
+        {
+            float x = scale.x*tra.parent.localScale.x;
+            float y = scale.y*tra.parent.localScale.y;
+            float z = scale.z*tra.parent.localScale.z;
+
+            scale = new Vector3(x, y, z);
+
+            tra = tra.parent;
+        }
+
+        return scale;
+    }
+
+    #endregion
+
     #region Move
 
     public static void MoveVec(this Component comp, Vector3 destination, float duration, Curve curve)
@@ -14,7 +36,7 @@ public static class Extension
         ManaAnim.MoveVec(comp.transform, destination, duration, curve);
     }
 
-    public static void MoveScror(this Component comp, float destination, float duration, Curve curve)
+    public static void MoveScrr(this Component comp, float destination, float duration, Curve curve)
     {
         ManaAnim.MoveScrr(comp.transform, destination, duration, curve);
     }

+ 37 - 12
Assets/Script/Tool/UI/FlowerCard.cs

@@ -15,14 +15,30 @@ public class FlowerCard : MonoBehaviour
     public List<Transform> ItemList = new List<Transform>();
     public List<FlowerInfo> InfoList = new List<FlowerInfo>();
 
+    public ScrollRect ScrollRect
+    {
+        get
+        {
+            if (_ScrollRect == null)
+            {
+                _ScrollRect = ManaReso.Get<ScrollRect>("H_Scrr");
+            }
+
+            return _ScrollRect;
+        }
+        set { _ScrollRect = value; }
+    }
+
+    private ScrollRect _ScrollRect;
+
     #endregion
 
     public void Add(FlowerInfo flowerInfo)
     {
         Transform tra = ManaReso.GetFlowerCardItem();
 
-        tra.CreateTweenScale(new Vector3(1.5f, 1.5f, 1), 0.25f, true, true, Curve.EaseOutQuad);
-
+        tra.CreateTweenScale(new Vector3(1, 1, 1), new Vector3(1.25f, 1.25f, 1), 0.25f, true, true, Curve.EaseOutQuad);
+        
         Image image = tra.transform.GetChild(0).GetComponent<Image>();
 
         image.sprite = flowerInfo.Sprite;
@@ -40,27 +56,31 @@ public class FlowerCard : MonoBehaviour
                 Select(tra);
             }
         );
-
+        
         InfoList.Add(flowerInfo);
         ItemList.Add(tra);
     }
 
     public void Select(int index)
     {
-        if (SeleItem != null && SelectIndex != index)
-        {
-            SeleItem.TweenBacScale();
-        }
-
         if (SelectIndex != index)
         {
+            if (SeleItem != null)
+            {
+                SeleItem.TweenBacScale();
+            }
+
             SelectIndex = index;
 
             SeleItem = ItemList[index];
             SeleItem.TweenForScale();
             SeleItem.transform.SetAsLastSibling();
-
+            
             ManaGarden.SetFlowerCard(InfoList[index].Id);
+
+            float pos = (SelectIndex - 1)/((float) ItemList.Count - 3);
+
+            ScrollRect.MoveScrr(pos, 0.25f, Curve.EaseOutQuad);
         }
     }
 
@@ -76,15 +96,20 @@ public class FlowerCard : MonoBehaviour
             return;
         }
 
+        if (SeleItem != null)
+        {
+            SeleItem.TweenBacScale();
+            SeleItem = null;
+        }
+        SelectIndex = -1;
+
         for (int i = 0; i < ItemList.Count; i++)
         {
-            ItemList[i].TweenBacScale();
-            ManaReso.Save(ItemList[i]);
+            ManaReso.SaveUI(ItemList[i]);
         }
 
         InfoList = new List<FlowerInfo>();
         ItemList = new List<Transform>();
-        SelectIndex = -1;
 
         ManaReso.Get<HorizontalLayoutGroup>("H_Grid").enabled = true;
     }

+ 1 - 5
MyLovelyGarden.txt

@@ -1,15 +1,11 @@
-没有连接网络时禁用技能
+声音
 
 删掉ManaMessage 给ManaLog增加一个渐影效果
 
 增加一个调试面板(能够查看正在使用的技能 周期计时 Person与CoinPerson等)
 
-PageView改ListView
-
 throw new exception输入到调试面板中
 
-所有弹窗界面加上180透明度黑色背景
-
 图文混排