Browse Source

修复种花动画Bug

LiuQilin 7 years ago
parent
commit
7eca2b7c9f

+ 15 - 3
Assets/Resource/Animations/FlashLight.anim

@@ -119,11 +119,17 @@ AnimationClip:
         inSlope: Infinity
         outSlope: Infinity
         tangentMode: 103
+      - serializedVersion: 2
+        time: 1.1666666
+        value: 0
+        inSlope: Infinity
+        outSlope: Infinity
+        tangentMode: 103
       m_PreInfinity: 2
       m_PostInfinity: 2
       m_RotationOrder: 4
     attribute: m_IsActive
-    path: Particle System
+    path: ParticleSystem
     classID: 1
     script: {fileID: 0}
   m_PPtrCurves: []
@@ -158,7 +164,7 @@ AnimationClip:
       classID: 1
       customType: 0
       isPPtrCurve: 0
-    - path: 922205677
+    - path: 3400171240
       attribute: 2086281974
       script: {fileID: 0}
       classID: 1
@@ -407,11 +413,17 @@ AnimationClip:
         inSlope: Infinity
         outSlope: Infinity
         tangentMode: 103
+      - serializedVersion: 2
+        time: 1.1666666
+        value: 0
+        inSlope: Infinity
+        outSlope: Infinity
+        tangentMode: 103
       m_PreInfinity: 2
       m_PostInfinity: 2
       m_RotationOrder: 4
     attribute: m_IsActive
-    path: Particle System
+    path: ParticleSystem
     classID: 1
     script: {fileID: 0}
   m_EulerEditorCurves: []

+ 1 - 1
Assets/Resource/Animations/Flower.controller.meta

@@ -4,5 +4,5 @@ timeCreated: 1489543570
 licenseType: Pro
 NativeFormatImporter:
   userData: 
-  assetBundleName: 
+  assetBundleName: ui
   assetBundleVariant: 

File diff suppressed because it is too large
+ 181 - 873
Assets/Resource/Logo.unity


+ 1 - 0
Assets/Resource/Prefab/Object/DebugMode.prefab

@@ -258,6 +258,7 @@ MonoBehaviour:
   - {fileID: 1178346060137818, guid: e2d62becad3f170428db59673f313354, type: 2}
   - {fileID: 1422722603004606, guid: f66999d8c3be4ff46b7dbde0417af018, type: 2}
   - {fileID: 1405543926191242, guid: c4b5d8c946975864492b168f89e68abc, type: 2}
+  - {fileID: 21300000, guid: 800334d458bc8994eb9936152a80ef43, type: 3}
   ConfigList:
   - {fileID: 4900000, guid: f039d2181a3e9ea418ff5f211730b175, type: 3}
   - {fileID: 4900000, guid: ff8c2496a2cfe6e4eaa5262e9d7b0b2a, type: 3}

File diff suppressed because it is too large
+ 645 - 17
Assets/Resource/Prefab/PrefabUI/Canvas.prefab


+ 1 - 1
Assets/Resource/Sprite/Editor/Garden/未开垦图标.png.meta

@@ -96,5 +96,5 @@ TextureImporter:
     outline: []
   spritePackingTag: 
   userData: 
-  assetBundleName: 
+  assetBundleName: scene
   assetBundleVariant: 

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

@@ -189,6 +189,7 @@
     <AAa_Value desc=""><![CDATA[小时]]></AAa_Value>
     <AAb_Tit desc=""><![CDATA[人数]]></AAb_Tit>
     <AAb_Value desc=""><![CDATA[人]]></AAb_Value>
+    <AB_RechargeGiftTitle desc=""><![CDATA[恭喜获得充值返礼]]></AB_RechargeGiftTitle>
     <Loading desc=""><![CDATA[加载中]]></Loading>
     <LoadFailed desc=""><![CDATA[加载失败]]></LoadFailed>
     <LoadSucceed desc=""><![CDATA[加载成功]]></LoadSucceed>

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

@@ -189,6 +189,7 @@
     <AAa_Value desc=""><![CDATA[小時]]></AAa_Value>
     <AAb_Tit desc=""><![CDATA[人數]]></AAb_Tit>
     <AAb_Value desc=""><![CDATA[人]]></AAb_Value>
+    <AB_RechargeGiftTitle desc=""><![CDATA[恭喜獲得充值返禮]]></AB_RechargeGiftTitle>
     <Loading desc=""><![CDATA[載入中]]></Loading>
     <LoadFailed desc=""><![CDATA[載入失敗]]></LoadFailed>
     <LoadSucceed desc=""><![CDATA[載入成功]]></LoadSucceed>

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

@@ -186,9 +186,10 @@ Program 水怪
     <AA_NoEnoughDiamond desc=""><![CDATA[Not enough Diamonds]]></AA_NoEnoughDiamond>
     <AA_Create desc=""><![CDATA[Create]]></AA_Create>
     <AAa_Tit desc=""><![CDATA[Hours]]></AAa_Tit>
-    <AAa_Value desc=""><![CDATA[]]></AAa_Value>
+    <AAa_Value desc=""><![CDATA[Hour]]></AAa_Value>
     <AAb_Tit desc=""><![CDATA[Members]]></AAb_Tit>
-    <AAb_Value desc=""><![CDATA[]]></AAb_Value>
+    <AAb_Value desc=""><![CDATA[People]]></AAb_Value>
+    <AB_RechargeGiftTitle desc=""><![CDATA[You got a recharge gift]]></AB_RechargeGiftTitle>
     <Loading desc=""><![CDATA[Loading]]></Loading>
     <LoadFailed desc=""><![CDATA[Failed]]></LoadFailed>
     <LoadSucceed desc=""><![CDATA[Success]]></LoadSucceed>

BIN
Assets/Resource/Xlsx/language_config.xlsx


+ 1 - 1
Assets/Script/Editor/EditorAuxiliary.cs

@@ -29,7 +29,7 @@ public class EditorAuxiliary : Editor
 
         if (GUILayout.Button("Temp"))
         {
-            
+            //Animation animation;animation.clip.SetCurve();
         }
 
         if (GUILayout.Button("PrintBounds"))

+ 9 - 0
Assets/Script/Function.meta

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

+ 2 - 0
Assets/Script/Label/LanguageLabel.cs

@@ -5,6 +5,7 @@ using UnityEngine;
 
 public class LanguageLabel
 {
+	
 	public static string UI = "UI";
 	public static string UI__C_MiniGameLab = "UI__C_MiniGameLab";
 	public static string UI__C_GardenLab = "UI__C_GardenLab";
@@ -186,6 +187,7 @@ public class LanguageLabel
 	public static string UI__AAa_Value = "UI__AAa_Value";
 	public static string UI__AAb_Tit = "UI__AAb_Tit";
 	public static string UI__AAb_Value = "UI__AAb_Value";
+	public static string UI__AB_RechargeGiftTitle = "UI__AB_RechargeGiftTitle";
 	public static string UI__Loading = "UI__Loading";
 	public static string UI__LoadFailed = "UI__LoadFailed";
 	public static string UI__LoadSucceed = "UI__LoadSucceed";

+ 13 - 0
Assets/Script/Label/ObjectLabel.cs

@@ -5,6 +5,7 @@ using UnityEngine;
 
 public class ObjectLabel
 {
+	
 	public static string Canvas = "Canvas";
 	public static string E_Debug = "E_Debug";
 	public static string E_Group = "E_Group";
@@ -721,5 +722,17 @@ public class ObjectLabel
 	public static string U_Group = "U_Group";
 	public static string U_Icon = "U_Icon";
 	public static string U_Lab = "U_Lab";
+	public static string AB_RechargeGiftPanel = "AB_RechargeGiftPanel";
+	public static string AB_PanelBK = "AB_PanelBK";
+	public static string AB_Confirm = "AB_Confirm";
+	public static string AB_ConfirmText = "AB_ConfirmText";
+	public static string AB_RotateIcon = "AB_RotateIcon";
+	public static string AB_Title = "AB_Title";
+	public static string AB_Description = "AB_Description";
+	public static string AB_AwardImages = "AB_AwardImages";
+	public static string AB_AwardImage0 = "AB_AwardImage0";
+	public static string AB_AwardImage1 = "AB_AwardImage1";
+	public static string AB_AwardImage2 = "AB_AwardImage2";
+	public static string AB_FlowerAwardImage = "AB_FlowerAwardImage";
 	//Mark
 }

+ 2 - 1
Assets/Script/Label/ResourceLabel.cs

@@ -50,8 +50,8 @@ public class ResourceLabel
     public static string Tutorial = "Tutorial";
     public static string DressRoom = "DressRoom";
 
-    public static string RobotConfig = "robot_config";
     public static string Expression = "Expression";
+    public static string Slot = "未开垦图标";
     public static string SystemChest = "系统宝箱";
     public static string DiamondChest = "钻石宝箱";
     public static string NumberChest = "数字宝箱";
@@ -67,6 +67,7 @@ public class ResourceLabel
     public static string BigGold = "大金币图标";
     public static string MinigameRateStar = "游戏等级评分";
 
+    public static string RobotConfig = "robot_config";
     public static string StandTex = "stand_tex";
     public static string StandSke = "stand_ske";
     public static string StandTexture = "stand_texture";

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

@@ -208,7 +208,7 @@ public class HttpManager : Regist
             urlData,
             data =>
             {
-                if (data == " {\"error\":0}")
+                if (data == "{\"error\":0}")
                 {
                     succeedCallback.Invoke();
                 }

+ 16 - 9
Assets/Script/Manage/IAPManager.cs

@@ -275,15 +275,22 @@ public class IAPManager : MonoBehaviour, IStoreListener
             return;
         }
 
-        HttpManager.GetThanksGiftInfo
-        (
-            jData =>
-            {
-                ThanksGift.Init(jData);
-                Purchase(str);
-            },
-            () => { Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)); }
-        );
+        if (RechargeGiftManager.Inited)
+        {
+            Purchase(str);
+        }
+        else
+        {
+            HttpManager.GetThanksGiftInfo
+            (
+                jData =>
+                {
+                    RechargeGiftManager.Init(jData);
+                    Purchase(str);
+                },
+                () => { Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)); }
+            );
+        }
     }
 
     private static void Purchase(string str)

+ 7 - 7
Assets/Script/Manage/NickNameManager.cs

@@ -107,13 +107,13 @@ public class NickNameManager : Regist
 	    ResourceManager.Get<CanvasGroup>(ObjectLabel.T_NickNameBK).interactable = false;
 
 		if (ChectInputFieldValue ())
-        {
-            HttpManager.SetNickName
-                (
-                    NicknameInputField.text,
-                    ResetSucceed,
-                    ResetFailed
-                );
+		{
+		    HttpManager.SetNickName
+		    (
+		        NicknameInputField.text,
+		        ResetSucceed,
+		        ResetFailed
+		    );
 		}
 		else
 		{

+ 291 - 66
Assets/Script/Manage/RechargeGiftManager.cs

@@ -3,9 +3,10 @@ using System.Collections;
 using System.Collections.Generic;
 using LitJson;
 using UnityEngine;
+using UnityEngine.UI;
 using Random = UnityEngine.Random;
 
-public class RechargeGiftManager
+public class RechargeGiftJsonLabel
 {
     public static string PackID = "packid";
     public static string StartTime = "starttime";
@@ -52,38 +53,46 @@ public class RechargeGift
         /// <returns>true-全部领完</returns>
         public abstract bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo);
 
-        protected void GetGiftAward(GiftType type, int value)
+        protected void GetGiftAward(GiftType type, int value, out KV<GiftType, int> giftAwardInfo)
         {
             if (type == GiftType.开垦土地)
             {
+                AudioManager.PlayClip(ResourceLabel.CurrentClip);
                 for (int i = 0; i < value; i++)
                 {
                     GardenManager.UnlockSlot();
                     int extraSlot = ConfigManager.GetIntFormConfig(PlayerConfigLabel.ExtraSlot);
                     ConfigManager.SaveIntToConfig(PlayerConfigLabel.ExtraSlot, extraSlot + 1);
-                    Debug.LogWarning($"{type}");
                 }
+                giftAwardInfo.Key = type;
+                giftAwardInfo.Value = value;
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
             }
             else if (type == GiftType.服装)
             {
                 CloseItem closeItem = PlayerManager.CloseItemDictionary[value];
                 if (closeItem.IsBought)
                 {
-                    ExchangeInfo info =
-                    closeItem.GetExchangeValue(CloseExchangeRatio, StaticsManager.ConsumeModule.Gift);
-                    Debug.LogWarning($"{type} {info.Current} {info.Value}");
+                    AudioManager.PlayClip(ResourceLabel.CurrentClip);
+                    ExchangeInfo info = closeItem.GetExchangeValue(CloseExchangeRatio, StaticsManager.ConsumeModule.Gift);
+                    giftAwardInfo.Key = CurrentToGiftType(info.Current);
+                    giftAwardInfo.Value = (int) info.Value;
                 }
                 else
                 {
                     closeItem.OnBuySucceed();
-                    Debug.LogWarning($"{type} {value}");
+                    giftAwardInfo.Key = type;
+                    giftAwardInfo.Value = value;
                 }
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
             }
             else if (type == GiftType.礼包)
             {
                 string packID = SkillConfigLabel.GetFullID(SkillType.Pack, value);
                 (Manager.SkillDictionary[packID] as Pack).OnBuySucceed(false);
-                Debug.LogWarning($"{type} {SkillConfigLabel.Pack + value}");
+                giftAwardInfo.Key = type;
+                giftAwardInfo.Value = value;
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
             }
             else if (type == GiftType.精灵)
             {
@@ -91,36 +100,72 @@ public class RechargeGift
                 Ability ability = Manager.SkillDictionary[abilityID] as Ability;
                 if (ability.ItemStatus == SkillStatus.Lock)
                 {
-                    ExchangeInfo info =
-                    ability.GetUnlockAheadExchangeValue(AbilityExchangeRatio, StaticsManager.ConsumeModule.Gift);
-                    Debug.LogWarning($"{type} {info.Current} {info.Value}");
+                    AudioManager.PlayClip(ResourceLabel.CurrentClip);
+                    ExchangeInfo info = ability.GetUnlockAheadExchangeValue(AbilityExchangeRatio, StaticsManager.ConsumeModule.Gift);
+                    giftAwardInfo.Key = CurrentToGiftType(info.Current);
+                    giftAwardInfo.Value = (int)info.Value;
                 }
                 else if (ability.ItemStatus == SkillStatus.UnLock)
                 {
                     ability.UnlockSucceed();
-                    Debug.LogWarning($"{type} {SkillConfigLabel.Pack + value}");
+                    giftAwardInfo.Key = type;
+                    giftAwardInfo.Value = value;
                 }
                 else if (ability.ItemStatus == SkillStatus.Upgrade)
                 {
                     ability.UpgradeSucceed();
-                    Debug.LogWarning($"{type} {SkillConfigLabel.Pack + value}");
+                    giftAwardInfo.Key = type;
+                    giftAwardInfo.Value = value;
+                }
+                else
+                {
+                    throw new Exception();
                 }
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
             }
             else if (type == GiftType.花朵)
             {
                 FlowerInfo flowerInfo = GardenManager.FlowerInfoDictionary[value];
                 flowerInfo.Add();
-                Debug.LogWarning($"{type} {flowerInfo.Name}");
+                giftAwardInfo.Key = type;
+                giftAwardInfo.Value = value;
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
             }
             else if (type == GiftType.金币)
             {
+                AudioManager.PlayClip(ResourceLabel.CurrentClip);
                 Manager.AddCoin(value, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Gift);
-                Debug.LogWarning($"{type} {value}");
+                giftAwardInfo.Key = type;
+                giftAwardInfo.Value = value;
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
             }
             else if (type == GiftType.钻石)
             {
+                AudioManager.PlayClip(ResourceLabel.CurrentClip);
                 Manager.AddDiamond(value, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Gift);
-                Debug.LogWarning($"{type} {value}");
+                giftAwardInfo.Key = type;
+                giftAwardInfo.Value = value;
+                Debug.LogWarning($"{giftAwardInfo.Key} {giftAwardInfo.Value}");
+            }
+            else
+            {
+                throw new Exception();
+            }
+        }
+
+        protected GiftType CurrentToGiftType(Current current)
+        {
+            if (current == Current.Coin)
+            {
+                return GiftType.金币;
+            }
+            else if (current == Current.Diamond)
+            {
+                return GiftType.钻石;
+            }
+            else
+            {
+                throw new Exception();
             }
         }
     }
@@ -132,14 +177,12 @@ public class RechargeGift
         public SingleGiftAward(GiftType giftType, int value) : base(giftType)
         {
             Value = value;
-            Debug.Log($"{giftType} {value}");
+            //Debug.Log($"{giftType} {value}");
         }
 
         public override bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo)
         {
-            GetGiftAward(GiftType, Value);
-            giftAwardInfo.Key = GiftType;
-            giftAwardInfo.Value = Value;
+            GetGiftAward(GiftType, Value, out giftAwardInfo);
             return true;
         }
     }
@@ -151,14 +194,12 @@ public class RechargeGift
         public MultipleGiftAward(GiftType giftType, List<int> values) : base(giftType)
         {
             Values = values;
-            Debug.Log($"{giftType} {Auxiliary.IntsToString(Values)}");
+            //Debug.Log($"{giftType} {Auxiliary.IntsToString(Values)}");
         }
 
         public override bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo)
         {
-            GetGiftAward(GiftType, Values[0]);
-            giftAwardInfo.Key = GiftType;
-            giftAwardInfo.Value = Values[0];
+            GetGiftAward(GiftType, Values[0], out giftAwardInfo);
             Values.RemoveAt(0);
             if (Values.Count > 0)
             {
@@ -181,21 +222,24 @@ public class RechargeGift
         {
             StartIndex = startIndex;
             EndIndex = endIndex;
-            Debug.Log($"{giftType} {StartIndex} {EndIndex}");
+            //Debug.Log($"{giftType} {StartIndex} {EndIndex}");
         }
 
         public override bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo)
         {
             int value = Random.Range(StartIndex, EndIndex + 1);
-            GetGiftAward(GiftType, value);
-            giftAwardInfo.Key = GiftType;
-            giftAwardInfo.Value = value;
+            GetGiftAward(GiftType, value, out giftAwardInfo);
             return true;
         }
     }
 
     #region Config
 
+    public int RemainGiftAward
+    {
+        get { return GiftAwards.Count; }
+    }
+
     private DateTime StartDate;
     private DateTime EndDate;
     private List<GiftAward> GiftAwards = new List<GiftAward>();
@@ -205,50 +249,50 @@ public class RechargeGift
     public RechargeGift(JsonData jsonData)
     {
         //Debug.Log(jsonData.ToJson());
-        string label = RechargeGiftManager.TypeDictionary[GiftType.金币];
+        string label = RechargeGiftJsonLabel.TypeDictionary[GiftType.金币];
         string valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.金币, valueStr));
         }
-        label = RechargeGiftManager.TypeDictionary[GiftType.钻石];
+        label = RechargeGiftJsonLabel.TypeDictionary[GiftType.钻石];
         valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.钻石, valueStr));
         }
-        label = RechargeGiftManager.TypeDictionary[GiftType.礼包];
+        label = RechargeGiftJsonLabel.TypeDictionary[GiftType.礼包];
         valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.礼包, valueStr));
         }
-        label = RechargeGiftManager.TypeDictionary[GiftType.花朵];
+        label = RechargeGiftJsonLabel.TypeDictionary[GiftType.花朵];
         valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.花朵, valueStr));
         }
-        label = RechargeGiftManager.TypeDictionary[GiftType.服装];
+        label = RechargeGiftJsonLabel.TypeDictionary[GiftType.服装];
         valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.服装, valueStr));
         }
-        label = RechargeGiftManager.TypeDictionary[GiftType.开垦土地];
+        label = RechargeGiftJsonLabel.TypeDictionary[GiftType.开垦土地];
         valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.开垦土地, valueStr));
         }
-        label = RechargeGiftManager.TypeDictionary[GiftType.精灵];
+        label = RechargeGiftJsonLabel.TypeDictionary[GiftType.精灵];
         valueStr = jsonData[label].ToString();
-        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        if (valueStr != RechargeGiftJsonLabel.UnvalidValueStr)
         {
             GiftAwards.AddRange(ParseAllGiftAward(GiftType.精灵, valueStr));
         }
-        StartDate = DateTime.Parse(jsonData[RechargeGiftManager.StartTime].ToString());
-        EndDate = DateTime.Parse(jsonData[RechargeGiftManager.EndTime].ToString());
+        StartDate = DateTime.Parse(jsonData[RechargeGiftJsonLabel.StartTime].ToString());
+        EndDate = DateTime.Parse(jsonData[RechargeGiftJsonLabel.EndTime].ToString());
         //Debug.LogWarning(StartDate);
         //Debug.LogWarning(EndDate);
     }
@@ -296,7 +340,7 @@ public class RechargeGift
     }
 
 
-    public bool IsGiftAvailable()
+    public bool IsAwardAvailable()
     {
         if (HttpManager.CurrentDateTime > EndDate)
         {
@@ -336,13 +380,28 @@ public class RechargeGift
     }
 }
 
-public class ThanksGift
+public class RechargeGiftManager
 {
     #region Config
 
-    private static bool Inited;
+    public static bool Inited;
+
     private static Dictionary<int, RechargeGift> GiftDictionary = new Dictionary<int, RechargeGift>();
 
+    private static string AmountTextPrefix = "x";
+    private static RechargeGift CurrentRechargeGift;
+
+    private static Text Title;
+    private static Text Description;
+    private static Text ConfirmButtonText;
+    private static Image AwardImage0;
+    private static Image AwardImage1;
+    private static Image AwardImage2;
+    private static Image FlowerAwardImage;
+    private static Button ConfirmButton;
+    private static Transform PanelBK;
+    private static List<Image> AwardImages = new List<Image>();
+
     #endregion
 
     public static void Init(JsonData jsonData)
@@ -351,39 +410,205 @@ public class ThanksGift
         Inited = true;
         for (int i = 0; i < jsonData.Count; i++)
         {
-            int packID = (int) jsonData[i][RechargeGiftManager.PackID];
+            int packID = (int) jsonData[i][RechargeGiftJsonLabel.PackID];
             RechargeGift rechargeGift = new RechargeGift(jsonData[i]);
             GiftDictionary.Add(packID, rechargeGift);
         }
+
+        Title = ResourceManager.Get<Text>(ObjectLabel.AB_Title);
+        Description = ResourceManager.Get<Text>(ObjectLabel.AB_Description);
+        ConfirmButtonText = ResourceManager.Get<Text>(ObjectLabel.AB_ConfirmText);
+        AwardImage0 = ResourceManager.Get<Image>(ObjectLabel.AB_AwardImage0);
+        AwardImage1 = ResourceManager.Get<Image>(ObjectLabel.AB_AwardImage1);
+        AwardImage2 = ResourceManager.Get<Image>(ObjectLabel.AB_AwardImage2);
+        FlowerAwardImage = ResourceManager.Get<Image>(ObjectLabel.AB_FlowerAwardImage);
+        ConfirmButton = ResourceManager.Get<Button>(ObjectLabel.AB_Confirm);
+        PanelBK = ResourceManager.Get(ObjectLabel.AB_PanelBK);
+        AwardImages.Add(AwardImage0);
+        AwardImages.Add(AwardImage1);
+        AwardImages.Add(AwardImage2);
+
+        PanelBK.CreateTweenCG(0, 1, 0.25f, false, true, Curve.EaseOutQuad);
+        ConfirmButton.onClick.AddListener(() => GetNextRechargeGiftAward(CurrentRechargeGift));
+
+        LanguageManager.Add(Title, new MulLanStr(LanguageLabel.UI__AB_RechargeGiftTitle));
+        LanguageManager.Add(ConfirmButtonText, new MulLanStr(LanguageLabel.Common__Confirm));
     }
 
-    public static void GetAllGift(int packID)
+    public static void GetAllRechargeGiftAward(int packID)
     {
-        if (!Inited)
+        if (!GiftDictionary.ContainsKey(packID))
         {
-            HttpManager.GetThanksGiftInfo
-            (
-                jData =>
-                {
-                    Init(jData);
-                    getGift(packID);
-                },
-                () => Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)
-                )
-            );
+            return;
+        }
+
+        CurrentRechargeGift = GiftDictionary[packID];
+
+        if (!CurrentRechargeGift.IsAwardAvailable())
+        {
+            return;
+        }
+
+        PanelBK.TweenForCG();
+        GetNextRechargeGiftAward(CurrentRechargeGift);
+    }
+
+    private static void GetNextRechargeGiftAward(RechargeGift rechargeGift)
+    {
+        if (rechargeGift.RemainGiftAward == 0)
+        {
+            PanelBK.TweenBacCG();
         }
         else
         {
-            getGift(packID);
+            KV<RechargeGift.GiftType, int> awardInfo;
+            rechargeGift.GetOneGiftAward(out awardInfo);
+            SetupRechargeGiftAwardUI(awardInfo);
         }
     }
 
-    private static void getGift(int packID)
+    private static void SetupRechargeGiftAwardUI(KV<RechargeGift.GiftType, int> awardInfo)
     {
-        if (GiftDictionary.ContainsKey(packID))
-        { 
-            //RechargeGift rechargeGift = GiftDictionary[packID];
-            //rechargeGift.GetOneGiftAward();
+        if (awardInfo.Key == RechargeGift.GiftType.花朵)
+        {
+            AwardImages.Remove(FlowerAwardImage);
+            AwardImages.Insert(0 ,FlowerAwardImage);
+        }
+        else
+        {
+            AwardImages.Remove(FlowerAwardImage);
+            AwardImages.Add(FlowerAwardImage);
+        }
+
+        if (awardInfo.Key == RechargeGift.GiftType.金币)
+        {
+            SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 0.75f, 0.75f);
+            Description.text = AmountTextPrefix + awardInfo.Value;
+        }
+        else if (awardInfo.Key == RechargeGift.GiftType.钻石)
+        {
+            SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 0.75f, 0.75f);
+            Description.text = AmountTextPrefix + awardInfo.Value;
+        }
+        else if (awardInfo.Key == RechargeGift.GiftType.花朵)
+        {
+            FlowerInfo flowerInfo = (FlowerInfo) SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 0.3f, 0.3f);
+            Description.text = flowerInfo.Name;
+        }
+        else if (awardInfo.Key == RechargeGift.GiftType.精灵)
+        {
+            SkillRoot skillRoot = (SkillRoot) SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 0.4f, 0.4f);
+            Description.text = skillRoot.Name;
+        }
+        else if (awardInfo.Key == RechargeGift.GiftType.服装)
+        {
+            CloseItem closeItem = (CloseItem) SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 1f, 1f);
+            Description.text = closeItem.Name;
+        }
+        else if (awardInfo.Key == RechargeGift.GiftType.礼包)
+        {
+            SkillRoot skillRoot = (SkillRoot) SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 0.4f, 0.4f);
+            Description.text = skillRoot.Name;
+        }
+        else if (awardInfo.Key == RechargeGift.GiftType.开垦土地)
+        {
+            SetupRechargeGiftAwardUI(awardInfo.Key, awardInfo.Value, AwardImages, 0.4f, 0.4f);
+            Description.text = AmountTextPrefix + awardInfo.Value;
+        }
+        else
+        {
+            throw new Exception();
+        }
+    }
+
+    private static object SetupRechargeGiftAwardUI(RechargeGift.GiftType type, int id, List<Image> images, float deltaSizeX, float deltaSizeY)
+    {
+        if (type == RechargeGift.GiftType.花朵)
+        {
+            for (int i = 1; i < images.Count; i++)
+            {
+                images[i].transform.localPosition = new Vector3();
+            }
+        }
+        else
+        {
+            for (int i = 0; i < images.Count - 1; i++)
+            {
+                images[i].transform.localPosition = new Vector3();
+            }
+        }
+
+        for (int i = 0; i < images.Count; i++)
+        {
+            images[i].transform.SetActive(false);
+        }
+
+        if (type == RechargeGift.GiftType.金币)
+        {
+            images[0].transform.SetActive(true);
+            images[0].sprite = ResourceManager.LoadSprite(ResourceLabel.Gold, Folder.Atlas);
+            images[0].SetNativeSize();
+            images[0].rectTransform.Resize(true, deltaSizeX, deltaSizeY);
+            return null;
+        }
+        else if (type == RechargeGift.GiftType.钻石)
+        {
+            images[0].transform.SetActive(true);
+            images[0].sprite = ResourceManager.LoadSprite(ResourceLabel.Diamond, Folder.Atlas);
+            images[0].SetNativeSize();
+            images[0].rectTransform.Resize(true, deltaSizeX, deltaSizeY);
+            return null;
+        }
+        else if (type == RechargeGift.GiftType.花朵)
+        {
+            FlowerInfo flowerInfo = GardenManager.FlowerInfoDictionary[id];
+            images[0].transform.SetActive(true);
+            images[0].sprite = flowerInfo.Icon;
+            images[0].SetNativeSize();
+            images[0].rectTransform.Resize(true, deltaSizeX, deltaSizeY);
+            return flowerInfo;
+        }
+        else if (type == RechargeGift.GiftType.精灵)
+        {
+            string abilityFullId = SkillRoot.AbilityFullIDPrefix + id;
+            SkillRoot skillRoot = Manager.SkillDictionary[abilityFullId];
+            images[0].transform.SetActive(true);
+            images[0].sprite = skillRoot.Icon;
+            images[0].SetNativeSize();
+            images[0].rectTransform.Resize(true, deltaSizeX, deltaSizeY);
+            return skillRoot;
+        }
+        else if (type == RechargeGift.GiftType.服装)
+        {
+            images[0].SetNativeSize();
+            images[1].SetNativeSize();
+            images[2].SetNativeSize();
+            CloseItem closeItem = PlayerManager.CloseItemDictionary[id];
+            float newSize = closeItem.PixelSize / closeItem.Sprites[0].rect.width * deltaSizeX;
+            closeItem.SetupUI(newSize, new Vector2(), images[0], images[1], images[2]);
+            return closeItem;
+        }
+        else if (type == RechargeGift.GiftType.礼包)
+        {
+            string packFullId = SkillRoot.PackFullIDPrefix + id;
+            SkillRoot skillRoot = Manager.SkillDictionary[packFullId];
+            images[0].transform.SetActive(true);
+            images[0].sprite = skillRoot.Icon;
+            images[0].SetNativeSize();
+            images[0].rectTransform.Resize(true, deltaSizeX, deltaSizeY);
+            return skillRoot;
+        }
+        else if (type == RechargeGift.GiftType.开垦土地)
+        {
+            images[0].transform.SetActive(true);
+            images[0].sprite = ResourceManager.LoadSprite(ResourceLabel.Slot, Folder.Scene);
+            images[0].SetNativeSize();
+            images[0].rectTransform.Resize(true, deltaSizeX, deltaSizeY);
+            return null;
+        }
+        else
+        {
+            throw new Exception();
         }
     }
 }

+ 1 - 3
Assets/Script/Object/Player.cs

@@ -102,7 +102,7 @@ public class CloseItem
 
     public string Name
     {
-        get { return LabelUtility.CombineLanguageLabel(LanguageLabel.DressRoom, FullID); }
+        get { return Language.GetStr(LabelUtility.CombineLanguageLabel(LanguageLabel.DressRoom, FullID)); }
     }
 
     public static string IDPrefix = "Armature";
@@ -424,7 +424,6 @@ public class CloseItem
             icon1.SetActive(true);
 
             icon1.sprite = Sprites[1];
-
             icon1.Resize(true, new Vector2(newSize, newSize));
 
             icon1.SetAlpha(SpriteAlpha);
@@ -436,7 +435,6 @@ public class CloseItem
             icon3.SetActive(true);
 
             icon3.sprite = Sprites[2];
-
             icon3.Resize(true, new Vector2(newSize, newSize));
 
             icon3.SetAlpha(SpriteAlpha);

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

@@ -20,9 +20,9 @@ public class Ability : SkillRoot
         get { return UnlockAheadBaseAmt + (UnlockLv - Manager.GardenLevel - 1)*UnlockAheadDeltaAmt; }
     }
 
-    public override string FullIDPrefix
+    public override string FullID
     {
-        get { return "Ability"; }
+        get { return AbilityFullIDPrefix + ID; }
     }
 
     public static string ElfAnim = "Elf";

+ 3 - 3
Assets/Script/Object/Skill/Pack.cs

@@ -12,11 +12,11 @@ public class Pack : SkillRoot
 
     #region 配置
 
-    public override string FullIDPrefix
+    public override string FullID
     {
         get
         {
-            return "Pack";
+            return PackFullIDPrefix + ID;
         }
     }
 
@@ -382,7 +382,7 @@ public class Pack : SkillRoot
 
         if (getGift)
         {
-            ThanksGift.GetAllGift(ID);
+            RechargeGiftManager.GetAllRechargeGiftAward(ID);
         }
     }
 

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

@@ -18,9 +18,9 @@ public class Skill : SkillRoot
     {
         get { return UnlockAheadBaseAmt + (UnlockLv - Manager.GardenLevel - 1) * UnlockAheadDeltaAmt; }
     }
-    public override string FullIDPrefix
+    public override string FullID
     {
-        get { return "Skill"; }
+        get { return SkillFullIDPrefix + ID; }
     }
 
     public bool CoolLock;

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

@@ -60,6 +60,10 @@ public abstract class SkillRoot
 {
     #region Config
 
+    public static string SkillFullIDPrefix = "Skill";
+    public static string AbilityFullIDPrefix = "Ability";
+    public static string PackFullIDPrefix = "Pack";
+
     #region 配置
 
     public Sprite Icon
@@ -79,16 +83,12 @@ public abstract class SkillRoot
         }
     }
 
-    public string FullID
+    public virtual string FullID
     {
-        get { return FullIDPrefix + ID; }
+        get { throw new Exception();}
     }
     public int ID;
 
-    public virtual string FullIDPrefix
-    {
-        get { throw new Exception(); }
-    }
     public virtual string Name
     {
         get

+ 1 - 1
Assets/Script/Object/Slot.cs

@@ -7,7 +7,7 @@ using System.Collections.Generic;
 public class SlotLabel
 {
     public static string Slot = "Slot";
-    public static string SlotArrow = "SlotArrorw";
+    public static string SlotArrow = "SlotArrow";
 }
 
 public class Slot : Regist

+ 40 - 92
Assets/Script/Tool/Auxiliary.cs

@@ -131,6 +131,10 @@ public class Auxiliary : Regist
         Instance = this;
     }
 
+    //private int TypeID = 0;
+    private float DeltaSize = 0.5f;
+    //private AwardUIType Type;
+    private List<Image> AwardImages = new List<Image>();
     private void Update()
     {
         #region 调试
@@ -144,110 +148,54 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.Space))
         {
-            HttpManager.GetThanksGiftInfo(ThanksGift.Init, () => Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)));
+            HttpManager.GetThanksGiftInfo(RechargeGiftManager.Init, () => Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)));
         }
 
-        //if (Input.GetKeyDown(KeyCode.A))
-        //{
-        //    URLRequestData urlData = new URLRequestData();
-
-        //    urlData.Add("i", "");
-
-        //    URLRequest.CreateURLRequest(false, ManaServer.NewBaseURL + "/user/rand", urlData, data => { Debug.Log(data.ToJson()); }, URLRequest.Method.POST);
-
-        //    ManaSocial.UpdatePage(true);
-        //    PlazaRoomMge.DownloadRoomData(0);
-        //    DatabaseManager.GetRoomList(-1);
-
-        //    ManaServer.NotificationIndex = ManaData.GetPlayerInt("NotificationIndex") + 1;
-        //    ManaCenter.OfflineLock = true;
-        //    ManaSign.ShowOfflinePanel();
-
-        //    ManaTutorial.EnterC1();
-        //}
+        if (Input.GetKeyDown(KeyCode.A))
+        {
+            Image AwardImage0 = ResourceManager.Get<Image>(ObjectLabel.AB_AwardImage0);
+            Image AwardImage1 = ResourceManager.Get<Image>(ObjectLabel.AB_AwardImage1);
+            Image AwardImage2 = ResourceManager.Get<Image>(ObjectLabel.AB_AwardImage2);
+            AwardImages.Add(AwardImage0);
+            AwardImages.Add(AwardImage1);
+            AwardImages.Add(AwardImage2);
+        }
 
-        //if (Input.GetKeyDown(KeyCode.S))
-        //{
-        //    ManaTutorial.EnterD1();
-        //}
+        if (Input.GetKeyDown(KeyCode.S))
+        {
+            DeltaSize += 0.05f;
+            Debug.Log(DeltaSize);
+        }
 
-        //if (Input.GetKeyDown(KeyCode.D))
-        //{
-        //    SFSManager.GardenSmartFox.PlazaRoomManager.BeginEnterPlazaRoom();
-        //}
+        if (Input.GetKeyDown(KeyCode.D))
+        {
+            DeltaSize -= 0.05f;
+            Debug.Log(DeltaSize);
+        }
 
         if (Input.GetKeyDown(KeyCode.Z))
         {
             Manager.MinigameCDTimer = 0;
-            TutorialManager.MemoryMinigameTutorial = true;
+            //TypeID++;
+            //Type = (AwardUIType) TypeID;
         }
 
-        //if (Input.GetKeyDown(KeyCode.X))
-        //{
-        //    GardenSmartFoxManager.GardenSmartFox.ExtensionManager.PlazaRoomExtension.SendPublicMessage("123");
-
-        //    ManaPlayer.Player.PlayAnim("newAnimation");
-
-        //    StartCoroutine(ManaServer.DownloadAllAsset(new List<string>() { "http://or5zgoeui.bkt.clouddn.com/game_icon.png", "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3853411417,2245648913&fm=26&gp=0.jpg" }, ManaServer.DownloadAllTexture));
-
-        //    ManaMiniGame.GameTimer = 45;
-
-        //    Lottery.TempTypeList = new List<int>();
-        //    Lottery.TempValueList = new List<int>();
-        //    Lottery.TempLotteryList = new List<Lottery>();
-
-        //    Lottery.EnterAnimation();
-
-        //    ManaReso.Get(PrefabLabel.Bc_LotteryItem1).TweenForEuler();
-        //    ManaReso.Get(PrefabLabel.Bc_LotteryItem2).TweenForEuler();
-        //    ManaReso.Get(PrefabLabel.Bc_LotteryItem3).TweenForEuler();
-        //}
-
-        //if (Input.GetKeyDown(KeyCode.C))
-        //{
-        //    GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SendExpression(ExpressionID.郁闷);
-
-        //    SFSObject sfsObject = new SFSObject();
-        //    sfsObject.PutInt(DataID.SenderID.GetHashString(), 0);
-        //    sfsObject.PutText(DataID.Message.GetHashString(), "123");
-
-        //    SFSObject parameter = GardenSmartFox.ConstructCommandParameter(CommandID.ReceivePublicMessage.GetHashCode(), sfsObject, -1);
-
-        //    GardenSmartFoxManager.GardenSmartFox.AddRequest(parameter, RequestType.Immediate);
-
-        //    GardenSmartFoxManager.GardenSmartFox.SmartFox.Send(new ExtensionRequest("0", sfsObject));
-
-        //    ManaPlayer.Player.PlayAnim("newAnimation1");
-
-        //    ManaReso.Get(PrefabLabel.C_Notify).TweenForCG();
-
-        //    ManaMiniGame.Score += 400;
-
-        //    ManaSign.SignTime = new DateTime(2007, 1, 1);
-        //}
-
-        //if (Input.GetKeyDown(KeyCode.V))
-        //{
-        //    ManaData.PlayerDoc.SelectSingleNode(PlayerConfigLabel.RootNode).SelectSingleNode(PlayerConfigLabel.Version).Attributes[0].Value = 6.ToString();
-        //    ManaData.PlayerNode.RemoveChild(ManaData.PlayerNode.SelectSingleNode("FlowerAmtList"));
-
-        //    Debug.Log(ManaData.GetPlayerString("FlowerList"));
-        //    Debug.Log(ManaData.GetPlayerString("FlowerAmtList"));
-
-        //    ManaPlayer.Player.PlayAnim("newAnimation2");
-
-        //    ManaPlayer.Player.Flip(PlayerDirection.Right);
-
-        //    ManaServer.MailReward mailReward = new ManaServer.MailReward("1", "pack", "4");
-        //    ManaServer.MailReward mailReward1 = new ManaServer.MailReward("1", "close", "2");
-
-        //    ManaServer.GetMainReward(mailReward);
-        //    ManaServer.GetMainReward(mailReward1);
+        if (Input.GetKeyDown(KeyCode.X))
+        {
+            MiniGameManager.GameTimer = 45;
+            //TypeID--;
+            //Type = (AwardUIType)TypeID;
+        }
 
-        //    ManaGarden.ElfTimer = 0;
+        if (Input.GetKeyDown(KeyCode.C))
+        {
+            //SetupAwardUI.Setup(Type, 1, AwardImages, DeltaSize, DeltaSize);
+        }
 
-        //    ManaServer.Time = new DateTime(2007, 1, 1);
-        //}
+        if (Input.GetKeyDown(KeyCode.V))
+        {
+            //SetupAwardUI.Setup(Type, 808, AwardImages, DeltaSize, DeltaSize);
+        }
 
         //if (Input.GetKeyDown(KeyCode.B))
         //{

+ 2 - 1
Assets/Script/Tool/LabelUtility/SerializeObject.prefab

@@ -52,6 +52,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   Script: {fileID: 11500000, guid: 1615e3353e063d443bf237fb8aade024, type: 3}
-  Languages: []
+  Languages:
+  - {fileID: 4900000, guid: 6bf784d003b5c104e94531afb827212a, type: 3}
   Prefabs:
   - {fileID: 1948781497737682, guid: 8647d80b558fa724a84d05f9e6aee9bc, type: 2}

Some files were not shown because too many files changed in this diff