Commit 73b5c30f authored by 王雪伟's avatar 王雪伟

Merge branch 'master' of gitlab.huolea.com:wangxuewei/musicbigwatermelon

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