Ejemplo n.º 1
0
 void Message_Login_Result(TcpResponseLogin _mes)
 {
     if (_mes.result)
     {
         NetGlobal.Instance().userUid     = _mes.uid;
         NetGlobal.Instance().udpSendPort = _mes.udpPort;
         Debug.Log("登录成功~~~" + NetGlobal.Instance().userUid);
         ClearSceneData.LoadScene(GameConfig.mainScene);
     }
     else
     {
         Debug.Log("登录失败~~~");
         waitTip.SetActive(false);
     }
 }
Ejemplo n.º 2
0
 private void LoginCon_On_TCP_Message(MessageBuffer msg)
 {
     if (ServerToClientID.TcpResponseLogin == (ServerToClientID)msg.Id())
     {
         TcpResponseLogin _mes = ProtoTransfer.DeserializeProtoBuf3 <TcpResponseLogin>(msg);
         if (_mes.Result)
         {
             Debug.Log("登录成功~~~" + _mes.Uid);
             ClientService.GetSingleton().token = _mes.Token;
             //场景
             ClearSceneData.LoadScene(GameConfig.mainScene);
         }
         else
         {
             text.text = _mes.Reason;
             waitTip.SetActive(false);
         }
     }
 }
Ejemplo n.º 3
0
    public IEnumerator waitForUpdate(string xmlName)
    {
        UnityEngine.Debug.Log("waitForUpdate");
        UnityEngine.Debug.Log(AppOpera.OperaStatus);
        while (AppOpera.OperaStatus != AppOperState.Loop && AppOpera.OperaStatus != AppOperState.Apprun && AppOpera.OperaStatus != AppOperState.LoadScene)
        {
            yield return(null);
        }
        UnityEngine.Debug.Log("end wait");
        string tmpName;

        tmpName = "PPTVesal";
        try
        {
            char[]   separator = { '*' };
            string[] message   = new string[4];
            //"91*C:\\VesalDigital\\PPT\\Data\\vesal.dat*C13B491BEB*SA0101047"
            message   = xmlName.Split(separator);
            User      = message[0];
            url       = message[1];
            password  = message[2];
            sceneName = message[3];
            //CollectionB = "";
            UnityEngine.Debug.Log("message:" + message);


            //不要摧毁此物体,切换控制
            DontDestroyOnLoad(this.gameObject);

            tmpName = LoadXml();
            if (tmpName == "PPTBookmark")
            {
                string jsonPath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal/sign/NewAndOldSign.json";
                Dictionary <int, NewAndOldSign> nao = JsonConvert.DeserializeObject <Dictionary <int, NewAndOldSign> >(File.ReadAllText(jsonPath));
                foreach (NewAndOldSign tmpNao in nao.Values)
                {
                    if (sceneName == tmpNao.app_id_old && tmpNao.app_id_new != "")
                    {
                        sceneName = tmpNao.app_id_new;
                        //UnityEngine.Debug.LogError(sceneName);
                        tmpName = "UI_sign_all";
                        break;
                    }
                }
            }
            UnityEngine.Debug.Log("tmpName:" + tmpName + "--" + sceneName);
            string   result   = getType(sceneName);
            string[] tmpAyyay = result.Split('@');
            PublicClass.app = null;
            if (SceneModels.instance != null)
            {
                SceneModels.instance.destoryTempParent();
            }
            //判断模式
            switch (tmpName)
            {
            case "PPTAnimation":
                //3D动画
                AnimationControl.url   = url;
                AnimationControl.pwd   = password;
                AnimationControl.aniNo = sceneName;
                ClearSceneData.LoadLevel(tmpName);
                break;

            case "PPTAnimation2D":
                ClearSceneData.LoadLevel(tmpName);
                //2d动画
                break;

            case "PPTBookmark":
                //旧标注
                PublicClass.app             = new App();
                PublicClass.app.app_type    = "sign";
                PublicClass.app.struct_name = tmpAyyay[1];
                PublicClass.app.app_id      = sceneName;
                //PublicClass.app.ab_path = sceneName + "_1.assetbundle";
                PublicClass.app.xml_path = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal/sign/" + sceneName + "_1.assetbundle";
                break;

            case "UI_sign_all":
                //新标注
                PublicClass.app          = new App();
                PublicClass.app.ab_path  = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal/sign_ssp_path/SignNewJG.db";
                PublicClass.app.app_id   = sceneName;
                PublicClass.app.app_type = "sign_new";
                break;

            case "PPTVesal":
                PublicClass.app = new App();
                //PublicClass.app.ab_path = ;
                PublicClass.app.app_id   = sceneName;
                PublicClass.app.app_type = "model";
                //模型
                break;
            }
            if (!tmpName.Contains("PPTAnimation"))
            {
                if (GameObject.Find("DataOpera") != null)
                {
                    if (PublicClass.app != null)
                    {
                        GameObject.Find("DataOpera").GetComponent <AppOpera>().Get_app(PublicClass.app);
                    }
                }
                else
                {
                    SceneManager.LoadScene("SceneSwitch");
                }
            }
        }
        catch (Exception e)
        {
            UnityEngine.Debug.Log(e.Message);
            UnityEngine.Debug.Log(e.StackTrace);
        }

        //isReadyToSwitch = true;
        //SwitchSceneName = tmpName;
    }
Ejemplo n.º 4
0
    void Message_Enter_Battle(PBBattle.TcpEnterBattle _mes)
    {
        BattleData.Instance.UpdateBattleInfo(_mes.randSeed, _mes.battleUserInfo);

        ClearSceneData.LoadScene(GameConfig.battleScene);
    }
Ejemplo n.º 5
0
 public void OnClickExit()
 {
     ClearSceneData.LoadScene(GameConfig.mainScene);
 }