Ver Fonte

增加-购买花朵功能

jet há 8 anos atrás
pai
commit
c3cd51ab62

BIN
Assets/Resource/Animations/UIFlashLight.anim


BIN
Assets/Resource/Prefab/Object/DebugMode.prefab


BIN
Assets/Resource/Prefab/PrefabUI/FlowerItem.prefab


BIN
Assets/Resource/Prefab/PrefabUI/GroupA.prefab


BIN
Assets/Resource/Prefab/PrefabUI/GroupC.prefab


+ 2 - 2
Assets/Resource/XML/PlayerConfig.xml

@@ -1,5 +1,5 @@
 <PlayerConfig>
-  <Version value="662" />
+  <Version value="655" />
 
   <ID value="Default" />
 ////  <TutorialA value="0" />
@@ -49,7 +49,7 @@
     <Skill ID="Pack10" SkillType="Pack" ItemStatus="Lock" Level="0" />
     <Skill ID="Pack11" SkillType="Pack" ItemStatus="Lock" Level="0" />
     
-    <Skill ID="Ability1" SkillType="Ability" ItemStatus="Upgrade" Level="14" />
+    <Skill ID="Ability1" SkillType="Ability" ItemStatus="Lock" Level="0" />
     <Skill ID="Ability2" SkillType="Ability" ItemStatus="Lock" Level="0" />
     <Skill ID="Ability3" SkillType="Ability" ItemStatus="Lock" Level="0" />
     <Skill ID="Ability4" SkillType="Ability" ItemStatus="Lock" Level="0" />

+ 2 - 0
Assets/Resource/XML/lan/ChineseSimplified.xml

@@ -49,6 +49,8 @@
     <G_RetrieveLab desc=""><![CDATA[收回所有花]]></G_RetrieveLab>
     <H_BtnLab1 desc=""><![CDATA[收回]]></H_BtnLab1>
     <H_BtnLab2 desc=""><![CDATA[未解锁]]></H_BtnLab2>
+    <H_BtnLab3 desc=""><![CDATA[完成小游戏或购买礼包可以解锁]]></H_BtnLab3>
+    <H_BtnLab4 desc=""><![CDATA[放置]]></H_BtnLab4>
     <Ba_Lab desc=""><![CDATA[离开期间获得]]></Ba_Lab>
     <Ba_Lab2 desc=""><![CDATA[已达到最大离线收益,记得多上线哦!]]></Ba_Lab2>
     <Ba_ConfirmLab desc=""><![CDATA[确定]]></Ba_ConfirmLab>

+ 2 - 0
Assets/Resource/XML/lan/ChineseTraditional.xml

@@ -49,6 +49,8 @@
     <G_RetrieveLab desc=""><![CDATA[收回所有花]]></G_RetrieveLab>
     <H_BtnLab1 desc=""><![CDATA[收回]]></H_BtnLab1>
     <H_BtnLab2 desc=""><![CDATA[未解鎖]]></H_BtnLab2>
+    <H_BtnLab3 desc=""><![CDATA[]]></H_BtnLab3>
+    <H_BtnLab4 desc=""><![CDATA[]]></H_BtnLab4>
     <Ba_Lab desc=""><![CDATA[離開期間獲得]]></Ba_Lab>
     <Ba_Lab2 desc=""><![CDATA[已達到最大離線收益,記得多上線哦!]]></Ba_Lab2>
     <Ba_ConfirmLab desc=""><![CDATA[確定]]></Ba_ConfirmLab>

+ 2 - 0
Assets/Resource/XML/lan/English.xml

@@ -49,6 +49,8 @@
     <G_RetrieveLab desc=""><![CDATA[Take all back]]></G_RetrieveLab>
     <H_BtnLab1 desc=""><![CDATA[Take back]]></H_BtnLab1>
     <H_BtnLab2 desc=""><![CDATA[Locked]]></H_BtnLab2>
+    <H_BtnLab3 desc=""><![CDATA[]]></H_BtnLab3>
+    <H_BtnLab4 desc=""><![CDATA[]]></H_BtnLab4>
     <Ba_Lab desc=""><![CDATA[During absence acquired ]]></Ba_Lab>
     <Ba_Lab2 desc=""><![CDATA[Offline reward max. Remember to play the game!]]></Ba_Lab2>
     <Ba_ConfirmLab desc=""><![CDATA[Get]]></Ba_ConfirmLab>

BIN
Assets/Resource/Xlsx/language_config.xlsx


+ 9 - 0
Assets/Script/Interface/IgnoreIndexing.cs

@@ -0,0 +1,9 @@
+using UnityEngine;
+
+using System.Collections;
+using System.Collections.Generic;
+
+public class IgnoreIndexing : MonoBehaviour
+{
+        
+}

+ 12 - 0
Assets/Script/Interface/IgnoreIndexing.cs.meta

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

+ 51 - 37
Assets/Script/Manage/ManaCenter.cs

@@ -745,11 +745,11 @@ public class ManaCenter : Regist
         Diamond = Diamond;
     }
 
-    public static void Pay(string id, double amt, Current current, UnityAction callback, bool navigate = true)
+    public static void Pay(string id, double amt, Current current, UnityAction succeedCallback, bool navigate = true, bool useBubbleTweenNavigate = true, UnityAction navigateCall = null)
     {
         if (ManaTutorial.PayExempt)
         {
-            callback.Invoke();
+            succeedCallback.Invoke();
 
             return;
         }
@@ -758,11 +758,11 @@ public class ManaCenter : Regist
 
         if (current == Current.Free)
         {
-            callback.Invoke();
+            succeedCallback.Invoke();
         }
         else if (current == Current.AD)
         {
-            ManaIAP.PlayAD(callback);
+            ManaIAP.PlayAD(succeedCallback);
         }
         else if (current == Current.Cash)
         {
@@ -776,7 +776,7 @@ public class ManaCenter : Regist
             {
                 Coin -= amt;
 
-                callback.Invoke();
+                succeedCallback.Invoke();
             }
             else
             {
@@ -791,27 +791,34 @@ public class ManaCenter : Regist
                         ManaReso.LoadSprite("金币", Folder.UI),
                         () =>
                         {
-                            TweenRoot tween = ManaReso.Get("K_Bubble0").GetTweenScale();
+                            navigateCall.SafeInvoke();
 
-                            tween.AddEventOnetime
-                            (
-                                EventType.BackwardFinish,
-                                () =>
-                                {
-                                    ManaReso.Get<Button>("F_Magic").onClick.Invoke();
+                            if (useBubbleTweenNavigate)
+                            {
+                                TweenRoot tween = ManaReso.Get("K_Bubble0").GetTweenScale();
 
-                                    Auxiliary.Instance.DelayCall
+                                tween.AddEventOnetime
                                     (
+                                        EventType.BackwardFinish,
                                         () =>
                                         {
-                                            int index = ManaReso.Get("Fb_Grid").childCount - 1;
+                                            ManaUI.NavigateBuyCoin();
+                                        }
+                                    );
+                            }
+                            else
+                            {
+                                TweenRoot tween = ManaReso.Get("F_Manage0").GetTweenVec();
 
-                                            ManaReso.Get<ScrollRect>("Fb_Scrr").Locate(index, 0.25f, Curve.EaseOutQuad, LocatePos.Down);
-                                        },
-                                        1
+                                tween.AddEventOnetime
+                                    (
+                                        EventType.ForwardFinish,
+                                        () =>
+                                        {
+                                            ManaUI.NavigateBuyCoin();
+                                        }
                                     );
-                                }
-                            );
+                            }
                         }
                     );
                 }
@@ -836,7 +843,7 @@ public class ManaCenter : Regist
             {
                 Diamond -= amt;
 
-                callback.Invoke();
+                succeedCallback.Invoke();
             }
             else
             {
@@ -851,27 +858,34 @@ public class ManaCenter : Regist
                         ManaReso.LoadSprite("钻石", Folder.UI),
                         () =>
                         {
-                            TweenRoot tween = ManaReso.Get("K_Bubble0").GetTweenScale();
-
-                            tween.AddEventOnetime
-                            (
-                                EventType.BackwardFinish,
-                                () =>
-                                {
-                                    ManaReso.Get<Button>("F_Store").onClick.Invoke();
-
-                                    Auxiliary.Instance.DelayCall
+                            navigateCall.SafeInvoke();
+
+                            if (useBubbleTweenNavigate)
+                            {
+                                TweenRoot tween = ManaReso.Get("K_Bubble0").GetTweenScale();
+
+                                tween.AddEventOnetime
+                                (
+                                    EventType.BackwardFinish,
+                                    () =>
+                                    {
+                                        ManaUI.NavigateBuyDiamond();
+                                    }
+                                );
+                            }
+                            else
+                            {
+                                TweenRoot tween = ManaReso.Get("F_Manage0").GetTweenVec();
+
+                                tween.AddEventOnetime
                                     (
+                                        EventType.ForwardFinish,
                                         () =>
                                         {
-                                            int index = ManaReso.Get("Fc_Grid").childCount - 1;
-
-                                            ManaReso.Get<ScrollRect>("Fc_Scrr").Locate(index, 0.25f, Curve.EaseOutQuad, LocatePos.Down);
-                                        },
-                                        1
+                                            ManaUI.NavigateBuyDiamond();
+                                        }
                                     );
-                                }
-                            );
+                            }
                         }
                     );
                 }

+ 81 - 11
Assets/Script/Manage/ManaGarden.cs

@@ -388,11 +388,7 @@ public class ManaGarden : Regist
                     "H_Btn",
                     () =>
                     {
-                        //ManaAudio.PlayClip(Clip.BtnClip);
-
-                        //ManaReso.Get("H_FlowerCard").TweenBacCG();
-
-                        //RetriveFlower();
+                        Bubble.Show(null, Language.GetStr("UI", "H_BtnLab3"));
                     }
                 );
         }
@@ -407,11 +403,78 @@ public class ManaGarden : Regist
                     "H_Btn",
                     () =>
                     {
-                        //ManaAudio.PlayClip(Clip.BtnClip);
-
-                        //ManaReso.Get("H_FlowerCard").TweenBacCG();
-
-                        //RetriveFlower();
+                        ManaCenter.Pay
+                            (
+                                "",
+                                flowerInfo.UnlockAmt,
+                                flowerInfo.UnlockCur,
+                                () =>
+                                {
+                                    flowerInfo.Unlock = true;
+
+
+                                    Material material = new Material(ManaReso.Get<Image>("H_Icon2").material);
+
+                                    MaterialUnit materialUnit = new MaterialUnit
+                                        (
+                                        material,
+                                        ManaReso.Get("H_Icon2"),
+                                        new List<string>()
+                                        {
+                                            "_GrayLerp",
+                                        }
+                                        );
+
+                                    TweenMatFloat tweenMatFloat = materialUnit.CreateTweenMatFloat(1, 0, 1, true, true, Curve.EaseOutQuad, false);
+
+                                    tweenMatFloat.OnForwardStart = () =>
+                                    {
+                                        materialUnit.Transform.GetComponent<Image>().material = materialUnit.Material;
+                                    };
+
+                                    tweenMatFloat.OnForwardFinish = () =>
+                                    {
+                                        ManaReso.Get<Image>("H_Icon2").material = null;
+                                    };
+
+                                    materialUnit.TweenForMatFloat();
+
+
+                                    ManaAudio.PlayClip(Clip.CurrentClip);
+
+                                    ManaReso.Get("H_Icon1").FindChild("UIFlashLight/UIParticle System").GetComponent<UIPartical>().Begin();
+
+
+                                    ManaReso.SetText("H_BtnLab", Language.GetStr("UI", "H_BtnLab4"));
+
+                                    ManaReso.SetButtonEvent
+                                        (
+                                            "H_Btn",
+                                            () =>
+                                            {
+                                                PlantFlower(flowerInfo);
+
+                                                ManaReso.Get("H_FlowerCard").TweenBacCG();
+                                            }
+                                        );
+                                },
+                                true,
+                                false,
+                                () =>
+                                {
+                                    ManaReso.Get("H_FlowerCard").TweenBacCG();
+                                    TweenCG tweenCg = ManaReso.Get("G_Flower").TweenBacCG();
+
+                                    tweenCg.AddEventOnetime
+                                        (
+                                            EventType.BackwardFinish,
+                                            () =>
+                                            {
+                                                ManaReso.Get("F_Manage0").TweenForVec();
+                                            }
+                                        );
+                                }
+                            );
                     }
                 );
         }
@@ -466,4 +529,11 @@ public class ManaGarden : Regist
             ManaAudio.PlayClip(Clip.FlowerClip);
         }
     }
-}
+}
+
+#region 已测试内容
+
+//一共有3种花卡 回收卡 不能解锁卡 可以解锁卡 
+//各种卡之间转换时的按钮变化(事件和Text)
+
+#endregion

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

@@ -1529,6 +1529,12 @@ public class ManaUI : Regist
             ManaReso.Get("C_Main").TweenBacCG();
         };
 
+        tween.OnBackwardFinish += () =>
+        {
+            ManaReso.Get("H_Icon1").FindChild("UIFlashLight/UIFlash").SetActive(false);
+            ManaReso.Get("H_Icon1").FindChild("UIFlashLight/UIParticle System").SetActive(false);
+        };
+
         #endregion
 
         #endregion
@@ -2003,4 +2009,36 @@ public class ManaUI : Regist
 
         tween.Pause();
     }
+
+    public static void NavigateBuyCoin()
+    {
+        ManaReso.Get<Button>("F_Magic").onClick.Invoke();
+
+        Auxiliary.Instance.DelayCall
+            (
+                () =>
+                {
+                    int index = ManaReso.Get("Fb_Grid").childCount - 1;
+
+                    ManaReso.Get<ScrollRect>("Fb_Scrr").Locate(index, 0.25f, Curve.EaseOutQuad, LocatePos.Down);
+                },
+                1
+            );
+    }
+
+    public static void NavigateBuyDiamond()
+    {
+        ManaReso.Get<Button>("F_Store").onClick.Invoke();
+
+        Auxiliary.Instance.DelayCall
+        (
+            () =>
+            {
+                int index = ManaReso.Get("Fc_Grid").childCount - 1;
+
+                ManaReso.Get<ScrollRect>("Fc_Scrr").Locate(index, 0.25f, Curve.EaseOutQuad, LocatePos.Down);
+            },
+            1
+        );
+    }
 }

+ 10 - 7
Assets/Script/Object/Flower.cs

@@ -116,20 +116,20 @@ public class FlowerInfo
     public UIPartical UIPartical;
     public Transform FlowerItem;
 
+    public Dictionary<string, Transform> ChildDic = new Dictionary<string, Transform>();
+
     #endregion
 
     public FlowerInfo(XmlAttributeCollection attribute)
     {
         FlowerItem = ManaReso.Get("FlowerItem", Folder.UI, false, ManaReso.Get("G_RegularGrid"),  false, ObjType.FlowerItem);
 
-        Dictionary<string, Transform> dic = new Dictionary<string, Transform>();
+        Auxiliary.CompileDic(FlowerItem, ChildDic);
 
-        Auxiliary.CompileDic(FlowerItem, dic);
-
-        Text = dic["Lab"].GetComponent<Text>();
-        Image = dic["Icon"].GetComponent<Image>();
-        Button = dic["FlowerItem"].GetComponent<Button>();
-        UIPartical = dic["UIParticle System"].GetComponent<UIPartical>();
+        Text = ChildDic["Lab"].GetComponent<Text>();
+        Image = ChildDic["Icon"].GetComponent<Image>();
+        Button = ChildDic["FlowerItem"].GetComponent<Button>();
+        UIPartical = ChildDic["UIParticle System"].GetComponent<UIPartical>();
 
         ID_ = int.Parse(attribute[0].Value);
         Icon_ = attribute[5].Value;
@@ -487,6 +487,9 @@ public class Flower : Regist, IPointerClickHandler
         ChildDic["Flash"].SetActive(false);
         ChildDic["Particle System"].SetActive(false);
         
+        FlowerInfo.ChildDic["UIFlash"].SetActive(false);
+        FlowerInfo.ChildDic["UIParticle System"].SetActive(false);
+
         ManaReso.Save(this);
 
         for (int i = 0; i < ElfList.Count; i++)

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

@@ -128,39 +128,22 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.Z))
         {
-            Material material = new Material(GetComponent<Image>().material);
 
-            materialUnit = new MaterialUnit
-            (
-                material,
-                GetComponent<Image>().transform,
-                new List<string>()
-                {
-                    "_GrayLerp",
-                }
-            );
-
-            TweenMatFloat tweenMatFloat = materialUnit.CreateTweenMatFloat(1, 0, 1, true, true, Curve.EaseOutQuad, false);
-
-            tweenMatFloat.OnForwardStart = () =>
-            {
-                materialUnit.Transform.GetComponent<Image>().material = materialUnit.Material;
-            };
         }
 
         if (Input.GetKeyDown(KeyCode.X))
         {
-            materialUnit.TweenForMatFloat();
+            
         }
 
         if (Input.GetKeyDown(KeyCode.C))
         {
-            materialUnit.TweenBacMatFloat();
+
         }
 
         if (Input.GetKeyDown(KeyCode.V))
         {
-            //ManaReso.Get("C_MiniGame").TweenBacRect();
+            
         }
 
         //if (Input.GetKeyDown(KeyCode.P))
@@ -338,12 +321,20 @@ public class Auxiliary : Regist
     }
 
 
-    public static void CompileDic(Transform tra, Dictionary<string, Transform> dic)
+    public static void CompileDic(Transform tra, Dictionary<string, Transform> dic, bool enableIgnore = true)
     {
         Transform[] transforms = tra.GetComponentsInChildren<Transform>(true);
 
         for (int i = 0; i < transforms.Length; i++)
         {
+            if (enableIgnore)
+            {
+                if (transforms[i].GetComponent<IgnoreIndexing>())
+                {
+                    continue;
+                }
+            }
+
             if (dic.ContainsKey(transforms[i].name))
             {
                 throw new Exception(transforms[i].name);

+ 12 - 12
Assets/Script/Tool/Bundle.cs

@@ -29,7 +29,6 @@ public class Bundle : MonoBehaviour
     public static AssetBundle Discard;
 
     public List<Object> UiList;
-    public List<Sprite> AtlasList;
     public List<Sprite> Atlas2List;
     public List<Object> EffectList;
     public List<Object> AudioList;
@@ -106,16 +105,6 @@ public class Bundle : MonoBehaviour
                     }
                 }
             }
-            else if (folder == Folder.Atlas)
-            {
-                for (int i = 0; i < Instance.AtlasList.Count; i++)
-                {
-                    if (Instance.AtlasList[i].name == goName)
-                    {
-                        return (T) Instance.AtlasList[i];
-                    }
-                }
-            }
             else if (folder == Folder.Discard)
             {
                 for (int i = 0; i < Instance.DiscardList.Count; i++)
@@ -126,6 +115,10 @@ public class Bundle : MonoBehaviour
                     }
                 }
             }
+            else if (folder == Folder.Atlas)
+            {
+                return Atlas.LoadAsset<T>(goName);
+            }
 
             #endregion
         }
@@ -280,7 +273,14 @@ public class Bundle : MonoBehaviour
     {
         yield return LoadConfig();
 
-        ManaReso.AddAsyncLoad<TextAsset>("PlayerConfig", Folder.Config, () => { ManaData.PlayerDoc = ManaData.PlayerDoc; });
+        if (!Logo.Complete && !Initializer.Instance.DebugMode)
+        {
+            ManaReso.AddAsyncLoad<TextAsset>("PlayerConfig", Folder.Config, () => { ManaData.PlayerDoc = ManaData.PlayerDoc; });
+        }
+        else
+        {
+            ManaData.PlayerDoc = ManaData.PlayerDoc;
+        }
 
         yield return LoadDiscard();
 

+ 10 - 6
Assets/Script/Tool/UI/ImagePlus.cs

@@ -40,7 +40,14 @@ public class ImagePlus : Image
             {
                 if (sprite == null)
                 {
-                    sprite = ManaReso.LoadSprite("Atlas", Folder.Atlas);
+                    Auxiliary.Instance.DelayCall
+                        (
+                            () =>
+                            {
+                                sprite = ManaReso.LoadSprite("Atlas", Folder.Atlas);
+                            },
+                            1
+                        );
                 }
             }
         }
@@ -76,17 +83,14 @@ public class ImagePlus : Image
 
         OnPopulateMesh(empty);
 
-        StartCoroutine
-        (
-            Auxiliary.IDelayCall
+        Auxiliary.Instance.DelayCall
             (
                 () =>
                 {
                     SetVerticesDirty();
                 },
                 2
-            )
-        );
+            );
     }
 
     protected override void OnPopulateMesh(VertexHelper toFill)

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

@@ -51,7 +51,7 @@ public class UIPartical : Image
         {
             return;
         }
-
+        
         Animator.SetTrigger("Play");
 
         ParticleSystem.Play();

+ 2 - 5
ToList.txt

@@ -1,18 +1,15 @@
-从Gray卡到普通 从普通卡到Gray 点击按钮后要停止播放粒子特效
-
-
 分享appid申请
 
 VerticalBestfit计算次数太多时性能低
 
 
-//还原PlayerConfig
+还原PlayerConfig
 
 关闭调试界面
 
 关闭调试按键
 
-//关闭DebugMode
+关闭DebugMode
 
 //注意存档覆盖情况