|
@@ -43,8 +43,6 @@ public class ManaReso : MonoBehaviour
|
|
|
{
|
|
|
#region 变量
|
|
|
|
|
|
- public static ManaReso Ins;
|
|
|
-
|
|
|
private static Dictionary<string, Transform> TraDic;
|
|
|
private static Dictionary<ObjType, GameObject> PrefabDic;
|
|
|
private static Dictionary<ObjType, List<GameObject>> ObjectPool;
|
|
@@ -53,8 +51,6 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
private void Awake()
|
|
|
{
|
|
|
- Ins = this;
|
|
|
-
|
|
|
TraDic = new Dictionary<string, Transform>();
|
|
|
PrefabDic = new Dictionary<ObjType, GameObject>();
|
|
|
ObjectPool = new Dictionary<ObjType, List<GameObject>>();
|
|
@@ -284,7 +280,7 @@ public class ManaReso : MonoBehaviour
|
|
|
{
|
|
|
SetActive("C_Main", false);
|
|
|
SetActive("F_Manage", true);
|
|
|
-
|
|
|
+
|
|
|
Get("F_Manage").Forward(TweenType.Position);
|
|
|
}
|
|
|
);
|
|
@@ -367,11 +363,6 @@ public class ManaReso : MonoBehaviour
|
|
|
"D_Quit",
|
|
|
() =>
|
|
|
{
|
|
|
- if (!Get("D_MiniGameA").IsForwardFinish(TweenType.Position))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
SetText("Da_Tit", "退出游戏");
|
|
|
SetText("Da_Lab", "打理完花园可能获得如下奖励,确定要退出?");
|
|
|
SetActive("Da_Quit", true);
|
|
@@ -548,7 +539,7 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
#region F_Manage
|
|
|
|
|
|
- Get("F_Manage").CreateTween(Get("F_PosTra1").position, 0.5f, false, true, TweenCurve.Linear);
|
|
|
+ Get("F_Manage").CreateTween(Get("F_PosTra").position, 0.5f, false, true, TweenCurve.Linear);
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -570,6 +561,9 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region Skill
|
|
|
+
|
|
|
#region F_SkillA/B/C/D
|
|
|
|
|
|
SetButtonEvent
|
|
@@ -630,220 +624,43 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region Fa Garden
|
|
|
|
|
|
- #region Fa
|
|
|
-
|
|
|
- #region Fa_Grid
|
|
|
-
|
|
|
- GetGridItem("Fa_SkillItem", "Fa_Grid", " (0)");
|
|
|
- GetGridItem("Fa_SkillItem", "Fa_Grid", " (1)");
|
|
|
- GetGridItem("Fa_SkillItem", "Fa_Grid", " (2)");
|
|
|
- GetGridItem("Fa_SkillItem", "Fa_Grid", " (3)");
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fa_SkillBtn (0)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "人潮涌动 升级");
|
|
|
- SetText("Fe_Lab2", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_Lab3", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_BtnLab", "升级\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fa_SkillBtn (1)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "人潮涌动 升级");
|
|
|
- SetText("Fe_Lab2", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_Lab3", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_BtnLab", "升级\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fa_SkillBtn (2)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "人潮涌动 升级");
|
|
|
- SetText("Fe_Lab2", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_Lab3", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_BtnLab", "升级\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fa_SkillBtn (3)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "人潮涌动 升级");
|
|
|
- SetText("Fe_Lab2", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_Lab3", "持续5分钟\n每分钟增加6人参观");
|
|
|
- SetText("Fe_BtnLab", "升级\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- #endregion
|
|
|
+ for (int i = 0; i < ManaData.GardenSkillList.Count; i++)
|
|
|
+ {
|
|
|
+ GetSkillItem(string.Format(" ({0})", i), ManaData.GardenSkillList[i]);
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region Fb
|
|
|
+ #region Fb Magic
|
|
|
|
|
|
- GetGridItem("Fb_MagicItem", "Fb_Grid", " (0)");
|
|
|
- GetGridItem("Fb_MagicItem", "Fb_Grid", " (1)");
|
|
|
- GetGridItem("Fb_MagicItem", "Fb_Grid", " (2)");
|
|
|
- GetGridItem("Fb_MagicItem", "Fb_Grid", " (3)");
|
|
|
+ for (int i = 0; i < ManaData.MagicSkillList.Count; i++)
|
|
|
+ {
|
|
|
+ GetSkillItem(string.Format(" ({0})", i), ManaData.MagicSkillList[i]);
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region Fc
|
|
|
-
|
|
|
- #region Fc_Grid
|
|
|
-
|
|
|
- GetGridItem("Fc_StoreItem", "Fc_Grid", " (0)");
|
|
|
- GetGridItem("Fc_StoreItem", "Fc_Grid", " (1)");
|
|
|
- GetGridItem("Fc_StoreItem", "Fc_Grid", " (2)");
|
|
|
- GetGridItem("Fc_StoreItem", "Fc_Grid", " (3)");
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fc_StoreBtn (0)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "新手礼包");
|
|
|
- SetText("Fe_Lab2", "150级内有效");
|
|
|
- SetText("Fe_Lab3", "获得某种特殊花朵,500钻石\n所有金币产出提升110%,永久有效");
|
|
|
- SetText("Fe_BtnLab", "购买\n¥6");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fc_StoreBtn (1)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "新手礼包");
|
|
|
- SetText("Fe_Lab2", "150级内有效");
|
|
|
- SetText("Fe_Lab3", "获得某种特殊花朵,500钻石\n所有金币产出提升110%,永久有效");
|
|
|
- SetText("Fe_BtnLab", "购买\n¥6");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fc_StoreBtn (2)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "新手礼包");
|
|
|
- SetText("Fe_Lab2", "150级内有效");
|
|
|
- SetText("Fe_Lab3", "获得某种特殊花朵,500钻石\n所有金币产出提升110%,永久有效");
|
|
|
- SetText("Fe_BtnLab", "购买\n¥6");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fc_StoreBtn (3)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "新手礼包");
|
|
|
- SetText("Fe_Lab2", "150级内有效");
|
|
|
- SetText("Fe_Lab3", "获得某种特殊花朵,500钻石\n所有金币产出提升110%,永久有效");
|
|
|
- SetText("Fe_BtnLab", "购买\n¥6");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
+ #region Fc Store
|
|
|
|
|
|
- #endregion
|
|
|
+ for (int i = 0; i < ManaData.StoreSkillList.Count; i++)
|
|
|
+ {
|
|
|
+ GetSkillItem(string.Format(" ({0})", i), ManaData.StoreSkillList[i]);
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region Fd
|
|
|
-
|
|
|
- #region Fd_Grid
|
|
|
-
|
|
|
- GetGridItem("Fd_ElfItem", "Fd_Grid", " (0)");
|
|
|
- GetGridItem("Fd_ElfItem", "Fd_Grid", " (1)");
|
|
|
- GetGridItem("Fd_ElfItem", "Fd_Grid", " (2)");
|
|
|
- GetGridItem("Fd_ElfItem", "Fd_Grid", " (3)");
|
|
|
+ #region Fd Elf
|
|
|
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fd_ElfBtn (0)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "蓝色小蜜蜂 未解锁");
|
|
|
- SetText("Fe_Lab2", "");
|
|
|
- SetText("Fe_Lab3", "每人次参观获得10金币");
|
|
|
- SetText("Fe_BtnLab", "解锁\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
+ for (int i = 0; i < ManaData.ElfSkillList.Count; i++)
|
|
|
+ {
|
|
|
+ GetSkillItem(string.Format(" ({0})", i), ManaData.ElfSkillList[i]);
|
|
|
+ }
|
|
|
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fd_ElfBtn (1)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "蓝色小蜜蜂 未解锁");
|
|
|
- SetText("Fe_Lab2", "");
|
|
|
- SetText("Fe_Lab3", "每人次参观获得10金币");
|
|
|
- SetText("Fe_BtnLab", "解锁\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
+#endregion
|
|
|
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fd_ElfBtn (2)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "蓝色小蜜蜂 未解锁");
|
|
|
- SetText("Fe_Lab2", "");
|
|
|
- SetText("Fe_Lab3", "每人次参观获得10金币");
|
|
|
- SetText("Fe_BtnLab", "解锁\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- SetButtonEvent
|
|
|
- (
|
|
|
- "Fd_ElfBtn (3)",
|
|
|
- () =>
|
|
|
- {
|
|
|
- SetText("Fe_Lab1", "蓝色小蜜蜂 未解锁");
|
|
|
- SetText("Fe_Lab2", "");
|
|
|
- SetText("Fe_Lab3", "每人次参观获得10金币");
|
|
|
- SetText("Fe_BtnLab", "解锁\n(钻石)100");
|
|
|
-
|
|
|
- Get("Fe_ManageInfo").Forward(TweenType.Alpha);
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- #endregion
|
|
|
+ ManaData.UpdateSkillStatus();
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -1076,7 +893,7 @@ public class ManaReso : MonoBehaviour
|
|
|
new Vector3(-12, tempTra.position.y, tempTra.position.z),
|
|
|
100, false, true, TweenCurve.Linear
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
tempTween.OnForwardFinish += () =>
|
|
|
{
|
|
|
tempTra.Forward(TweenType.Position);
|
|
@@ -1090,7 +907,7 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
tempTween = Get("GardenSrC").CreateTween
|
|
|
(
|
|
|
- Garden.Ins.transform.position,
|
|
|
+ Get("GardenPosTra").position,
|
|
|
1f, false, true, TweenCurve.Linear
|
|
|
);
|
|
|
|
|
@@ -1101,18 +918,16 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
tempTween.OnForwardFinish += () =>
|
|
|
{
|
|
|
- Player.Ins.SetActive(false);
|
|
|
-
|
|
|
+ SetActive("Player", false);
|
|
|
SetActive("GardenSr1", false);
|
|
|
SetActive("GardenSrA", false);
|
|
|
};
|
|
|
|
|
|
tempTween.OnBackwardStart += () =>
|
|
|
{
|
|
|
- Player.Ins.SetActive(true);
|
|
|
-
|
|
|
- Get("GardenSr1").SetActive(true);
|
|
|
- Get("GardenSrA").SetActive(true);
|
|
|
+ SetActive("Player", true);
|
|
|
+ SetActive("GardenSr1", true);
|
|
|
+ SetActive("GardenSrA", true);
|
|
|
};
|
|
|
|
|
|
tempTween.OnBackwardFinish += () =>
|
|
@@ -1469,6 +1284,46 @@ public class ManaReso : MonoBehaviour
|
|
|
return tempTra;
|
|
|
}
|
|
|
|
|
|
+ public static Transform GetSkillItem(string suffix, SkillRoot skillRoot)
|
|
|
+ {
|
|
|
+ Transform tempTra;
|
|
|
+
|
|
|
+ if (skillRoot.Class == SkillClass.Elf)
|
|
|
+ {
|
|
|
+ tempTra = GetGridItem("Fd_ElfItem", "Fd_Grid", suffix);
|
|
|
+ }
|
|
|
+ else if (skillRoot.Class == SkillClass.Store)
|
|
|
+ {
|
|
|
+ tempTra = GetGridItem("Fc_StoreItem", "Fc_Grid", suffix);
|
|
|
+ }
|
|
|
+ else if (skillRoot.Class == SkillClass.Magic)
|
|
|
+ {
|
|
|
+ tempTra = GetGridItem("Fb_MagicItem", "Fb_Grid", suffix);
|
|
|
+ }
|
|
|
+ else if (skillRoot.Class == SkillClass.Garden)
|
|
|
+ {
|
|
|
+ tempTra = GetGridItem("Fa_GardenItem", "Fa_Grid", suffix);
|
|
|
+ }
|
|
|
+ else if (skillRoot.Class == SkillClass.Activity)
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ skillRoot.Tit = tempTra.GetChild(1).GetComponent<Text>();
|
|
|
+ skillRoot.Lab = tempTra.GetChild(1).GetChild(0).GetComponent<Text>();
|
|
|
+ skillRoot.BtnLab = tempTra.GetChild(0).GetChild(0).GetComponent<Text>();
|
|
|
+
|
|
|
+ skillRoot.Tit.text = skillRoot.Name;
|
|
|
+ skillRoot.Lab.text = skillRoot.Desc;
|
|
|
+ skillRoot.BtnLab.text = skillRoot.ClassId.ToString();
|
|
|
+
|
|
|
+ return tempTra;
|
|
|
+ }
|
|
|
+
|
|
|
public static Transform GetGridItem(string prefabName, string parentName, string suffix)
|
|
|
{
|
|
|
Transform tempTra = Get(prefabName, Folder.PrefabUI, Get(parentName));
|
|
@@ -1497,7 +1352,7 @@ public class ManaReso : MonoBehaviour
|
|
|
|
|
|
SaveToDic(transforms[i]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Image image = tempTra.GetComponent<Image>();
|
|
|
image.sprite = Load<Sprite>(objType.ToString(), Folder.Garden);
|
|
|
|