powerfun-unity/Assets/Scripts/Scenes/MainController.cs

51 lines
1.4 KiB
C#
Raw Normal View History

2021-04-14 15:02:33 +08:00
using Mapbox.Examples;
using System.Collections;
2021-03-25 16:53:39 +08:00
using System.Collections.Generic;
using UnityEngine;
2021-04-19 14:36:08 +08:00
using UnityEngine.UI;
2021-03-25 16:53:39 +08:00
public class MainController : MonoBehaviour
{
2021-04-14 15:02:33 +08:00
[SerializeField]GameObject root;
2021-04-19 14:36:08 +08:00
private Text Version;
2021-04-14 15:02:33 +08:00
private void Awake()
{
Version = this.transform.Find("GameObject").Find("Version").GetComponent<Text>();
2021-04-19 14:36:08 +08:00
Version.text = "Version:"+App.AppVersion;
2021-04-14 15:02:33 +08:00
}
2021-03-25 16:53:39 +08:00
// Start is called before the first frame update
void Start()
{
2021-04-14 15:02:33 +08:00
UIManager.Instance.Root = root;
UIManager.Instance.MainPanel = this.transform.Find("Panel").GetComponent<PFUIPanel>();
UIManager.Instance.ModalsPanel = this.transform.Find("ModalPanel").GetComponent<PFUIPanel>();
2021-03-25 16:53:39 +08:00
//MainMenu.transform.Find("Home").GetComponent<Button>().onClick.AddListener(() =>
//{
// UIManager.ShowHomePanel();
//});
2021-04-14 15:02:33 +08:00
if (App.MainSceneParam.ContainsKey("Name"))
{
if(App.MainSceneParam["Name"] == "MapListPanel")
{
UIManager.ShowMapListPanel();
}
}
else
{
UIManager.ShowHomePanel();
//UIManager.ShowUserInfoPanel();
//UIManager.ShowEditUserPanel();
//UIManager.ShowBigMapPanel();
}
2021-03-25 16:53:39 +08:00
}
// Update is called once per frame
void Update()
{
}
}