|
@@ -1,30 +1,132 @@
|
|
|
-using UnityEngine;
|
|
|
+using System;
|
|
|
+using UnityEngine;
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Xml;
|
|
|
using UnityEngine.EventSystems;
|
|
|
|
|
|
+public class Sign
|
|
|
+{
|
|
|
+ public int Coin;
|
|
|
+ public int Diamond;
|
|
|
+ public List<int> Flower;
|
|
|
+
|
|
|
+ public Transform Item;
|
|
|
+
|
|
|
+ public Sign(Transform transform, XmlAttributeCollection attribute)
|
|
|
+ {
|
|
|
+ Item = transform;
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(attribute[1].Value))
|
|
|
+ {
|
|
|
+ string[] strings = attribute[1].Value.Split(',');
|
|
|
+ Item.GetChild(0).GetComponent<Image>().sprite = ManaReso.Load<Sprite>("管理花园按钮", Folder.SpriteUI);
|
|
|
+
|
|
|
+ Flower = new List<int>();
|
|
|
+
|
|
|
+ for (int i = 0; i < strings.Length; i++)
|
|
|
+ {
|
|
|
+ Flower.Add(int.Parse(strings[i]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(attribute[2].Value))
|
|
|
+ {
|
|
|
+ Diamond = int.Parse(attribute[2].Value);
|
|
|
+
|
|
|
+ if (Flower == null)
|
|
|
+ {
|
|
|
+ Item.GetChild(0).GetComponent<Image>().sprite = ManaReso.Load<Sprite>("钻石", Folder.SpriteUI);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (!string.IsNullOrEmpty(attribute[3].Value))
|
|
|
+ {
|
|
|
+ Coin = int.Parse(attribute[3].Value);
|
|
|
+ Item.GetChild(0).GetComponent<Image>().sprite = ManaReso.Load<Sprite>("金币", Folder.SpriteUI);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void Get()
|
|
|
+ {
|
|
|
+ Item.GetChild(1).SetActive(true);
|
|
|
+
|
|
|
+ if (Flower != null)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < Flower.Count; i++)
|
|
|
+ {
|
|
|
+ if (ManaGarden.FlowerDic[Flower[i]].Unlock == false)
|
|
|
+ {
|
|
|
+ ManaGarden.FlowerDic[Flower[i]].Unlock = true;
|
|
|
+
|
|
|
+ if (ManaData.Sign < 27)
|
|
|
+ {
|
|
|
+ ManaData.Sign++;
|
|
|
+ }
|
|
|
+
|
|
|
+ ManaReso.SetText("Bb_InfoLab", Flower[i].ToString());
|
|
|
+
|
|
|
+ ManaReso.Get<Image>("Bb_Info").sprite = ManaReso.Load<Sprite>("管理花园按钮", Folder.SpriteUI);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Diamond > 0)
|
|
|
+ {
|
|
|
+ if (ManaData.Sign < 27)
|
|
|
+ {
|
|
|
+ ManaData.Sign++;
|
|
|
+ }
|
|
|
+
|
|
|
+ ManaData.Diamond += Diamond;
|
|
|
+
|
|
|
+ ManaReso.SetText("Bb_InfoLab", Diamond.ToString());
|
|
|
+
|
|
|
+ ManaReso.Get<Image>("Bb_Info").sprite = ManaReso.Load<Sprite>("钻石", Folder.SpriteUI);
|
|
|
+ }
|
|
|
+ else if (Coin > 0)
|
|
|
+ {
|
|
|
+ if (ManaData.Sign < 27)
|
|
|
+ {
|
|
|
+ ManaData.Sign++;
|
|
|
+ }
|
|
|
+
|
|
|
+ ManaData.Coin += Coin;
|
|
|
+
|
|
|
+ ManaReso.SetText("Bb_InfoLab", Coin.ToString());
|
|
|
+
|
|
|
+ ManaReso.Get<Image>("Bb_Info").sprite = ManaReso.Load<Sprite>("金币", Folder.SpriteUI);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
public class ManaUI : MonoBehaviour
|
|
|
{
|
|
|
#region 变量
|
|
|
|
|
|
- public static Transform SeleDateItem;
|
|
|
+ public static List<Sign> SignList;
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- private void Awake()
|
|
|
+ private void Awake()
|
|
|
{
|
|
|
Initializer.RegistValue += RegistValue;
|
|
|
- Initializer.RegistReference += RegistReference;
|
|
|
-
|
|
|
- ManaReso.Get("Canvas", Folder.PrefabUI, true, null, true);
|
|
|
- ManaReso.Get("EventSystem", Folder.PrefabUI, false, null, false);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void RegistValue()
|
|
|
{
|
|
|
+ List<XmlAttributeCollection> attributeList = Data.GetSignConfig();
|
|
|
+
|
|
|
#region A
|
|
|
|
|
|
#region A_Confirm
|
|
@@ -46,6 +148,12 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#region B
|
|
|
|
|
|
+ ManaReso.SetText("Ba_Lab");
|
|
|
+ ManaReso.SetText("Ba_ConfirmLab");
|
|
|
+ ManaReso.SetText("Bb_GetLab");
|
|
|
+ ManaReso.SetText("Bb_Title");
|
|
|
+ ManaReso.SetText("Bb_ConfirmLab");
|
|
|
+
|
|
|
#region Bb_Get
|
|
|
|
|
|
ManaReso.AddButtonEvent
|
|
@@ -57,8 +165,7 @@ public class ManaUI : MonoBehaviour
|
|
|
ManaReso.SetActive("Bb_Info", true);
|
|
|
ManaReso.SetActive("Bb_Confirm", true);
|
|
|
|
|
|
- SeleDateItem.GetChild(1).SetActive(true);
|
|
|
- ManaData.Coin += 1500;
|
|
|
+ SignList[ManaData.Sign].Get();
|
|
|
}
|
|
|
);
|
|
|
|
|
@@ -78,16 +185,6 @@ public class ManaUI : MonoBehaviour
|
|
|
ManaData.Main--;
|
|
|
};
|
|
|
|
|
|
- Transform tra = ManaReso.Get("Bb_Grid");
|
|
|
-
|
|
|
- SeleDateItem = ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
- ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
- ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
- ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
- ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
- ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
- ManaReso.Get("DateItem", Folder.PrefabUI, false, tra, false);
|
|
|
-
|
|
|
#endregion
|
|
|
|
|
|
#region Bb_SignIn
|
|
@@ -99,9 +196,24 @@ public class ManaUI : MonoBehaviour
|
|
|
ManaData.Main--;
|
|
|
};
|
|
|
|
|
|
+ Transform tra = ManaReso.Get("Bb_Grid");
|
|
|
+
|
|
|
+ SignList = new List<Sign>();
|
|
|
+ for (int i = 0; i < attributeList.Count; i++)
|
|
|
+ {
|
|
|
+ Transform tra1 = ManaReso.Get("SignInItem", Folder.PrefabUI, false, tra, false);
|
|
|
+
|
|
|
+ SignList.Add(new Sign(tra1, attributeList[i]));
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < ManaData.Sign; i++)
|
|
|
+ {
|
|
|
+ tra.GetChild(i).GetChild(1).SetActive(true);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
- #region B_Confirm
|
|
|
+ #region Bb_Confirm
|
|
|
|
|
|
ManaReso.AddButtonEvent
|
|
|
(
|
|
@@ -142,6 +254,8 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#region C_MiniGame
|
|
|
|
|
|
+ ManaReso.SetText("C_MiniGameLab");
|
|
|
+
|
|
|
Button enterGameA = ManaReso.Get<Button>("C_MiniGame");
|
|
|
|
|
|
enterGameA.onClick.AddListener
|
|
@@ -166,6 +280,18 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#region D
|
|
|
|
|
|
+ ManaReso.SetText("D_QuitLab");
|
|
|
+ ManaReso.SetText("D_BeginLab");
|
|
|
+ ManaReso.SetText("D_ScoreTit");
|
|
|
+ ManaReso.SetText("D_StatusLab", Language.GetStr("UI", "D_StatusLab0"));
|
|
|
+
|
|
|
+ ManaReso.SetText("Da_Tit");
|
|
|
+ ManaReso.SetText("Da_Lab");
|
|
|
+ ManaReso.SetText("Da_QuitLab");
|
|
|
+ ManaReso.SetText("Da_CancelLab");
|
|
|
+ ManaReso.SetText("Da_GetAwardLab");
|
|
|
+
|
|
|
+
|
|
|
#region D_Rip
|
|
|
|
|
|
ManaReso.AddButtonEvent
|
|
@@ -255,8 +381,8 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#region Da_Grid
|
|
|
|
|
|
- ManaReso.Get("AwardItem", Folder.PrefabUI, false, ManaReso.Get("Da_Grid"), false);
|
|
|
- ManaReso.Get("AwardItem", Folder.PrefabUI, false, ManaReso.Get("Da_Grid"), false);
|
|
|
+ ManaReso.Get("AwardItem", Folder.PrefabUI, false, ManaReso.Get("Da_Grid"), false);
|
|
|
+ ManaReso.Get("AwardItem", Folder.PrefabUI, false, ManaReso.Get("Da_Grid"), false);
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -325,6 +451,15 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#region F
|
|
|
|
|
|
+ ManaReso.SetText("F_StoreLab");
|
|
|
+ ManaReso.SetText("F_MagicLab");
|
|
|
+ ManaReso.SetText("F_ElfLab");
|
|
|
+ ManaReso.SetText("F_GardenLab");
|
|
|
+
|
|
|
+ ManaReso.SetText("Fg_Tit");
|
|
|
+ ManaReso.SetText("Fg_BtnLab");
|
|
|
+ ManaReso.SetText("Fg_Lab");
|
|
|
+
|
|
|
#region F_Close
|
|
|
|
|
|
ManaReso.AddButtonEvent
|
|
@@ -515,8 +650,6 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region MyRegion
|
|
|
-
|
|
|
ManaReso.Get("Fg_Reconnect").CreateTweenCG(0f, 1f, 0.1f, false, true, Curve.EaseOutQuad);
|
|
|
|
|
|
ManaReso.AddButtonEvent
|
|
@@ -540,10 +673,13 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
#region G
|
|
|
|
|
|
+ ManaReso.SetText("G_Tit");
|
|
|
+ ManaReso.SetText("G_SpecialLab");
|
|
|
+ ManaReso.SetText("G_RegularLab");
|
|
|
+ ManaReso.SetText("G_RetrieveLab");
|
|
|
+
|
|
|
#region G_Close
|
|
|
|
|
|
ManaReso.AddButtonEvent
|
|
@@ -601,7 +737,7 @@ public class ManaUI : MonoBehaviour
|
|
|
() =>
|
|
|
{
|
|
|
ManaGarden.RetriveFlowerAll();
|
|
|
-
|
|
|
+
|
|
|
ManaReso.Get("G_Flower").TweenBacCG();
|
|
|
}
|
|
|
);
|
|
@@ -641,9 +777,12 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#region H
|
|
|
|
|
|
+ ManaReso.SetText("H_PlaceLab");
|
|
|
+ ManaReso.SetText("H_RetrieveLab");
|
|
|
+
|
|
|
#region H_Prev
|
|
|
|
|
|
- ManaReso.AddButtonEvent
|
|
|
+ ManaReso.AddButtonEvent
|
|
|
(
|
|
|
"H_Prev",
|
|
|
() =>
|
|
@@ -748,9 +887,4 @@ public class ManaUI : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
}
|
|
|
-
|
|
|
- private void RegistReference()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
}
|