Exemplo n.º 1
0
    void OnMainButtonClicked()
    {
        Debuger.Log("main button clicked ");

        GameUiManager.getInst().showWindow(PanelType.UIMain, false);
        GameUiManager.getInst().showWindow(PanelType.UIHeroList, true);
    }
Exemplo n.º 2
0
 void Awake()
 {
     if (!m_instance)
     {
         m_instance = this;
     }
     m_gameOverObj.SetActive(false);
     m_isPause    = false;
     m_isGameOver = false;
 }
Exemplo n.º 3
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    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");
    }
Exemplo n.º 6
0
    // 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);
    }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
    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();
    }
Exemplo n.º 9
0
    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);
    }
Exemplo n.º 10
0
 private void Awake()
 {
     instance = this;
 }
Exemplo n.º 11
0
 void Awake()
 {
     instance = this;
 }
Exemplo n.º 12
0
 protected virtual void OnDestroy()
 {
     Instance = null;
 }
Exemplo n.º 13
0
 protected virtual void Awake()
 {
     Instance = this;
 }
Exemplo n.º 14
0
 void OnZhenrongButtonClicked()
 {
     GameUiManager.getInst().showWindow(PanelType.UIMain, false);
     GameUiManager.getInst().showWindow(PanelType.UIFormation, true);
 }
Exemplo n.º 15
0
 public virtual void CloseSelf()
 {
     GameUiManager.getInst().showWindow(name, false);
 }