コード例 #1
0
        private void OnMsg_LoadView_setProgress(MobaMessage msg)
        {
            int num = 0;
            MsgData_LoadView_setProgress msgData_LoadView_setProgress = msg.Param as MsgData_LoadView_setProgress;

            if (msgData_LoadView_setProgress != null)
            {
                if (!Singleton <PvpManager> .Instance.IsObserver)
                {
                    int myLobbyUserId = Singleton <PvpManager> .Instance.MyLobbyUserId;
                    if (msgData_LoadView_setProgress.AddType == MsgData_LoadView_setProgress.SetType.addNum)
                    {
                        num = this.SetComProgress(myLobbyUserId, msgData_LoadView_setProgress.Num, true);
                    }
                    else if (msgData_LoadView_setProgress.AddType == MsgData_LoadView_setProgress.SetType.targetNum)
                    {
                        num = this.SetComProgress(myLobbyUserId, msgData_LoadView_setProgress.Num, false);
                    }
                    HeroExtraInRoom heroExtraByUserId = Singleton <PvpManager> .Instance.RoomInfo.GetHeroExtraByUserId(myLobbyUserId);

                    if (heroExtraByUserId != null)
                    {
                        heroExtraByUserId.LoadProgress = num;
                    }
                    PvpEvent.SendLoadingProcessEvent((byte)num);
                }
            }
        }
コード例 #2
0
ファイル: V3TeamMem.cs プロジェクト: whztt07/mobahero_src
    private void OnMsg_LoadView_setProgress(MobaMessage msg)
    {
        int num = 0;
        MsgData_LoadView_setProgress msgData_LoadView_setProgress = msg.Param as MsgData_LoadView_setProgress;

        if (msgData_LoadView_setProgress != null)
        {
            if (!Singleton <PvpManager> .Instance.IsObserver)
            {
                if (msgData_LoadView_setProgress.AddType == MsgData_LoadView_setProgress.SetType.addNum)
                {
                    num = this.SetComProgress(msgData_LoadView_setProgress.Num, true);
                }
                else if (msgData_LoadView_setProgress.AddType == MsgData_LoadView_setProgress.SetType.targetNum)
                {
                    num = this.SetComProgress(msgData_LoadView_setProgress.Num, false);
                }
                HeroExtraInRoom heroExtraByUserId = Singleton <PvpManager> .Instance.RoomInfo.GetHeroExtraByUserId(this.MemInfo.newUid);

                if (heroExtraByUserId != null)
                {
                    heroExtraByUserId.LoadProgress = num;
                }
                this.qKeyPoint.Enqueue(num);
            }
        }
    }
コード例 #3
0
ファイル: V3TeamMem.cs プロジェクト: whztt07/mobahero_src
    private void Update()
    {
        if (this.finishFlag)
        {
            return;
        }
        HeroExtraInRoom heroExtraByUserId = Singleton <PvpManager> .Instance.RoomInfo.GetHeroExtraByUserId(this.MemInfo.newUid);

        if (heroExtraByUserId != null && this.targetProgress < heroExtraByUserId.LoadProgress)
        {
            this.targetProgress = heroExtraByUserId.LoadProgress;
        }
        if (this.displayProgress != 100)
        {
            if (this.displayProgress < this.targetProgress)
            {
                if (this.targetProgress > 100)
                {
                    this.displayProgress = 100;
                }
                else if (this.targetProgress == 100)
                {
                    this.displayProgress = Math.Min(100, this.displayProgress + 10);
                }
                else
                {
                    this.displayProgress = Math.Min(this.targetProgress, this.displayProgress + 1);
                }
                this.RefreshUI_progress();
                if (this.isMainPlayer)
                {
                    while (this.qKeyPoint.Count > 0)
                    {
                        int num = this.qKeyPoint.Peek();
                        if (this.displayProgress < num)
                        {
                            break;
                        }
                        Debug.Log("Self send progress:" + num);
                        PvpEvent.SendLoadingProcessEvent((byte)this.qKeyPoint.Dequeue());
                    }
                }
            }
        }
        else
        {
            this.finishFlag = true;
            if (this.OnLoadFinish != null)
            {
                this.OnLoadFinish(this);
            }
        }
    }
コード例 #4
0
        private void P2C_LoadProcess(MobaMessage msg)
        {
            Shader.WarmupAllShaders();
            C2PLoadProcess probufMsg = msg.GetProbufMsg <C2PLoadProcess>();
            int            newUid    = probufMsg.newUid;
            byte           process   = probufMsg.process;

            PvpStateBase.LogState(string.Concat(new object[]
            {
                "===>receive: P2C_LoadProcess:",
                newUid,
                " ",
                process
            }));
            HeroExtraInRoom heroExtraByUserId = Singleton <PvpManager> .Instance.RoomInfo.GetHeroExtraByUserId(newUid);

            if (heroExtraByUserId != null)
            {
                heroExtraByUserId.LoadProgress = (int)process;
            }
            MobaMessageManager.DispatchMsg(ClientC2C.PvpLoadProcess, new ParamLoadProcess(newUid, process));
        }