//选定角色后登陆游戏
 public void SendMsgC2GSEnterGame(pb.RoleInfo info, bool isNewRole)
 {
     Debug.Log("======================>>>SendMsgC2GSEnterGame");
     pb.C2GSEnterGame msg = new pb.C2GSEnterGame();
     msg.AccountName      = LocalFile.Load("AccountName");
     msg.SelectedRoleInfo = info;
     msg.IsNewRole        = isNewRole;
     NetworkManager.Instance.SendToGAS((int)MsgDef.C2GSEnterGame, msg);
 }
Beispiel #2
0
 private void SelectRoleType(RoleType selectType)
 {
     this.SelectedRoleType = selectType;
     this.RoleModelList[0].gameObject.SetActive(this.SelectedRoleType == RoleType.Warrior);
     this.RoleModelList[1].gameObject.SetActive(this.SelectedRoleType == RoleType.Assassin);
     this.RoleModelList[2].gameObject.SetActive(this.SelectedRoleType == RoleType.Armourer);
     this.RoleModelList[0].SetInteger("ActorType", 0);
     this.RoleModelList[1].SetInteger("ActorType", 0);
     this.RoleModelList[2].SetInteger("ActorType", 0);
     GameManager.Instance.MainCamera.transform.localPosition = new Vector3(100, 0, 0);
     pb.RoleInfo info = CreateRoleMgr.Instance.QueryRoleInfoByType(selectType);
     this.InputName.gameObject.SetActive(info == null);
 }
Beispiel #3
0
    private void OnClickEnterGame(GameObject go)
    {
        GameManager.Instance.MainCamera.transform.localPosition = new Vector3(1000, 0, 0);
        UIManager.Instance.ShowWindow <LoadingUI>(eWindowsID.LoadingUI);
        bool isNewRole = false;

        pb.RoleInfo roleInfo = CreateRoleMgr.Instance.QueryRoleInfoByType(this.SelectedRoleType);
        if (roleInfo == null)
        {
            if (string.IsNullOrEmpty(this.InputName.value))
            {
                Debug.LogError("名字不能为空");
                return;
            }
            isNewRole         = true;
            roleInfo.RoleType = (int)this.SelectedRoleType;
            roleInfo.RoleName = this.InputName.value;
        }
        LoginMsgHandler.Instance.SendMsgC2GSEnterGame(roleInfo, isNewRole);
    }