示例#1
0
    public override void InitPanel(Transform uiSprite)
    {
        base.InitPanel(uiSprite);
        _login    = uiSprite.FindChild("login").GetComponent <Button>();
        _zc       = uiSprite.FindChild("zc").GetComponent <Button>();
        _close    = uiSprite.FindChild("CloseBtn").GetComponent <Button>();
        _name     = uiSprite.FindChild("name").GetComponent <InputField>();
        _password = uiSprite.FindChild("password").GetComponent <InputField>();

        _login.onClick.AddListener(delegate
        {
            if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_password.text))
            {
                QuickTips.ShowQuickTipsNor("用户名或密码不能为空");
                return;
            }

            ProtoReq.LoginReq(GameConst.isGuest, _name.text.ToZhuan(), _name.text.ToZhuan(), 0, "htttp://test", _password.text);
            //DestoryPanel();
            ClosePanel();
        });

        _zc.onClick.AddListener(delegate
        {
            if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_password.text))
            {
                QuickTips.ShowQuickTipsNor("用户名或密码不能为空");
                return;
            }

            ProtoReq.zc(_name.text, _password.text);
        });

        _close.onClick.AddListener(delegate
        {
            ClosePanel();
        });
    }