Exemplo n.º 1
0
    public void EnterGame()
    {
        if (selAvatarDBID == 0)
        {
            err("Please select a Avatar!(请选择角色!)");
        }
        else
        {
            info("Please wait...(请稍后...)");

            KBS_EnterGame e = new KBS_EnterGame();
            e.dbid = selAvatarDBID;
            KBEvent.fireIn(KET.selectAvatarGame, e);

            SceneManager.LoadScene("world");
            UIStatus = MainUIStatus.WorldUI;
        }
    }
Exemplo n.º 2
0
    public void CreateAvatar()
    {
        string sAvatarName = mAvatarNameText.text;

        if (sAvatarName.Length > 1)
        {
            KBS_CreateAvatar e = new KBS_CreateAvatar();
            e.roleType = (Byte)1;
            e.name     = sAvatarName;
            KBEvent.fireIn(KET.reqCreateAvatar, e);

            UIStatus = MainUIStatus.SelAvatarUI;
        }
        else
        {
            err("avatar name is null(角色名称为空)!");
        }
    }
Exemplo n.º 3
0
    public void createAccount()
    {
        string sAccount = mAccountText.text;
        string sPasswd  = mPasswordText.text;

        if (sAccount.Length < 0 || sPasswd.Length <= 5)
        {
            err("account or password is error, length < 6!(账号或者密码错误,长度必须大于5!)");
            return;
        }

        info("connect to server...(连接到服务端...)");

        KES_Login eventData = new KES_Login();

        eventData.username = sAccount;
        eventData.password = sPasswd;
        eventData.datas    = System.Text.Encoding.UTF8.GetBytes("kbengine_unity3d_demo");
        KBEvent.fireIn(KET.createAccount, eventData);
    }
Exemplo n.º 4
0
    public void RemoveAvatar()
    {
        if (selAvatarDBID == 0)
        {
            err("Please select a Avatar!(请选择角色!)");
        }
        else
        {
            info("Please wait...(请稍后...)");

            if (ui_avatarList != null && ui_avatarList.Count > 0)
            {
                Dictionary <string, object> avatarinfo = ui_avatarList[selAvatarDBID];
                KBS_RemoveAvatar            e          = new KBS_RemoveAvatar();
                e.name = (string)avatarinfo["name"];
                KBEvent.fireIn(KET.reqRemoveAvatar, e);

                UIStatus = MainUIStatus.SelAvatarUI;
            }
        }
    }