Beispiel #1
0
    void OnMainButtonClicked()
    {
        Debuger.Log("main button clicked ");

        GameUiManager.getInst().showWindow(PanelType.UIMain, false);
        GameUiManager.getInst().showWindow(PanelType.UIHeroList, true);
    }
Beispiel #2
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);
    }
Beispiel #3
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");
    }
Beispiel #4
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);
    }
Beispiel #5
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();
    }
Beispiel #6
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);
    }
Beispiel #7
0
 void OnZhenrongButtonClicked()
 {
     GameUiManager.getInst().showWindow(PanelType.UIMain, false);
     GameUiManager.getInst().showWindow(PanelType.UIFormation, true);
 }
Beispiel #8
0
 public virtual void CloseSelf()
 {
     GameUiManager.getInst().showWindow(name, false);
 }