void OnMainButtonClicked() { Debuger.Log("main button clicked "); GameUiManager.getInst().showWindow(PanelType.UIMain, false); GameUiManager.getInst().showWindow(PanelType.UIHeroList, true); }
void Awake() { if (!m_instance) { m_instance = this; } m_gameOverObj.SetActive(false); m_isPause = false; m_isGameOver = false; }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
IEnumerator LoadPrefabFromRes(string name, params object[] paramsList) { ResourceRequest quest = Resources.LoadAsync("Prefabs/Gui/" + name); yield return(quest); GameObject instance = Instantiate(quest.asset) as GameObject; Transform instanceTran = instance.transform; instanceTran.parent = GameUiManager.UIRootTran; instanceTran.localPosition = Vector3.zero; instanceTran.localScale = Vector3.one; GameObject mainBottomObj = ObjectCommon.GetChild(GameUiManager.UIRootTran.gameObject, PanelType.UIMain_bottom); if (mainBottomObj != null) { mainBottomObj.transform.SetSiblingIndex(instanceTran.GetSiblingIndex()); } PanelManager.PanelModuleData panelData = PanelManager.GetInstance().getComponent(name); Debuger.LogError("pannel data is null ?" + panelData); instance.name = name; string component = panelData.panelName; if (string.IsNullOrEmpty(component) == false) { instance.AddComponent(panelData.panelType); } UIPanelBase panel = instance.gameObject.GetComponent <UIPanelBase>(); if (instance != null && instance.gameObject != null) { instance.gameObject.SetActive(true); } if (panel != null) { panel.OnShow(); //GameUiManager.getInst().DontUseThisShowPanel(panel, paramsList); } GameUiManager.getInst().addLoadedWindow(name, panel, true); GameUiManager.getInst().removeLoadingWindow(name); }
public void OnReceiveLogin(Packet packet) { byte[] bytes = packet.GetBytes(); PBLoginSucc pb = PBLoginSucc.Parser.ParseFrom(bytes); PlayerManager.GetInstance().InitFromLoginData(pb); UnityEngine.Debug.LogError("f**k the result is " + pb.PlayerId); GameUiManager.getInst().showWindow(PanelType.UILogin, false); // login success and begin to do something ; GameUiManager.getInst().showWindow(PanelType.UIMain_bottom, true); GameUiManager.getInst().showWindow(PanelType.UIMain, true); VoiceManager.Instance.PlayMusic("world01"); }
// Use this for initialization void Start() { TextAsset asset = Resources.Load("HeroBase") as TextAsset; if (asset == null) { } HeroInfoProvider.Instance.LoadConfig(asset.text); //HttpUtil.Instance.sendGetRequest("http://localhost:10024/fast_login?machine_id=111111&channel=123&device=android", onLoginComplete, 3000); GameUiManager.getInst(); PanelManager.GetInstance().registerAllPanel(); GameUiManager.getInst().showWindow(PanelType.UILogin, true); }
public static GameUiManager getInst() { if (instance == null) { GameObject obj = GameObject.Find("Canvas"); if (obj == null) { return(instance); } GameObject.DontDestroyOnLoad(obj); Transform tempTrans = obj.transform; tempTrans.localScale = Vector3.zero; instance = obj.AddComponent <GameUiManager>(); instance.Init(); } return(instance); }
public void OnAssetbundleLoadComplete(GameObject instance, string prefab) { if (instance == null) { Debug.Log("instance is null!"); return; } if (GameUiManager.UIRootTran == null) { Debug.Log("UIRootTran is null!"); return; } Transform instanceTran = instance.transform; instanceTran.parent = GameUiManager.UIRootTran; instanceTran.localPosition = Vector3.zero; instanceTran.localScale = Vector3.one; PanelManager.PanelModuleData panelData = PanelManager.GetInstance().getComponent(prefab); if (panelData == null) { Debug.Log("panelData is null!"); return; } instance.name = prefab; string component = panelData.panelName; if (string.IsNullOrEmpty(component) == false) { UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(instance, "Assets/client_code/interface/manager/ResourceManager.cs (256,4)", component); } UIPanelBase panel = instance.gameObject.GetComponent <UIPanelBase>(); if (instance != null && instance.gameObject != null) { instance.gameObject.SetActive(true); } GameUiManager.getInst().addLoadedWindow(prefab, panel, true); GameUiManager.getInst().removeLoadingWindow(prefab); Resources.UnloadUnusedAssets(); }
IEnumerator PreLoadPrefabFromRes(string name) { ResourceRequest request = Resources.LoadAsync("Prefabs/" + name); yield return(request); GameObject instance = Instantiate(request.asset) as GameObject; Transform instanceTran = instance.transform; instanceTran.parent = GameUiManager.UIRootTran; instanceTran.localPosition = Vector3.zero; instanceTran.localScale = Vector3.one; PanelManager.PanelModuleData panelData = PanelManager.GetInstance().getComponent(name); instance.name = name; string component = panelData.panelName; if (string.IsNullOrEmpty(component) == false) { UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(instance, "Assets/client_code/interface/manager/ResourceManager.cs (341,4)", component); } UIPanelBase panel = instance.gameObject.GetComponent <UIPanelBase>(); if (instance != null && instance.gameObject != null) { instance.gameObject.SetActive(false); } if (panel != null) { //GameUiManager.getInst().PreLoadDontUseThisShowPanel(panel); } GameUiManager.getInst().addLoadedWindow(name, panel, false); GameUiManager.getInst().removeLoadingWindow(name); }
private void Awake() { instance = this; }
void Awake() { instance = this; }
protected virtual void OnDestroy() { Instance = null; }
protected virtual void Awake() { Instance = this; }
void OnZhenrongButtonClicked() { GameUiManager.getInst().showWindow(PanelType.UIMain, false); GameUiManager.getInst().showWindow(PanelType.UIFormation, true); }
public virtual void CloseSelf() { GameUiManager.getInst().showWindow(name, false); }