Exemplo n.º 1
0
 void clickShareHandler()
 {
     if (GlobalConst.LoginToApp == false)
     {
         PageManager.Instance.CurrentPage.AddNode <ShareInputNode> (true);
         return;
     }
     LoginRpcProxy.getInstance().ShareWeChatGameByLevelID();
     PageManager.Instance.CurrentPage.GetNode <WinNode> ().Open();
 }
Exemplo n.º 2
0
    //private void registerUserCallback()
    //{
    //	Input_account.text = userName;
    //	Input_pwd.text = password;
    //}

    //登陆操作
    private void loginClickHandler()
    {
        //if(btn_login!=null)
        //btn_login.enabled = false;
        bool login = LoginRpcProxy.getInstance().LoginToApp(Input_account.text, Input_pwd.text, (int code) =>
        {
            //if (btn_login != null)
            //btn_login.enabled = true;
            if (code == 1)
            {
                if (loginDelegate != null)
                {
                    loginDelegate.Invoke();
                }
            }
        });
    }
Exemplo n.º 3
0
    private void LoadUserData()
    {
        if (string.IsNullOrEmpty(SelfPlayerData.DeviceID))
        {
            //var preNames = Resources.Load<TextAsset>("Names/preNames").text.Split('\n');
            var postNames = Resources.Load <TextAsset>("Names/postNames").text.Split('\n');

            System.Random ran = new System.Random();
            //int a = ran.Next(0, preNames.Length - 1);
            int b = ran.Next(0, postNames.Length - 1);

            //SelfPlayerData.Nickname = preNames[a] + " " + postNames[b];
            SelfPlayerData.Nickname = postNames[b];
        }

        bool m_NetWork = MiscUtils.IsOnline();

        if (m_NetWork)
        {
            if (string.IsNullOrEmpty(SelfPlayerData.DeviceID))
            {
                LoginRpcProxy.getInstance().LoginByAnonymous();
            }
            else
            {
                LoginRpcProxy.getInstance().GetGuestUserInfoByDeviceId();
            }
        }
        else
        {
            //if(string.IsNullOrEmpty(SelfPlayerData.ModelId)||"0".Equals(SelfPlayerData.ModelId)||string.IsNullOrEmpty(SelfPlayerData.EmotionId) || "0".Equals(SelfPlayerData.EmotionId))
            //{
            //	//当本地也没有角色信息则跳转创建角色场景
            //	LoadSceneManager.Instance.LoadNormalScene("CreateUserRole");
            //}
            //else
            //{
            //	//本地有角色的信息则跳转选关界面
            //	LoadSceneManager.Instance.LoadNormalScene("BookScene");
            //}
        }

        // 临时关闭
        //UpdataLevelScore();
    }
Exemplo n.º 4
0
    void onClickLoginHandle()
    {
        Regex Reg_Phone = new Regex(@"^1[2|3|4|5|6|7|8|9][0-9]\d{4,8}$");

        if (Input_pwd.text.Length < 11 || Reg_Phone.IsMatch(Input_pwd.text) == false)
        {
            ImgInputTelOK.transform.gameObject.SetActive(false);
            ImgInputTelError.transform.gameObject.SetActive(true);
            PromptManager.Instance.MessageBox(PromptManager.Type.FloatingTip, "手机号输入有误,请重新输入");
            return;
        }
        SelfPlayerData.TelphoneNum = Input_pwd.text;
        SaveDataUtils.Save <SelfPlayerData>();
        LoginRpcProxy.getInstance().ShareWeChatGameByLevelID();
        PageManager.Instance.CurrentPage.GetNode <ShareActivityNode>().Close(false);
        PageManager.Instance.CurrentPage.GetNode <WinNode>().Open();
        Close(true);
    }
Exemplo n.º 5
0
    private void initEvents()
    {
        LoginRpcProxy.getInstance().shareDelegate += closeHandler;

        ShareBtn.onClick.AddListener(clickShareHandler);

        CloseBtn.onClick.AddListener(() => {
            Close(false);
            PageManager.Instance.CurrentPage.GetNode <WinNode> ().Open();
        });

        PlayButton.onClick.AddListener(() => {
            MicManager.Instance.PlayAllVoice(SelfPlayerData.Uuid, StaticData.LevelID);
            PlayButton.gameObject.SetActive(false);
            ImgFloat.gameObject.gameObject.SetActive(true);
            ImgUnder.gameObject.gameObject.SetActive(true);
        });
    }
Exemplo n.º 6
0
 private void closeHandler()
 {
     LoginRpcProxy.getInstance().shareDelegate -= closeHandler;
     Close(false);
 }
Exemplo n.º 7
0
 public static LoginRpcProxy getInstance()
 {
     return(instance == null ? instance = new LoginRpcProxy() : instance);
 }
Exemplo n.º 8
0
 /// 存入 SelfPlayerData
 public static void UploadUser(Action callback = null)
 {
     LoginRpcProxy.getInstance().UploadGameUserInfo(callback);
 }
Exemplo n.º 9
0
    public void GameFinish()
    {
        m_Status = GameStatus.Finish;
        AudioController.Play("applause");

        if (m_WrongNum == 0)
        {
            AudioController.Play("combo_perfect");
        }
        if (m_Life > 0)
        {
            AnalysisManager.Instance.OnEvent("100002", null, StaticData.LevelID.ToString(), "完成游戏");
            AnalysisManager.Instance.OnEvent("100001", null, StaticData.LevelID.ToString(), m_Life.ToString());
            AnalysisManager.Instance.OnLevelCompleted(StaticData.LevelID.ToString());
        }
        else
        {
            AnalysisManager.Instance.OnEvent("100002", null, StaticData.LevelID.ToString(), "完成游戏");
            AnalysisManager.Instance.OnEvent("100001", null, StaticData.LevelID.ToString(), "空血通关");
            AnalysisManager.Instance.OnLevelFailed(StaticData.LevelID.ToString(), "没血通关");
        }
        // 记录成绩
        SelfPlayerLevelData.TempRankIncrement = SelfPlayerLevelData.CurRank;
        Debug.LogWarning("  记录成绩 = " + SelfPlayerLevelData.TempRankIncrement);
        Debug.Log("<======记录舞蹈数据 boss战舞蹈数据为空 ======>");
        // 打开UI
        if (CorePlayData.BossLife > 0)
        {
            m_ProcessData = null;
            SelfPlayerRoleTitleData.Instance.UpdateRoleTitleCount(50002);
        }
        else
        {
            SelfPlayerRoleTitleData.Instance.UpdateRoleTitleCount(50001);
            PlayerOperationData operData = new PlayerOperationData();
            operData.wholeScore    = m_Score;
            operData.clickAccuracy = (float)m_CorrectNum / m_AllWordNum;
            operData.clickNumber   = m_AllWordNum;
            operData.clickScore    = m_Score - (int)(m_SumVoiceScore * CorePlaySettings.Instance.m_VoiceRightPoint);
            operData.wrongNumber   = m_WrongNum;
            operData.rightNumber   = m_CorrectNum;
            operData.m_ReadingData = CorePlayData.PlayerReadingData;

            //临时测试上传操作过程数据
            m_ProcessData = operData.GetJson();
        }
        SaveDataUtils.Save <SelfPlayerRoleTitleData>();
        DancingWordAPI.Instance.UpDateServerRoleTitleInfo(SelfPlayerRoleTitleData.RoleTitleList);
        SaveResultToLocal(m_Life);
        int grade = SetLevel.setLevel(SelfPlayerLevelData.CurAccuracy);

        SelfPlayerData.Instance.AddExpAndSaveToLocal(grade);
        // 关录音
        XunFeiSRManager.Instance.StopListen();
        MicManager.Instance.StopRecord();
        LoginRpcProxy.getInstance().SaveLevelVoices(MicManager.Instance.voiceDic);

        PageManager.Instance.CurrentPage.GetComponent <CorePlayPage>().HidePauseButton();
        if (CorePlayData.BossLife > 0)
        {
            PageManager.Instance.CurrentPage.GetNode <WinNode>().Open();
        }
        else
        {
            HttpHandler.UploadScore(ServerDataCallback, true);
            m_AlreadyRuning = false;
            LoadStage();
        }
    }