Browse Source

增加返礼功能

LiuQilin 7 years ago
parent
commit
f41b5a48cf

+ 0 - 9
Assets/AtlasUtility/Script/Editor/TestEditor.cs

@@ -25,16 +25,7 @@ namespace AtlasUtility
 
             if (GUILayout.Button("Test"))
             {
-                //char c = (char)0x48;
 
-                //Script.Text.text = $"123:\u3000456789abc";
-                //Script.Text.text = $"123:{c}456789abc ";
-                //Script.Text.text = "用这个吧 ,可以代替空格,占2个空格位";
-
-                //foreach (var b in Encoding.Unicode.GetBytes(Script.Text.text[0].ToString()))
-                //{
-                //    Debug.Log(b);
-                //}
             }
         }
     }

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

@@ -1,5 +1,5 @@
 <PlayerConfig>
-  <Version value="11" />
+  <Version value="12" />
   <ReplayVersion value="1" />
   
   <ID value="Default" />
@@ -24,6 +24,7 @@
   <Language value="Default" />
   
   <Coin value="0" />
+  <ExtraSlot value="0" />
   <PackLock value="0" />
   <Diamond value="0" />
   <SignIndex value="1" />

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

@@ -198,6 +198,7 @@
     <内容不能为空 desc=""><![CDATA[内容不能为空]]></内容不能为空>
     <未命名 desc=""><![CDATA[未命名]]></未命名>
     <请勿重复发送 desc=""><![CDATA[请勿重复发送]]></请勿重复发送>
+    <获取充值返礼信息失败 desc=""><![CDATA[获取充值返礼信息失败]]></获取充值返礼信息失败>
   </UI>
   <FlowerName>
     <Flower1 desc=""><![CDATA[粉色小花]]></Flower1>

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

@@ -198,6 +198,7 @@
     <内容不能为空 desc=""><![CDATA[內容不能為空]]></内容不能为空>
     <未命名 desc=""><![CDATA[未命名]]></未命名>
     <请勿重复发送 desc=""><![CDATA[請勿重複發送]]></请勿重复发送>
+    <获取充值返礼信息失败 desc=""><![CDATA[]]></获取充值返礼信息失败>
   </UI>
   <FlowerName>
     <Flower1 desc=""><![CDATA[粉色小花]]></Flower1>

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

@@ -198,6 +198,7 @@ Program 水怪
     <内容不能为空 desc=""><![CDATA[Null content]]></内容不能为空>
     <未命名 desc=""><![CDATA[Unnamed]]></未命名>
     <请勿重复发送 desc=""><![CDATA[Do not send again]]></请勿重复发送>
+    <获取充值返礼信息失败 desc=""><![CDATA[]]></获取充值返礼信息失败>
   </UI>
   <FlowerName>
     <Flower1 desc=""><![CDATA[Pink Flower]]></Flower1>

BIN
Assets/Resource/Xlsx/language_config.xlsx


+ 233 - 22
Assets/Script/Function/ThanksGift.cs

@@ -1,43 +1,254 @@
-using System.Collections;
+using System;
+using System.Collections;
 using System.Collections.Generic;
 using LitJson;
 using UnityEngine;
 
-public enum GiftType
+public class Gift
 {
-    金币=0,
-    钻石 = 1,
-    礼包 = 2,
-    花朵 = 3,
-    服装 = 4,
-    开垦土地=5,
+    private enum GiftType
+    {
+        金币 = 0,
+        钻石 = 1,
+        礼包 = 2,
+        花朵 = 3,
+        服装 = 4,
+        开垦土地 = 5,
+        精灵 = 6,
+    }
+
+    //private static Dictionary<char, GiftType> TypeDictionary = new Dictionary<char, GiftType>
+    //{
+    //    {'g', GiftType.金币},
+    //    {'d', GiftType.钻石},
+    //    {'p', GiftType.礼包},
+    //    {'f', GiftType.花朵},
+    //    {'c', GiftType.服装},
+    //    {'s', GiftType.开垦土地},
+    //    {'a', GiftType.精灵},
+    //};
+
+    #region Config
+
+    private List<List<int>> Values = new List<List<int>>();
+    private List<GiftType> Types = new List<GiftType>();
+    private DateTime StartDate;
+    private DateTime EndDate;
+
+    #endregion
+
+    public Gift(JsonData jsonData)
+    {
+        //Debug.Log(jsonData.ToJson());
+        int value = (int) jsonData["g"];
+        if (value != 0)
+        {
+            Types.Add(GiftType.金币);
+            Values.Add(new List<int> {value});
+        }
+        value = (int)jsonData["d"];
+        if (value != 0)
+        {
+            Types.Add(GiftType.钻石);
+            Values.Add(new List<int> { value });
+        }
+        string values = (string)jsonData["p"];
+        if (values != "0")
+        {
+            Types.Add(GiftType.礼包);
+            Values.Add(Auxiliary.IntListParse(' ', values, new List<int>()));
+        }
+        values = (string)jsonData["f"];
+        if (values != "0")
+        {
+            Types.Add(GiftType.花朵);
+            Values.Add(Auxiliary.IntListParse(' ', values, new List<int>()));
+        }
+        values = (string)jsonData["c"];
+        if (values != "0")
+        {
+            Types.Add(GiftType.服装);
+            Values.Add(Auxiliary.IntListParse(' ', values, new List<int>()));
+        }
+        value = (int)jsonData["s"];
+        if (value != 0)
+        {
+            Types.Add(GiftType.开垦土地);
+            Values.Add(new List<int> { value });
+        }
+        values = (string)jsonData["a"];
+        if (values != "0")
+        {
+            Types.Add(GiftType.精灵);
+            Values.Add(Auxiliary.IntListParse(' ', values, new List<int>()));
+        }
+        StartDate = DateTime.Parse(jsonData["starttime"].ToString());
+        EndDate = DateTime.Parse(jsonData["endtime"].ToString());
+        //for (int i = 0; i < Types.Count; i++)
+        //{
+        //    Debug.LogWarning(Types[i]);
+        //    for (int j = 0; j < Values[i].Count; j++)
+        //    {
+        //        Debug.Log(Values[i][j]);
+        //    }
+        //}
+        //Debug.LogWarning(StartDate);
+        //Debug.LogWarning(EndDate);
+    }
+
+    public void GetAllGift()
+    {
+        if (ManaServer.Time > EndDate)
+        {
+            //Debug.Log("has't start");
+            return;
+        }
+
+        if (ManaServer.Time < StartDate)
+        {
+            //Debug.Log("over");
+            return;
+        }
+
+        for (int i = 0; i < Types.Count; i++)
+        {
+            for (int j = 0; j < Values[i].Count; j++)
+            {
+                GetGift(Types[i], Values[i][j]);
+            }
+        }
+    }
+
+    private float CloseRatio = 0.25f;
+    private float AbilityRatio = 0.25f;
+    private void GetGift(GiftType type, int value)
+    {
+        if (type == GiftType.开垦土地)
+        {
+            for (int i = 0; i < value; i++)
+            {
+                ManaGarden.UnlockSlot();
+                int extraSlot = ManaData.GetPlayerInt(PlayerConfigLabel.ExtraSlot);
+                ManaData.SavePlayerInt(PlayerConfigLabel.ExtraSlot, extraSlot + 1);
+                //Debug.LogWarning($"{type}");
+            }
+        }
+        else if (type == GiftType.服装)
+        {
+            CloseUnit closeUnit = ManaPlayer.CloseUnitDic[value];
+            if (closeUnit.Bought)
+            {
+                /*ExchangeInfo info = */closeUnit.GetExchangeValue(CloseRatio, StaticsManager.ConsumeModule.Gift);
+                //Debug.LogWarning($"{type} {info.Current} {info.Value}");
+            }
+            else
+            {
+                closeUnit.OnBuySucceed();
+                //Debug.LogWarning($"{type} {value}");
+            }
+        }
+        else if (type == GiftType.礼包)
+        {
+            (ManaCenter.SkillDic[SkillConfigLabel.Pack + value] as Pack).PurchaseResult(false);
+            //Debug.LogWarning($"{type} {SkillConfigLabel.Pack + value}");
+        }
+        else if (type == GiftType.精灵)
+        {
+            Ability ability = (Ability) ManaCenter.SkillDic[SkillConfigLabel.Ability + value];
+            if (ability.ItemStatus == SkillStatus.Lock)
+            {
+                /*ExchangeInfo info = */ability.GetUnlockAheadExchangeValue(AbilityRatio, StaticsManager.ConsumeModule.Gift);
+                //Debug.LogWarning($"{type} {info.Current} {info.Value}");
+            }
+            else if (ability.ItemStatus == SkillStatus.UnLock)
+            {
+                ability.UnlockSucceed();
+                //Debug.LogWarning($"{type} {SkillConfigLabel.Pack + value}");
+            }
+            else if (ability.ItemStatus == SkillStatus.Upgrade)
+            {
+                ability.UpgradeSucceed();
+                //Debug.LogWarning($"{type} {SkillConfigLabel.Pack + value}");
+            }
+        }
+        else if (type == GiftType.花朵)
+        {
+            FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[value];
+            if (!flowerInfo.Unlock)
+            {
+                flowerInfo.Unlock = true;
+                //Debug.LogWarning($"{type} {flowerInfo.Name}");
+            }
+            else
+            {
+                flowerInfo.Amount++;
+                //Debug.LogWarning($"{type} {flowerInfo.Name}");
+            }
+        }
+        else if (type == GiftType.金币)
+        {
+            ManaCenter.AddCoin(value, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Gift);
+            //Debug.LogWarning($"{type} {value}");
+        }
+        else if (type == GiftType.钻石)
+        {
+            ManaCenter.AddDiamond(value, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Gift);
+            //Debug.LogWarning($"{type} {value}");
+        }
+    }
 }
 
 public class ThanksGift
 {
     #region Config
 
-    private static Dictionary<int, List<KV<GiftType, int>>> GiftDictionary = new Dictionary<int, List<KV<GiftType, int>>>();
-    private static Dictionary<char, GiftType> TypeDictionary = new Dictionary<char, GiftType>
-    {
-        {'g', GiftType.金币},
-        {'d', GiftType.钻石},
-        {'p', GiftType.礼包},
-        {'f', GiftType.花朵},
-        {'c', GiftType.服装},
-        {'s', GiftType.开垦土地},
-    };
+    private static bool Inited;
+    private static Dictionary<int, Gift> GiftDictionary = new Dictionary<int, Gift>();
     
     #endregion
 
     public static void GetGiftList(JsonData jsonData)
     {
-        
+        //Debug.LogWarning("Inited");
+        Inited = true;
+        for (int i = 0; i < jsonData.Count; i++)
+        {
+            GiftDictionary.Add((int) jsonData[i]["packid"], new Gift(jsonData[i]));
+        }
+    }
+
+    public static void GetGiftProcess(int packID)
+    {
+        if (!Inited)
+        {
+            ManaServer.GetThanksGiftInfo
+            (
+                jData =>
+                {
+                    GetGiftList(jData);
+                    GetGift(packID);
+                },
+                () => Bubble.Show(null, Language.GetStr("UI", "获取充值返礼信息失败")
+                )
+            );
+        }
+        else
+        {
+            GetGift(packID);
+        }
     }
 
-    private static float CloseRatio = 0.25f;
-    public static void Test(int packID)
+    public static void GetGift(int packID)
     {
-        
+        if (GiftDictionary.ContainsKey(packID))
+        {
+            //Debug.Log("have gift");
+            Gift gift = GiftDictionary[packID];
+            gift.GetAllGift();
+        }
+        else
+        {
+            //Debug.Log("no gift");
+        }
     }
 }

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

@@ -693,6 +693,7 @@ public class ManaCenter : Regist
 
             #endregion
 
+            //Debug.Log(skillRoot.ID);
             SkillDic.Add(skillRoot.ID, skillRoot);
             SkillList.Add(skillRoot);
         }

+ 17 - 0
Assets/Script/Manage/ManaData.cs

@@ -1260,6 +1260,13 @@ public class ManaData : Regist
             To11(nativeDoc, defaultDoc);
         }
 
+        if (nativeVersion < 12)
+        {
+            Debug.LogWarning("UpdateArchive to 12");
+
+            To12(nativeDoc, defaultDoc);
+        }
+
         return nativeDoc;
     }
 
@@ -1484,4 +1491,14 @@ public class ManaData : Regist
 
         return nativeDoc;
     }
+
+    public static XmlDocument To12(XmlDocument nativeDoc, XmlDocument defaultDoc)
+    {
+        nativeDoc.SelectSingleNode("PlayerConfig").SelectSingleNode("Version").Attributes[0].Value = 12.ToString();
+        XmlNode xmlNode = defaultDoc.SelectSingleNode("PlayerConfig").SelectSingleNode(PlayerConfigLabel.ExtraSlot);
+
+        nativeDoc.SelectSingleNode("PlayerConfig").AppendChild(nativeDoc.ImportNode(xmlNode, true));
+
+        return nativeDoc;
+    }
 }

+ 4 - 0
Assets/Script/Manage/ManaGarden.cs

@@ -302,6 +302,10 @@ public class ManaGarden : Regist
         AwardTimer = Random.Range(5f, 15f);
 
         UnlockSlot();
+        for (int i = 0; i < ManaData.GetPlayerInt(PlayerConfigLabel.ExtraSlot); i++)
+        {
+            UnlockSlot();
+        }
 
         #region 读花朵存档
 

+ 13 - 0
Assets/Script/Manage/ManaIAP.cs

@@ -291,6 +291,19 @@ public class ManaIAP : MonoBehaviour, IStoreListener
             return;
         }
 
+        ManaServer.GetThanksGiftInfo
+        (
+            jData =>
+            {
+                ThanksGift.GetGiftList(jData);
+                PurchaseCore(str);
+            },
+            () => { Bubble.Show(null, Language.GetStr("UI", "获取充值返礼信息失败")); }
+        );
+    }
+
+    private static void PurchaseCore(string str)
+    {
         if (PayChannel == PayChannel.AliPay)
         {
             ManaServer.GetProductID

+ 62 - 6
Assets/Script/Manage/ManaServer.cs

@@ -1018,12 +1018,68 @@ public class ManaServer : Regist
 
     public static void GetThanksGiftInfo(Action<JsonData> callback, Action failed)
     {
-        JsonData rootJson = new JsonData();
-        JsonData json = new JsonData();
-        json["i"] = 7;
-        json["g"] = "g100";
-        rootJson.Add(json);
-        Debug.Log(rootJson.ToJson());
+        URLRequestData urlData = new URLRequestData();
+
+        URLRequest.CreateURLRequest
+        (
+            false,
+            NewBaseURL + "/index/gift",
+            urlData,
+            jData =>
+            {
+                if (jData.Inst_Object.ContainsKey("l"))
+                {
+                    callback.Invoke(jData["l"]);
+                }
+                else
+                {
+                    failed.Invoke();
+                }
+            }
+        );
+
+        //URLRequest.CreateStrURLRequest
+        //(
+        //    false,
+        //    NewBaseURL + "/index/gift",
+        //    urlData,
+        //    Debug.Log
+        //);
+
+        //JsonData rootJson = new JsonData();
+        //JsonData jData = new JsonData();
+        //rootJson["l"] = jData;
+        //JsonData json = new JsonData();
+        //json["i"] = 1;
+        //json["g"] = "g100";
+        //jData.Add(json);
+        //json = new JsonData();
+        //json["i"] = 2;
+        //json["g"] = "d200";
+        //jData.Add(json);
+        //json = new JsonData();
+        //json["i"] = 3;
+        //json["g"] = "p1";
+        //rootJson.Add(json);
+        //json = new JsonData();
+        //json["i"] = 4;
+        //json["g"] = "f1";
+        //rootJson.Add(json);
+        //json = new JsonData();
+        //json["i"] = 5;
+        //json["g"] = "c1";
+        //rootJson.Add(json);
+        //json = new JsonData();
+        //json["i"] = 6;
+        //json["g"] = "s1";
+        //rootJson.Add(json);
+        //json = new JsonData();
+        //json["i"] = 7;
+        //json["g"] = "a1";
+        //rootJson.Add(json);
+        //Debug.Log(rootJson.ToJson());
+        //Debug.Log(rootJson["l"][0].ToJson());
+        //Debug.Log(rootJson["l"][1].ToJson());
     }
 
 

+ 45 - 7
Assets/Script/Object/Player.cs

@@ -34,6 +34,34 @@ public enum BodyPart
     Headwear = 15,
 }
 
+public class ExchangeInfo
+{
+    public float Rate;
+    public double Value;
+    public Current Current;
+
+    public static void GetExchangeValue(ExchangeInfo info, StaticsManager.ConsumeModule consumeModule)
+    {
+        if (info.Current == Current.Coin)
+        {
+            ManaCenter.AddCoin(info.Value, StaticsManager.ItemID.获得金币, consumeModule);
+        }
+        else if (info.Current == Current.Diamond)
+        {
+            ManaCenter.AddDiamond(info.Value, StaticsManager.ItemID.获得钻石, consumeModule);
+        }
+    }
+
+    public static ExchangeInfo GetExchangeInfo(Current current, double amt, float rate)
+    {
+        ExchangeInfo info = new ExchangeInfo();
+        info.Rate = rate;
+        info.Value = amt * rate;
+        info.Current = current;
+        return info;
+    }
+}
+
 public class CloseUnit
 {
     public enum CloseType
@@ -413,18 +441,12 @@ public class CloseUnit
             BuyCurrent,
             () =>
             {
-                Unlock();
-
-                ManaAudio.PlayClip(Clip.CurrentClip);
-
-                ManaPlayer.BoughtCloseList.UniqueAdd(ID);
+                OnBuySucceed();
 
                 ManaReso.Get("Pa_Info").TweenBacCG();
 
                 ChangeDress(ManaPlayer.Player);
                 SaveDressData();
-
-                ManaServer.Save();
             },
             StaticsManager.ItemID.解锁服装,
             StaticsManager.ConsumeModule.Shop,
@@ -457,6 +479,14 @@ public class CloseUnit
         );
     }
 
+    public void OnBuySucceed()
+    {
+        Unlock();
+        ManaAudio.PlayClip(Clip.CurrentClip);
+        ManaPlayer.BoughtCloseList.UniqueAdd(ID);
+        ManaServer.Save();
+    }
+
     public void ChangeDress(Player player)
     {
         player.ChangeClose(BodyPart, ArmatureName);
@@ -563,6 +593,14 @@ public class CloseUnit
             BuyBtn.image.material = null;
         }
     }
+
+
+    public ExchangeInfo GetExchangeValue(float rate, StaticsManager.ConsumeModule consumeModule)
+    {
+        ExchangeInfo info = ExchangeInfo.GetExchangeInfo(BuyCurrent, BuyAmt, rate);
+        ExchangeInfo.GetExchangeValue(info, consumeModule);
+        return info;
+    }
 }
 
 public enum PlayerDirection

+ 75 - 48
Assets/Script/Object/Skill/Ability.cs

@@ -402,21 +402,8 @@ public class Ability : SkillRoot
             UnlockCur,
             () =>
             {
-                ManaAudio.PlayClip(Clip.SkillClip);
+                UnlockSucceed();
 
-                ItemIcon.material = null;
-                ItemStatus = SkillStatus.Upgrade;
-
-                if (UnlockCur != Current.Free)
-                {
-                    ManaUI.UpdateHint();
-                }
-
-                Level = 1;
-
-                UseA();
-                UseB();
-                UseC();
                 Zoom();
 
                 if (ID == "Ability1")
@@ -431,6 +418,25 @@ public class Ability : SkillRoot
         );
     }
 
+    public void UnlockSucceed()
+    {
+        ManaAudio.PlayClip(Clip.SkillClip);
+
+        ItemIcon.material = null;
+        ItemStatus = SkillStatus.Upgrade;
+
+        if (UnlockCur != Current.Free)
+        {
+            ManaUI.UpdateHint();
+        }
+
+        Level = 1;
+
+        UseA();
+        UseB();
+        UseC();
+    }
+
     protected void OnClick()
     {
         ManaAudio.PlayClip(Clip.BtnClip);
@@ -515,35 +521,40 @@ public class Ability : SkillRoot
             UpgradeCur,
             () =>
             {
-                ManaAudio.PlayClip(Clip.SkillClip);
-
-                Level++;
-
-                AnnulA();
-
-                NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString("0.00"));
-                
-                UpgradeValue(ref NewPlus, UpgradePlus, 1);
-                UpgradeValue(ref NewPersonBuff, UpgradePerson, 1);
-                UpgradeSkillCdBuff(ref NewSkillCdBuff, UpgradeCD, 1);
-
-                UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
-                UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
-                UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
-                
-                UseA();
-                UseB();
-
-                if (ID == "Ability1")
-                {
-                    ManaCenter.Level++;
-                }
+               UpgradeSucceed();
             },
             StaticsManager.ItemID.升级技能,
             StaticsManager.ConsumeModule.Shop
         );
     }
 
+    public void UpgradeSucceed()
+    {
+        ManaAudio.PlayClip(Clip.SkillClip);
+
+        Level++;
+
+        AnnulA();
+
+        NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString("0.00"));
+
+        UpgradeValue(ref NewPlus, UpgradePlus, 1);
+        UpgradeValue(ref NewPersonBuff, UpgradePerson, 1);
+        UpgradeSkillCdBuff(ref NewSkillCdBuff, UpgradeCD, 1);
+
+        UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
+        UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
+        UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
+
+        UseA();
+        UseB();
+
+        if (ID == "Ability1")
+        {
+            ManaCenter.Level++;
+        }
+    }
+
     protected void UnlockAhead()
     {
         ManaCenter.Pay
@@ -553,22 +564,29 @@ public class Ability : SkillRoot
             UnlockAheadCur,
             () =>
             {
-                ManaAudio.PlayClip(Clip.SkillClip);
-
-                if (UnlockCur == Current.Free)
-                {
-                    Unlock();
-                }
-                else
-                {
-                    ItemStatus = SkillStatus.UnLock;
-                }
+                UnlockAheadSucceed();
             },
             StaticsManager.ItemID.提前解锁技能,
             StaticsManager.ConsumeModule.Shop
         );
     }
 
+    public void UnlockAheadSucceed()
+    {
+        ManaAudio.PlayClip(Clip.SkillClip);
+
+        if (UnlockCur == Current.Free)
+        {
+            Unlock();
+        }
+        else
+        {
+            ItemStatus = SkillStatus.UnLock;
+
+            ManaUI.UpdateHint();
+        }
+    }
+
 
     public virtual void AnnulB()
     {
@@ -627,7 +645,16 @@ public class Ability : SkillRoot
             }
         }
     }
-    
+
+
+
+    public ExchangeInfo GetUnlockAheadExchangeValue(float rate, StaticsManager.ConsumeModule consumeModule)
+    {
+        ExchangeInfo info = ExchangeInfo.GetExchangeInfo(UnlockAheadCur, UnlockAheadAmt, rate);
+        ExchangeInfo.GetExchangeValue(info, consumeModule);
+        return info;
+    }
+
     #region 解读器
 
     protected double UpgradeAmtParse(string str)

+ 7 - 4
Assets/Script/Object/Skill/Pack.cs

@@ -190,7 +190,7 @@ public class Pack : SkillRoot
         ManaLan.Add(ItemTit, new LanStr("SkillName", ID));
 
 
-        ManaIAP.ProductActionDic.UniqueAdd(ID, PurchaseResult);
+        ManaIAP.ProductActionDic.UniqueAdd(ID, ()=>PurchaseResult());
 
         ItemStatus = ItemStatus;
 
@@ -308,10 +308,10 @@ public class Pack : SkillRoot
     {
         ManaAudio.PlayClip(Clip.BtnClip);
 
-        ManaCenter.Pay(ID, UseAmt, BuyCur, PurchaseResult, StaticsManager.ItemID.购买礼包,  StaticsManager.ConsumeModule.Charge);
+        ManaCenter.Pay(ID, UseAmt, BuyCur, ()=> PurchaseResult(), StaticsManager.ItemID.购买礼包,  StaticsManager.ConsumeModule.Charge);
     }
 
-    public void PurchaseResult()
+    public void PurchaseResult(bool getGift = true)
     {
         int tempCoin = 0;
         int tempDiamond = (int) DiamondOnce;
@@ -401,7 +401,10 @@ public class Pack : SkillRoot
 
         SetActive();
 
-        ThanksGift.Test(ID_);
+        if (getGift)
+        {
+            ThanksGift.GetGiftProcess(ID_);
+        }
     }
 
 

+ 1 - 0
Assets/Script/ThirdParty/DataEyeStatics/StaticsManager.cs

@@ -263,6 +263,7 @@ public class StaticsManager
         VisitRefund,
         RoomChestAward,
         RoomChestRefund,
+        Gift,
     }
 
     public static string GetStringByConsumeModule(ConsumeModule module)

+ 4 - 28
Assets/Script/Tool/Auxiliary.cs

@@ -142,34 +142,10 @@ public class Auxiliary : Regist
         //}
 
 
-        //if (Input.GetKeyDown(KeyCode.Space))
-        //{
-        //    ManaCenter.SaveTimer = 0;
-
-        //    URLRequestData urlData = new URLRequestData();
-
-        //    urlData.Add("u", "1704189794672324513");
-        //    urlData.Add("v", "10");
-
-        //    ManaData.SavePlayerConfig();
-
-        //    urlData.Add("l", ManaData.PlayerDoc.OuterXml);
-
-        //    URLRequest.CreateURLRequest(false, ManaServer.NewBaseURL + "/user/save", urlData, (data => Debug.Log(data.ToJson())), URLRequest.Method.POST);
-        //    RobotManager.AddRobot(SFSManager.GardenSmartFox.PlazaRoomManager.CurrentPlazaRoom.Id, 19, position, PlayerDirection.Left);
-        //    Resources.UnloadAsset(ManaReso.Get("U_LoadingPanel"));
-        //    foreach (var VARIABLE in ChestMge.PlazaRoomChests)
-        //    {
-        //        VARIABLE.ShadowSR.material = UnityFactory.Materials[0];
-        //        VARIABLE.ChestSR.material = UnityFactory.Materials[0];
-        //    }
-
-        //    ManaSocial.CloseCommentPanel();
-        //    Debug.LogWarning(ManaServer.SerialNumber);
-        //    SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.CheckDefaultRoomStatus(1);
-        //    ManaReso.Get<VerticalLayoutGroup>("R_Grid").CalculateLayoutInputVertical();
-        //    ManaReso.Get<VerticalLayoutGroup>("R_Grid").SetLayoutVertical();
-        //}
+        if (Input.GetKeyDown(KeyCode.Space))
+        {
+            ManaServer.GetThanksGiftInfo(ThanksGift.GetGiftList, () => Bubble.Show(null, Language.GetStr("UI", "获取充值返礼信息失败")));
+        }
 
         //if (Input.GetKeyDown(KeyCode.A))
         //{

+ 9 - 0
Assets/Script/Tool/PlayerConfigLabel.cs

@@ -0,0 +1,9 @@
+using System.Collections;
+using System.Collections.Generic;
+
+using UnityEngine;
+
+public class PlayerConfigLabel
+{
+    public static string ExtraSlot = "ExtraSlot";
+}

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

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

+ 12 - 0
Assets/Script/Tool/SkillConfigLabel.cs

@@ -0,0 +1,12 @@
+using System.Collections;
+using System.Collections.Generic;
+
+using UnityEngine;
+
+public class SkillConfigLabel
+{
+    public static string Pack = "Pack";
+    public static string Skill = "Skill";
+    public static string Ability = "Ability";
+    //public static string BigSkill = "BigSkill";
+}

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

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

+ 0 - 11
第四期.txt

@@ -1,16 +1,5 @@
 充值返礼
 {
-  注意返礼的开始时间和结束时间
-  购买礼包前要拉取到返礼表
-  购买成功后可能获得的内容有
-  {
-    金币
-    钻石
-    礼包
-    花朵
-    服装(如果已拥有 需要进行价值转换0.25)
-    开垦土地
-  }
   反礼后要弹出提示框
 }