コード例 #1
0
    private void OnUpdateShow(EventMultiArgs args)
    {
        uint queue      = args.GetArg <uint>("queue");
        uint enterSpeed = args.GetArg <uint>("enterSpeed");

        CancelInvoke("Repeat");
        UpdateQueue(queue, enterSpeed);
    }
コード例 #2
0
    void ChangeSpecialType(object param)
    {
        EventMultiArgs  args        = (EventMultiArgs)param;
        ESpecialType    specialType = args.GetArg <ESpecialType>("specialType");
        ItemDepthConfig target      = args.GetArg <ItemDepthConfig>("target");

        target.SetSpecialType(specialType);
        if (specialType != ESpecialType.Auto)
        {
            target.SetIgnor(true);
        }
        else
        {
            target.SetIgnor(false);
        }
        AddItemConfig(target);
    }
コード例 #3
0
    //连接socket回调
    public void OnEventSocketConnectOK(EventMultiArgs args)
    {
        bool result = args.GetArg <bool>("result", true);
//        bool bReconnect = args.GetArg<bool>("reconnecting", false);
        bool bFirstWaitShow = false;

        if (result)
        {
//            UtilTools.ShowMessage("Socket登陆成功!!!!");
            UtilTools.HideWaitWin(WaitFlag.ConnectSocketFirst);
            UtilTools.HideWaitWin(WaitFlag.ConnectSocketSecond);
            if (!GameDataMgr.LOGIN_DATA.IsGetGameServerIP)
            {
                GameDataMgr.LOGIN_DATA.IsConnectGamerServer = true;
                //是否为游客
                if (GameDataMgr.PLAYER_DATA.IsTouris)
                {
                    _playerLoginName     = GameDataMgr.LOGIN_DATA.lastLoginDeviceUUID;
                    _playerLoginPassWard = "";
//                    Login(GameDataMgr.LOGIN_DATA.lastLoginDeviceUUID,"");
                }
                else
                {
                    _playerLoginName     = GameDataMgr.LOGIN_DATA.lastLoginAccount;
                    _playerLoginPassWard = GameDataMgr.LOGIN_DATA.lastLoginPassword;
                }
                Login(_playerLoginName, _playerLoginPassWard);
            }
            else
            {
                //连接游戏服务器成功
                Utils.LogSys.Log("+++++++++++++++连接游戏服务器成功++++++++++++++++++");
                GameDataMgr.LOGIN_DATA.IsConnectGamerServer = true;

                /*if (GameDataMgr.LOGIN_DATA.IsChangeAccountLogin)
                 * {
                 *  //切换帐号的登录流程
                 * //                    UIManager.GetControler<ChangeAccountController>().ChangeAccount();
                 * }*/
            }
        }
        else
        {
            if (!GameDataMgr.LOGIN_DATA.IsGetGameServerIP)
            {
                Utils.LogSys.LogError("ConectSocket Failed: Select Server");
            }
            else
            {
                Utils.LogSys.LogError("ConectSocket Failed: Game Server");
            }
            return; //socket连接超时不处理, 统一由WaitingController控制
        }
    }
コード例 #4
0
    void OnEventSetText(EventMultiArgs args)
    {
        string   text          = args.GetArg <string>("text");
        string   color         = args.GetArg <string>("color");
        string   alignment     = args.GetArg <string>("alignment");
        int      callbackCount = args.GetArg <int>("callbackCount");
        string   toShowText    = "[" + color + "]" + text + "[-]";
        UIWidget uiWidget      = labelTipText.GetComponent <UIWidget>();

        if (alignment == "Center")
        {
            uiWidget.pivot = UIWidget.Pivot.Top;
        }
        else if (alignment == "Left")
        {
            uiWidget.pivot = UIWidget.Pivot.TopLeft;
        }

        labelTipText.text      = toShowText;
        labelTipText.alignment = (labelTipText.printedSize.y > labelTipText.defaultFontSize + labelTipText.spacingY) ? NGUIText.Alignment.Left : NGUIText.Alignment.Automatic;
    }
コード例 #5
0
    private void OnEventSetText(EventMultiArgs args)
    {
        _showNum++;
        GameObject go    = NGUITools.AddChild(gameObject, _messageBg);
        string     text  = args.GetArg <string>("text");
        string     color = args.GetArg <string>("color");
        UILabel    label = go.transform.Find("Label").GetComponent <UILabel>();

        label.text = color + text;
        go.GetComponent <UIWidget>().width  = (int)label.printedSize.x + 100;
        go.GetComponent <UIWidget>().height = (int)label.printedSize.y + 21;
        //以显示的提示向上移动
        if (_messageList.Count > 0)
        {
            oncomplete();
            //GameObject lastGo = _messageList[_messageList.Count - 1].go;
            //float y = (float)(go.transform.GetComponent<UIWidget>().height + (float)lastGo.GetComponent<UIWidget>().height) / 2 + 4f;
            //for (int i = 0; i < _messageList.Count; i++) {
            //    MessageInfo item = _messageList[i];
            //    GameObject oldGo = _messageList[i].go;
            //    float newY = item.y + y;
            //    Hashtable hash = new Hashtable();
            //    hash.Add("time", 0.3f);
            //    hash.Add("y", newY);
            //    hash.Add("islocal", true);
            //    iTween.MoveTo(oldGo, hash);
            //    item.y = newY;
            //    _messageList[i] = item;
            //}

            //_messageList[0].y += 45;
        }
        MessageInfo messageInfo = new MessageInfo(go, 0);

        _messageList.Add(messageInfo);
        action(go);
    }
コード例 #6
0
    private void OnEventSetText(EventMultiArgs args)
    {
        string text      = args.GetArg <string>("text");
        string icon      = args.GetArg <string>("icon");
        string iconNum   = args.GetArg <string>("iconNum");
        string alignment = args.GetArg <string>("alignment");

        //string type = args.GetArg<string>("moneyKey");

        labelTipText.text = text;
        if (icon.Equals("C104"))
        {
            labelTitleText.text = GameText.Format("message_desc2", iconNum);
        }
        else if (icon.Equals("C101"))
        {
            labelTitleText.text = GameText.Format("message_desc3", iconNum);
        }
        else if (icon.Equals("C102"))
        {
            labelTitleText.text = GameText.Format("message_desc5", iconNum);
        }
        else
        {
            labelTitleText.text = GameText.Format("message_desc3", iconNum);
        }
        UIWidget uiWidget = labelTipText.GetComponent <UIWidget>();

        if (alignment == "Center")
        {
            uiWidget.pivot = UIWidget.Pivot.Top;
        }
        else if (alignment == "Left")
        {
            uiWidget.pivot = UIWidget.Pivot.TopLeft;
        }
    }
コード例 #7
0
    public void ChangePlatform(object obj)
    {
        EventMultiArgs func     = obj as EventMultiArgs;
        string         platform = func.GetArg <string>("platform");

        _curPlatform = platform;
        _log         = "";
        _error       = "";
        _curVersion  = "";
        _savedPath   = "";
        //_strVersionXMLUrl = "";
        _sProgramVersion  = "";
        _sResultDirName   = "";
        _sResultDirName   = platform;
        _strVersionXMLUrl = string.Format(_strVersionXMLUrl_format, version_dir, platform);
        Init(_curPlatform);
    }
コード例 #8
0
    void OnEventSetText(EventMultiArgs args)
    {
        string text          = args.GetArg <string>("text");
        string color         = args.GetArg <string>("color");
        string alignment     = args.GetArg <string>("alignment");
        int    callbackCount = args.GetArg <int>("callbackCount");
        string okBtnName     = args.GetArg <string>("okBtnName");

        _coolSec = args.GetArg <int>("closeSecond");
        bool isShowCloseBtn = args.GetArg <bool>("showClose");

        string toShowText = "[" + color + "]" + text + "[-]";

        UIWidget uiWidget = labelTipText.GetComponent <UIWidget>();

        if (alignment == "Center")
        {
            uiWidget.pivot = UIWidget.Pivot.Top;
        }
        else if (alignment == "Left")
        {
            uiWidget.pivot = UIWidget.Pivot.TopLeft;
        }
        if (_coolSec > 0)
        {
            coolText.text = GameText.Format("auto_back", _coolSec);
            endTime       = UtilTools.GetServerTime() + _coolSec;
        }
        labelTipText.text      = toShowText;
        labelTipText.alignment = (labelTipText.printedSize.y > labelTipText.defaultFontSize + labelTipText.spacingY) ? NGUIText.Alignment.Left : NGUIText.Alignment.Automatic;
        if (alignment == "CenterAll")
        {
            uiWidget.pivot         = UIWidget.Pivot.Top;
            labelTipText.alignment = NGUIText.Alignment.Automatic;
        }
        if (okBtnName != "")
        {
            oKButton.Find("Label").GetComponent <UILabel>().text = okBtnName;
        }
        if (callbackCount == 0)
        {
            cancelButton.gameObject.SetActive(false);
        }
        else
        {
            cancelButton.gameObject.SetActive(true);
        }
        closeButton.gameObject.SetActive(isShowCloseBtn);
        //if (title == "default")
        //    title = GameText.GetStr("messageDialog_tip");

        //labelTitleText.text = title;

        /*
         * if (controller.needCloseButton)
         * {
         *  closeButton.gameObject.SetActive(true);
         * }
         * else
         * {
         *  closeButton.gameObject.SetActive(false);
         * }*/
    }