Commit ddc84216 authored by LiLiuZhou's avatar LiLiuZhou

1

parent e2c8af77
......@@ -82,7 +82,7 @@ public class UnityPhoneUtils
if (Constant.Instance.device.Equals(""))
{
#if UNITY_EDITOR
Constant.Instance.device = "debug_test_002";
Constant.Instance.device = "debug_test_003";
#elif UNITY_ANDROID
Constant.Instance.device = GetPhoneUtil().Call<string>("getDeviceId", GetActivity());
#elif UNITY_IOS
......
......@@ -8,7 +8,7 @@ public abstract class BasePanel : MonoBehaviour
{
private Dictionary<string, List<UIBehaviour>> controlsdic = new Dictionary<string, List<UIBehaviour>>();
private Dictionary<string, SpriteRenderer> spritesdic = new Dictionary<string, SpriteRenderer>();
protected void Awake()
protected virtual void Awake()
{
GetAllControls<Button>();
GetAllControls<Text>();
......
......@@ -159,6 +159,12 @@ public class UIMgr : BaseMgr<UIMgr>
panel.OnInit(data);
}
public void RegisterPanel<T>(T panel) where T : BasePanel
{
CheckInit();
paneldic.Add(typeof(T).ToString(), panel);
panel.OnInit();
}
public void HidePanel<T>(string name = null) where T:BasePanel
{
CheckInit();
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 3345829442083138011}
- component: {fileID: 6553566031201155031}
- component: {fileID: 2145990231334404781}
m_Layer: 8
m_Layer: 5
m_Name: 1
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 630247405110731201}
- component: {fileID: 6849236633244900257}
- component: {fileID: 3124930929499599388}
m_Layer: 8
m_Layer: 5
m_Name: 10
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 833979182016893467}
- component: {fileID: 5079638499583880063}
- component: {fileID: 9154449643341698626}
m_Layer: 8
m_Layer: 5
m_Name: 11
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 1461700656335496196}
- component: {fileID: 8817070787098627715}
- component: {fileID: 6692804851037463569}
m_Layer: 8
m_Layer: 5
m_Name: 2
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 1210833349443804168}
- component: {fileID: 1326560321718115351}
- component: {fileID: 8099278256924804017}
m_Layer: 8
m_Layer: 5
m_Name: 3
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 6952006078027700734}
- component: {fileID: 1295092757633459469}
- component: {fileID: 7692154166495186106}
m_Layer: 8
m_Layer: 5
m_Name: 6
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 7338134519430711551}
- component: {fileID: 1599896523001130603}
- component: {fileID: 7858533640022726427}
m_Layer: 8
m_Layer: 5
m_Name: 7
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 2590086187272796619}
- component: {fileID: 4987548872815581204}
- component: {fileID: 9071176785666683247}
m_Layer: 8
m_Layer: 5
m_Name: 8
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 3087729805361338426}
- component: {fileID: 6055266708282932652}
- component: {fileID: 5458731382721637647}
m_Layer: 8
m_Layer: 5
m_Name: 9
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -170,7 +170,7 @@ Canvas:
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_SortingOrder: 1
m_TargetDisplay: 0
--- !u!114 &1071024550456484696
MonoBehaviour:
......
This diff is collapsed.
......@@ -12,11 +12,13 @@ public class GameController : MonoBehaviour
{
GameObject obj = new GameObject("GameController");
Instance = obj.AddComponent<GameController>();
DontDestroyOnLoad(obj);
Instance.Fruits = new GameObject("Fruits").transform;
}
return Instance;
}
public Transform Fruits;
//准备销毁的水果集合
public LinkedList<GameObject> TempList = new LinkedList<GameObject>();
......
......@@ -25,15 +25,9 @@ public class HomeInfoControl : MonoBehaviour
#if UNITY_EDITOR
AppConfig.Instance.InitProgect(true);
#endif
//GetHomeInfo();
//获取下一组要生成的水果的音符
//GameController.GetInstance().GetNextNoteList(0);
//
UIMgr.Getinstance().ShowPanel<MainPanel>(E_Layer.mid);
UIMgr.Getinstance().ShowPanel<TouchPanel>(E_Layer.bot);
EventCenter.Getinstance().EventTrigger("RegisterPanel");
//GameController.GetInstance().GetSongsList(0);
GameController.GetInstance().GetWithdrawList(1);
}
......
......@@ -6,6 +6,11 @@ using UnityEngine.UI;
public class MainPanel : BasePanel
{
protected override void Awake()
{
base.Awake();
EventCenter.Getinstance().AddUpdateListener("RegisterPanel",()=> { UIMgr.Getinstance().RegisterPanel<MainPanel>(this); });
}
public override void OnHide(object data = null)
{
......@@ -20,7 +25,7 @@ public class MainPanel : BasePanel
{
}
private void GetHomeInfo()
public void GetHomeInfo()
{
HttpTool.Instance._Get("app/v1/watermelon/info", null, new Action<WatermelonInfoBean>((result) =>
{
......
......@@ -14,7 +14,7 @@ public class MusicPanel : BasePanel
public override void OnInit(object data = null)
{
GetControl<Button>("btnBack").onClick.AddListener(() =>{ UIMgr.Getinstance().HidePanel<MusicPanel>(); });
#region 通过数据初始化面板
Dictionary<string, object> paras = new Dictionary<string, object>();
......
......@@ -27,6 +27,11 @@ public class TouchPanel : BasePanel
//将要生成的水果集合
private Queue<int> InstantFruitList = new Queue<int>();
protected override void Awake()
{
base.Awake();
EventCenter.Getinstance().AddUpdateListener("RegisterPanel", ()=> { UIMgr.Getinstance().RegisterPanel(this); });
}
public override void OnInit(object data = null)
{
cam = UIMgr.Getinstance().MainCamera;
......
......@@ -13,7 +13,7 @@ TagManager:
- UI
-
-
-
- Bot
-
-
-
......@@ -41,3 +41,12 @@ TagManager:
- name: Default
uniqueID: 0
locked: 0
- name: Bot
uniqueID: 1021235271
locked: 0
- name: Mid
uniqueID: 933169827
locked: 0
- name: Top
uniqueID: 2607583029
locked: 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment