Browse Source

增加充值返礼功能

LiuQilin 7 years ago
parent
commit
6bec595f8f

+ 32 - 9
Assets/AtlasUtility/Script/Test.cs

@@ -1,10 +1,14 @@
 using System.Linq;
+using System.Security.Policy;
+using Sfs2X;
+using Sfs2X.Util;
 using UnityEngine.UI;
 
 namespace AtlasUtility
 {
     using UnityEngine;
 
+    //[ExecuteInEditMode]
     public class Test : MonoBehaviour
     {
         #region Variable
@@ -19,22 +23,41 @@ namespace AtlasUtility
 
         public static Material Material;
 
+        public static int TcpPort = 9933;
+        public static string Host = "127.0.0.1";
+        public static string Zone = "Garden";
+
         #endregion
 
+        private SmartFox smartFox = new SmartFox();
         private void Start()
         {
-            if (Material == null)
+
+        }
+
+        private void Update()
+        {
+            if (Input.GetKeyDown(KeyCode.A))
             {
-                Shader shader = Shader.Find("DashGame/GrayMesh");
-                Material = new Material(shader);
-                Material.mainTexture = Texture2D;
+                ConfigData configData = new ConfigData
+                {
+                    Host = Host,
+                    Port = TcpPort,
+                    Zone = Zone
+                };
+
+                smartFox.Connect(configData);
+
+                Debug.Log("Send connect request");
             }
 
-            Mesh Mesh = SpriteUtility.CreateMesh(Sprite);
-            //Mesh.SetUVs(1, Enumerable.Repeat(new Vector2(Random.Range(0f, 1f), 0), Mesh.vertices.Length).ToList());
-            //Mesh.SetColors(Enumerable.Repeat(new Color(1, 1, 1, 0), Mesh.vertices.Length).ToList());
-            MeshFilter.mesh = Mesh;
-            MeshRenderer.sharedMaterial = Material;
+            smartFox.ProcessEvents();
+        }
+
+        private void OnApplicationQuit()
+        {
+            smartFox.Disconnect();
+            Debug.Log("Disconnect");
         }
     }
 }

+ 864 - 0
Assets/Resource/Logo.unity

@@ -91,6 +91,353 @@ NavMeshSettings:
     cellSize: 0.16666666
     accuratePlacement: 0
   m_NavMeshData: {fileID: 0}
+--- !u!1 &137375692
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 137375693}
+  - component: {fileID: 137375695}
+  - component: {fileID: 137375694}
+  m_Layer: 5
+  m_Name: AB_Image2
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &137375693
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 137375692}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 293827115}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: -0.00018310547, y: -0.000061035156}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &137375694
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 137375692}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 0}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!222 &137375695
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 137375692}
+--- !u!1 &237613534
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1113964884455462, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 237613535}
+  - component: {fileID: 237613538}
+  - component: {fileID: 237613537}
+  - component: {fileID: 237613536}
+  m_Layer: 5
+  m_Name: AB_PanelBK
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &237613535
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224172302097058620, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 237613534}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 895141462}
+  - {fileID: 1347004371}
+  - {fileID: 407138714}
+  - {fileID: 293827115}
+  m_Father: {fileID: 331604223}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 228, y: 203.3}
+  m_SizeDelta: {x: 367.3, y: 307.7}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!225 &237613536
+CanvasGroup:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 225400263960537046, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 237613534}
+  m_Enabled: 1
+  m_Alpha: 1
+  m_Interactable: 1
+  m_BlocksRaycasts: 1
+  m_IgnoreParentGroups: 0
+--- !u!114 &237613537
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 114241671986626590, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 237613534}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 21300000, guid: e093049a9d0290e479dae4debfd75096, type: 3}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!222 &237613538
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 222670006321895586, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 237613534}
+--- !u!1 &293827114
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1639923779125344, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 293827115}
+  m_Layer: 5
+  m_Name: AB_AwardIcons
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &293827115
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224322308812844832, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 293827114}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 2065864903}
+  - {fileID: 1417910468}
+  - {fileID: 137375693}
+  m_Father: {fileID: 237613535}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 13.54, y: -8.5}
+  m_SizeDelta: {x: 50, y: 50}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!1 &331604222
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1669355836427160, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 331604223}
+  - component: {fileID: 331604225}
+  - component: {fileID: 331604224}
+  m_Layer: 5
+  m_Name: AB_RechargeGiftPanel
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &331604223
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224297559150198766, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 331604222}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 237613535}
+  m_Father: {fileID: 1060092138}
+  m_RootOrder: 27
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0.000061035156, y: -0.000030517578}
+  m_SizeDelta: {x: 456, y: 382}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &331604224
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 331604222}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 3cac44ec7ca55734c9dd55ba09a4b72a, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  RegistLock: 0
+  String1: 
+  String2: 
+  Sprite: {fileID: 0}
+  TextAsset: {fileID: 0}
+  Texture: {fileID: 0}
+  Texture1: {fileID: 0}
+  Texture2: {fileID: 0}
+  Font: {fileID: 0}
+  Go: {fileID: 331604222}
+  Sprites: []
+  GoList: []
+  SrList: []
+--- !u!225 &331604225
+CanvasGroup:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 225739207546253764, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 331604222}
+  m_Enabled: 1
+  m_Alpha: 1
+  m_Interactable: 1
+  m_BlocksRaycasts: 1
+  m_IgnoreParentGroups: 0
+--- !u!1 &407138713
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1695468246749030, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 407138714}
+  - component: {fileID: 407138716}
+  - component: {fileID: 407138715}
+  m_Layer: 5
+  m_Name: AB_Description
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &407138714
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224431718277978594, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 407138713}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 237613535}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 13.54, y: -83}
+  m_SizeDelta: {x: 268.9, y: 28.3}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &407138715
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 114233664537860534, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 407138713}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.6, g: 0.10980393, b: 0.10588236, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 0e86defab91f2fb4189708f6dde11005, type: 3}
+    m_FontSize: 25
+    m_FontStyle: 0
+    m_BestFit: 1
+    m_MinSize: 2
+    m_MaxSize: 25
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 0
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: "\u5DF2\u8FBE\u5230\u6700\u5927\u79BB\u7EBF\u6536\u76CA"
+--- !u!222 &407138716
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 222261693091909018, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 407138713}
 --- !u!1 &465425181
 GameObject:
   m_ObjectHideFlags: 0
@@ -322,6 +669,309 @@ RectTransform:
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0, y: 0}
+--- !u!1 &895141461
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1842632695971680, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 895141462}
+  - component: {fileID: 895141465}
+  - component: {fileID: 895141464}
+  - component: {fileID: 895141463}
+  m_Layer: 5
+  m_Name: AB_Confirm
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &895141462
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224084476388642914, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 895141461}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 1061351862}
+  m_Father: {fileID: 237613535}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 10.34, y: -132.5}
+  m_SizeDelta: {x: 182, y: 58.974}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &895141463
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 114279168678287366, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 895141461}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Navigation:
+    m_Mode: 3
+    m_SelectOnUp: {fileID: 0}
+    m_SelectOnDown: {fileID: 0}
+    m_SelectOnLeft: {fileID: 0}
+    m_SelectOnRight: {fileID: 0}
+  m_Transition: 1
+  m_Colors:
+    m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+    m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
+    m_DisabledColor: {r: 1, g: 1, b: 1, a: 1}
+    m_ColorMultiplier: 1
+    m_FadeDuration: 0.1
+  m_SpriteState:
+    m_HighlightedSprite: {fileID: 0}
+    m_PressedSprite: {fileID: 0}
+    m_DisabledSprite: {fileID: 0}
+  m_AnimationTriggers:
+    m_NormalTrigger: Normal
+    m_HighlightedTrigger: Highlighted
+    m_PressedTrigger: Pressed
+    m_DisabledTrigger: Disabled
+  m_Interactable: 1
+  m_TargetGraphic: {fileID: 895141464}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
+      Culture=neutral, PublicKeyToken=null
+--- !u!114 &895141464
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 114232964362529302, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 895141461}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 21300000, guid: d190acd69d12a114c851133dbcb7c5f7, type: 3}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!222 &895141465
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 222477250445430222, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 895141461}
+--- !u!1001 &1060092137
+Prefab:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications:
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_RootOrder
+      value: 4
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_AnchoredPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_AnchoredPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_SizeDelta.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_SizeDelta.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_AnchorMin.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_AnchorMin.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_AnchorMax.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_AnchorMax.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_Pivot.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+        type: 2}
+      propertyPath: m_Pivot.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1948781497737682, guid: 8647d80b558fa724a84d05f9e6aee9bc, type: 2}
+      propertyPath: m_Name
+      value: Canvas (1)
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_ParentPrefab: {fileID: 100100000, guid: 8647d80b558fa724a84d05f9e6aee9bc, type: 2}
+  m_IsPrefabParent: 0
+--- !u!224 &1060092138 stripped
+RectTransform:
+  m_PrefabParentObject: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 1060092137}
+--- !u!1 &1061351861
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1151100306784368, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 1061351862}
+  - component: {fileID: 1061351864}
+  - component: {fileID: 1061351863}
+  m_Layer: 5
+  m_Name: AB_ConfirmLab
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1061351862
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224784300063284776, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1061351861}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 895141462}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1061351863
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 114597288471270962, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1061351861}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 0e86defab91f2fb4189708f6dde11005, type: 3}
+    m_FontSize: 30
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 2
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 0
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: "\u6536\u53D6"
+--- !u!222 &1061351864
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 222648853396000916, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1061351861}
 --- !u!1 &1218118077
 GameObject:
   m_ObjectHideFlags: 0
@@ -409,6 +1059,152 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1347004370
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 1020038402279328, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 1347004371}
+  - component: {fileID: 1347004373}
+  - component: {fileID: 1347004372}
+  m_Layer: 5
+  m_Name: AB_Title
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1347004371
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 224201318974070842, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1347004370}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 237613535}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 10.34, y: 66.76}
+  m_SizeDelta: {x: 235.1, y: 27}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1347004372
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 114381871023578972, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1347004370}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.6, g: 0.10980393, b: 0.10588236, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 0e86defab91f2fb4189708f6dde11005, type: 3}
+    m_FontSize: 25
+    m_FontStyle: 0
+    m_BestFit: 1
+    m_MinSize: 2
+    m_MaxSize: 25
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 0
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: "\u79BB\u5F00\u671F\u95F4\u83B7\u5F97"
+--- !u!222 &1347004373
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 222683974073095636, guid: 8647d80b558fa724a84d05f9e6aee9bc,
+    type: 2}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1347004370}
+--- !u!1 &1417910467
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 1417910468}
+  - component: {fileID: 1417910470}
+  - component: {fileID: 1417910469}
+  m_Layer: 5
+  m_Name: AB_Image1
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1417910468
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1417910467}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 293827115}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: -0.00012207031, y: -0.000061035156}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1417910469
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1417910467}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 0}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!222 &1417910470
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1417910467}
 --- !u!1 &1511433816
 GameObject:
   m_ObjectHideFlags: 0
@@ -629,3 +1425,71 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &2065864902
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 2065864903}
+  - component: {fileID: 2065864905}
+  - component: {fileID: 2065864904}
+  m_Layer: 5
+  m_Name: AB_Image0
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &2065864903
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 2065864902}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 293827115}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &2065864904
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 2065864902}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 0}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!222 &2065864905
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 2065864902}

+ 0 - 9
Assets/Script/Function.meta

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

+ 0 - 276
Assets/Script/Function/ThanksGift.cs

@@ -1,276 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using LitJson;
-using UnityEngine;
-
-public class ThanksGiftJson
-{
-    public static string PackID = "packid";
-    public static string StartTime = "starttime";
-    public static string EndTime = "endtime";
-
-    public static int UnvalidValue = 0;
-    public static string UnvalidValues = "0";
-
-    public static Dictionary<Gift.GiftType, string> TypeDictionary = new Dictionary<Gift.GiftType, string>
-    {
-        {Gift.GiftType.金币,"g"},
-        {Gift.GiftType.钻石,"d"},
-        {Gift.GiftType.礼包,"p"},
-        {Gift.GiftType.花朵,"f"},
-        {Gift.GiftType.服装,"c"},
-        {Gift.GiftType.开垦土地,"s"},
-        {Gift.GiftType.精灵,"a"},
-    };
-}
-
-public class Gift
-{
-    public enum GiftType
-    {
-        金币 = 0,
-        钻石 = 1,
-        礼包 = 2,
-        花朵 = 3,
-        服装 = 4,
-        开垦土地 = 5,
-        精灵 = 6,
-    }
-
-    #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());
-        string label = ThanksGiftJson.TypeDictionary[GiftType.金币];
-        int value = (int) jsonData[label];
-        if (value != ThanksGiftJson.UnvalidValue)
-        {
-            Types.Add(GiftType.金币);
-            Values.Add(new List<int> {value});
-        }
-        label = ThanksGiftJson.TypeDictionary[GiftType.钻石];
-        value = (int)jsonData[label];
-        if (value != ThanksGiftJson.UnvalidValue)
-        {
-            Types.Add(GiftType.钻石);
-            Values.Add(new List<int> { value });
-        }
-        label = ThanksGiftJson.TypeDictionary[GiftType.礼包];
-        string values = (string)jsonData[label];
-        if (values != ThanksGiftJson.UnvalidValues)
-        {
-            Types.Add(GiftType.礼包);
-            Values.Add(Auxiliary.StringToInts(' ', values, new List<int>()));
-        }
-        label = ThanksGiftJson.TypeDictionary[GiftType.花朵];
-        values = (string)jsonData[label];
-        if (values != ThanksGiftJson.UnvalidValues)
-        {
-            Types.Add(GiftType.花朵);
-            Values.Add(Auxiliary.StringToInts(' ', values, new List<int>()));
-        }
-        label = ThanksGiftJson.TypeDictionary[GiftType.服装];
-        values = (string)jsonData[label];
-        if (values != ThanksGiftJson.UnvalidValues)
-        {
-            Types.Add(GiftType.服装);
-            Values.Add(Auxiliary.StringToInts(' ', values, new List<int>()));
-        }
-        label = ThanksGiftJson.TypeDictionary[GiftType.开垦土地];
-        value = (int)jsonData[label];
-        if (value != ThanksGiftJson.UnvalidValue)
-        {
-            Types.Add(GiftType.开垦土地);
-            Values.Add(new List<int> { value });
-        }
-        label = ThanksGiftJson.TypeDictionary[GiftType.精灵];
-        values = (string)jsonData[label];
-        if (values != ThanksGiftJson.UnvalidValues)
-        {
-            Types.Add(GiftType.精灵);
-            Values.Add(Auxiliary.StringToInts(' ', values, new List<int>()));
-        }
-        StartDate = DateTime.Parse(jsonData[ThanksGiftJson.StartTime].ToString());
-        EndDate = DateTime.Parse(jsonData[ThanksGiftJson.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 (HttpManager.CurrentDateTime > EndDate)
-        {
-            //Debug.Log("has't start");
-            return;
-        }
-
-        if (HttpManager.CurrentDateTime < 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 CloseExchangeRatio = 0.25f;
-    private float AbilityExchangeRatio = 0.25f;
-    private void GetGift(GiftType type, int value)
-    {
-        if (type == GiftType.开垦土地)
-        {
-            for (int i = 0; i < value; i++)
-            {
-                GardenManager.UnlockSlot();
-                int extraSlot = ConfigManager.GetIntFormConfig(PlayerConfigLabel.ExtraSlot);
-                ConfigManager.SaveIntToConfig(PlayerConfigLabel.ExtraSlot, extraSlot + 1);
-                //Debug.LogWarning($"{type}");
-            }
-        }
-        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}");
-            }
-            else
-            {
-                closeItem.OnBuySucceed();
-                //Debug.LogWarning($"{type} {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}");
-        }
-        else if (type == GiftType.精灵)
-        {
-            string abilityID = SkillConfigLabel.GetFullID(SkillType.Ability, value);
-            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}");
-            }
-            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 = GardenManager.FlowerInfoDictionary[value];
-            flowerInfo.Add();
-            //if (!flowerInfo.Unlock)
-            //{
-            //    flowerInfo.Unlock = true;
-            //    //Debug.LogWarning($"{type} {flowerInfo.Name}");
-            //}
-            //else
-            //{
-            //    flowerInfo.Amount++;
-            //    //Debug.LogWarning($"{type} {flowerInfo.Name}");
-            //}
-        }
-        else if (type == GiftType.金币)
-        {
-            Manager.AddCoin(value, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Gift);
-            //Debug.LogWarning($"{type} {value}");
-        }
-        else if (type == GiftType.钻石)
-        {
-            Manager.AddDiamond(value, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Gift);
-            //Debug.LogWarning($"{type} {value}");
-        }
-    }
-}
-
-public class ThanksGift
-{
-    #region Config
-
-    private static bool Inited;
-    private static Dictionary<int, Gift> GiftDictionary = new Dictionary<int, Gift>();
-
-    #endregion
-
-    public static void Init(JsonData jsonData)
-    {
-        //Debug.LogWarning("Inited");
-        Inited = true;
-        for (int i = 0; i < jsonData.Count; i++)
-        {
-            int packID = (int) jsonData[i][ThanksGiftJson.PackID];
-            Gift gift = new Gift(jsonData[i]);
-            GiftDictionary.Add(packID, gift);
-        }
-    }
-
-    public static void GetAllGift(int packID)
-    {
-        if (!Inited)
-        {
-            HttpManager.GetThanksGiftInfo
-            (
-                jData =>
-                {
-                    Init(jData);
-                    getGift(packID);
-                },
-                () => Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)
-                )
-            );
-        }
-        else
-        {
-            getGift(packID);
-        }
-    }
-
-    private static void getGift(int packID)
-    {
-        if (GiftDictionary.ContainsKey(packID))
-        {
-            //Debug.Log("have gift");
-            Gift gift = GiftDictionary[packID];
-            gift.GetAllGift();
-        }
-        else
-        {
-            //Debug.Log("no gift");
-        }
-    }
-}

+ 389 - 0
Assets/Script/Manage/RechargeGiftManager.cs

@@ -0,0 +1,389 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using LitJson;
+using UnityEngine;
+using Random = UnityEngine.Random;
+
+public class RechargeGiftManager
+{
+    public static string PackID = "packid";
+    public static string StartTime = "starttime";
+    public static string EndTime = "endtime";
+
+    public static string UnvalidValueStr = "0";
+
+    public static Dictionary<RechargeGift.GiftType, string> TypeDictionary = new Dictionary<RechargeGift.GiftType, string>
+    {
+        {RechargeGift.GiftType.金币,"g"},
+        {RechargeGift.GiftType.钻石,"d"},
+        {RechargeGift.GiftType.礼包,"p"},
+        {RechargeGift.GiftType.花朵,"f"},
+        {RechargeGift.GiftType.服装,"c"},
+        {RechargeGift.GiftType.开垦土地,"s"},
+        {RechargeGift.GiftType.精灵,"a"},
+    };
+}
+
+public class RechargeGift
+{
+    public enum GiftType
+    {
+        金币 = 0,
+        钻石 = 1,
+        礼包 = 2,
+        花朵 = 3,
+        服装 = 4,
+        开垦土地 = 5,
+        精灵 = 6,
+    }
+
+    public abstract class GiftAward
+    {
+        protected float CloseExchangeRatio = 0.25f;
+        protected float AbilityExchangeRatio = 0.25f;
+        protected GiftType GiftType;
+
+        public GiftAward(GiftType giftType)
+        {
+            GiftType = giftType;
+        }
+
+        /// <returns>true-全部领完</returns>
+        public abstract bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo);
+
+        protected void GetGiftAward(GiftType type, int value)
+        {
+            if (type == GiftType.开垦土地)
+            {
+                for (int i = 0; i < value; i++)
+                {
+                    GardenManager.UnlockSlot();
+                    int extraSlot = ConfigManager.GetIntFormConfig(PlayerConfigLabel.ExtraSlot);
+                    ConfigManager.SaveIntToConfig(PlayerConfigLabel.ExtraSlot, extraSlot + 1);
+                    Debug.LogWarning($"{type}");
+                }
+            }
+            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}");
+                }
+                else
+                {
+                    closeItem.OnBuySucceed();
+                    Debug.LogWarning($"{type} {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}");
+            }
+            else if (type == GiftType.精灵)
+            {
+                string abilityID = SkillConfigLabel.GetFullID(SkillType.Ability, value);
+                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}");
+                }
+                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 = GardenManager.FlowerInfoDictionary[value];
+                flowerInfo.Add();
+                Debug.LogWarning($"{type} {flowerInfo.Name}");
+            }
+            else if (type == GiftType.金币)
+            {
+                Manager.AddCoin(value, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Gift);
+                Debug.LogWarning($"{type} {value}");
+            }
+            else if (type == GiftType.钻石)
+            {
+                Manager.AddDiamond(value, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Gift);
+                Debug.LogWarning($"{type} {value}");
+            }
+        }
+    }
+
+    public class SingleGiftAward : GiftAward
+    {
+        protected int Value;
+
+        public SingleGiftAward(GiftType giftType, int value) : base(giftType)
+        {
+            Value = value;
+            Debug.Log($"{giftType} {value}");
+        }
+
+        public override bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo)
+        {
+            GetGiftAward(GiftType, Value);
+            giftAwardInfo.Key = GiftType;
+            giftAwardInfo.Value = Value;
+            return true;
+        }
+    }
+
+    public class MultipleGiftAward : GiftAward
+    {
+        protected List<int> Values;
+
+        public MultipleGiftAward(GiftType giftType, List<int> values) : base(giftType)
+        {
+            Values = 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];
+            Values.RemoveAt(0);
+            if (Values.Count > 0)
+            {
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+        }
+    }
+
+    //随机获取区间内的一个
+    public class RandomGiftAward : GiftAward
+    {
+        protected int StartIndex;
+        protected int EndIndex;
+
+        public RandomGiftAward(GiftType giftType, int startIndex, int endIndex) : base(giftType)
+        {
+            StartIndex = startIndex;
+            EndIndex = 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;
+            return true;
+        }
+    }
+
+    #region Config
+
+    private DateTime StartDate;
+    private DateTime EndDate;
+    private List<GiftAward> GiftAwards = new List<GiftAward>();
+
+    #endregion
+
+    public RechargeGift(JsonData jsonData)
+    {
+        //Debug.Log(jsonData.ToJson());
+        string label = RechargeGiftManager.TypeDictionary[GiftType.金币];
+        string valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.金币, valueStr));
+        }
+        label = RechargeGiftManager.TypeDictionary[GiftType.钻石];
+        valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.钻石, valueStr));
+        }
+        label = RechargeGiftManager.TypeDictionary[GiftType.礼包];
+        valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.礼包, valueStr));
+        }
+        label = RechargeGiftManager.TypeDictionary[GiftType.花朵];
+        valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.花朵, valueStr));
+        }
+        label = RechargeGiftManager.TypeDictionary[GiftType.服装];
+        valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.服装, valueStr));
+        }
+        label = RechargeGiftManager.TypeDictionary[GiftType.开垦土地];
+        valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.开垦土地, valueStr));
+        }
+        label = RechargeGiftManager.TypeDictionary[GiftType.精灵];
+        valueStr = jsonData[label].ToString();
+        if (valueStr != RechargeGiftManager.UnvalidValueStr)
+        {
+            GiftAwards.AddRange(ParseAllGiftAward(GiftType.精灵, valueStr));
+        }
+        StartDate = DateTime.Parse(jsonData[RechargeGiftManager.StartTime].ToString());
+        EndDate = DateTime.Parse(jsonData[RechargeGiftManager.EndTime].ToString());
+        //Debug.LogWarning(StartDate);
+        //Debug.LogWarning(EndDate);
+    }
+
+    private List<GiftAward> ParseAllGiftAward(GiftType giftType, string valueStr)
+    {
+        List<GiftAward> giftAwards = new List<GiftAward>();
+        string[] values = valueStr.Split('|');
+        for (int i = 0; i < values.Length; i++)
+        {
+            giftAwards.Add(ParseGiftAward(giftType, values[i]));
+        }
+        return giftAwards;
+    }
+
+    private GiftAward ParseGiftAward(GiftType giftType, string valueStr)
+    {
+        if (valueStr.Contains(" "))
+        {
+            List<int> values = Auxiliary.StringToInts(' ', valueStr, new List<int>());
+            return new MultipleGiftAward(giftType, values);
+        }
+        else if (valueStr.Contains(","))
+        {
+            valueStr = valueStr.TrimStart('[');
+            valueStr = valueStr.TrimEnd(']');
+            string[] valueStrs = valueStr.Split(',');
+            int startIndex = int.Parse(valueStrs[0]);
+            int endIndex = int.Parse(valueStrs[1]);
+            return new RandomGiftAward(giftType, startIndex, endIndex);
+        }
+        else if (valueStr.Contains("-"))
+        {
+            string[] valueStrs = valueStr.Split('-');
+            int startIndex = int.Parse(valueStrs[0]);
+            int endIndex = int.Parse(valueStrs[1]);
+            List<int> values = Auxiliary.StartEndIndexToInts(startIndex, endIndex);
+            return new MultipleGiftAward(giftType, values);
+        }
+        else
+        {
+            int value = int.Parse(valueStr);
+            return new SingleGiftAward(giftType, value);
+        }
+    }
+
+
+    public bool IsGiftAvailable()
+    {
+        if (HttpManager.CurrentDateTime > EndDate)
+        {
+            //Debug.Log("has't start");
+            return false;
+        }
+
+        if (HttpManager.CurrentDateTime < StartDate)
+        {
+            //Debug.Log("over");
+            return false;
+        }
+
+        if (GiftAwards.Count == 0)
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    public bool GetOneGiftAward(out KV<GiftType, int> giftAwardInfo)
+    {
+        if (GiftAwards[0].GetOneGiftAward(out giftAwardInfo))
+        {
+            GiftAwards.RemoveAt(0);
+        }
+
+        if (GiftAwards.Count > 0)
+        {
+            return false;
+        }
+        else
+        {
+            return true;
+        }
+    }
+}
+
+public class ThanksGift
+{
+    #region Config
+
+    private static bool Inited;
+    private static Dictionary<int, RechargeGift> GiftDictionary = new Dictionary<int, RechargeGift>();
+
+    #endregion
+
+    public static void Init(JsonData jsonData)
+    {
+        //Debug.LogWarning("Inited");
+        Inited = true;
+        for (int i = 0; i < jsonData.Count; i++)
+        {
+            int packID = (int) jsonData[i][RechargeGiftManager.PackID];
+            RechargeGift rechargeGift = new RechargeGift(jsonData[i]);
+            GiftDictionary.Add(packID, rechargeGift);
+        }
+    }
+
+    public static void GetAllGift(int packID)
+    {
+        if (!Inited)
+        {
+            HttpManager.GetThanksGiftInfo
+            (
+                jData =>
+                {
+                    Init(jData);
+                    getGift(packID);
+                },
+                () => Bubble.Show(null, Language.GetStr(LanguageLabel.UI__GetThanksGiftInfoFailed)
+                )
+            );
+        }
+        else
+        {
+            getGift(packID);
+        }
+    }
+
+    private static void getGift(int packID)
+    {
+        if (GiftDictionary.ContainsKey(packID))
+        { 
+            //RechargeGift rechargeGift = GiftDictionary[packID];
+            //rechargeGift.GetOneGiftAward();
+        }
+    }
+}

+ 0 - 0
Assets/Script/Function/ThanksGift.cs.meta → Assets/Script/Manage/RechargeGiftManager.cs.meta


+ 22 - 0
Assets/Script/Tool/Auxiliary.cs

@@ -1258,4 +1258,26 @@ public class Auxiliary : Regist
             return list;
         }
     }
+
+
+    public static List<int> StartEndIndexToInts(int startIndex, int endIndex)
+    {
+        List<int> ints = new List<int>();
+        for (int i = startIndex; i <= endIndex; i++)
+        {
+            ints.Add(i);
+        }
+        return ints;
+    }
+
+
+    public static string IntsToString(List<int> ints)
+    {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (int i = 0; i < ints.Count; i++)
+        {
+            stringBuilder.Append(ints[i] + " ");
+        }
+        return stringBuilder.ToString();
+    }
 }

+ 3 - 3
ProjectSettings/GraphicsSettings.asset

@@ -43,13 +43,13 @@ GraphicsSettings:
     type: 0}
   m_TierSettings_Tier1:
     renderingPath: 1
-    useCascadedShadowMaps: 1
+    useCascadedShadowMaps: 0
   m_TierSettings_Tier2:
     renderingPath: 1
-    useCascadedShadowMaps: 1
+    useCascadedShadowMaps: 0
   m_TierSettings_Tier3:
     renderingPath: 1
-    useCascadedShadowMaps: 1
+    useCascadedShadowMaps: 0
   m_DefaultRenderingPath: 1
   m_DefaultMobileRenderingPath: 1
   m_TierSettings: []