powerfun-unity/Assets/Scripts/Scenes/MainController.cs
2021-04-23 09:37:41 +08:00

56 lines
1.5 KiB
C#

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