Пример #1
0
 private void RespCallback(IAsyncResult asynchronousResult)
 {
     try
     {
         this.myRequestState                = (Downloader.RequestState)asynchronousResult.get_AsyncState();
         this.myRequestState.response       = (HttpWebResponse)this.myRequestState.request.EndGetResponse(asynchronousResult);
         this.myRequestState.streamResponse = this.myRequestState.response.GetResponseStream();
         Debug.Log("BeginRead:");
         this.Result = this.myRequestState.streamResponse.BeginRead(this.myRequestState.BufferRead, 0, 524288, new AsyncCallback(this.ReadCallBack), this.myRequestState);
     }
     catch (Exception ex)
     {
         TimerHeap.DelTimer(this.timeOutTimer);
         if (this.Handle != null)
         {
             this.Handle.Unregister(this.Result.get_AsyncWaitHandle());
             this.Handle = null;
         }
         if (!this.ManualHandle)
         {
             Debug.LogError("RespCallback WebException raised!");
             Debug.LogError(ex.ToString());
             Loom.Current.QueueOnMainThread(delegate
             {
                 this.ExceptionHandle();
             });
         }
     }
 }
Пример #2
0
 private void GetDownloadFileSize()
 {
     try
     {
         this.myRequestState.request = (HttpWebRequest)WebRequest.Create(this.URL);
         this.myRequestState.request.set_KeepAlive(false);
         this.myRequestState.request.set_Timeout(8000);
         this.myRequestState.request.set_ReadWriteTimeout(8000);
         this.GetSizeTimer();
         this.Result = this.myRequestState.request.BeginGetResponse(new AsyncCallback(this.GetSizeRes), this.myRequestState);
     }
     catch (Exception ex)
     {
         TimerHeap.DelTimer(this.getSizeTimer);
         if (this.Handle != null)
         {
             this.Handle.Unregister(this.Result.get_AsyncWaitHandle());
             this.Handle = null;
         }
         if (!this.ManualHandle)
         {
             Debug.LogError("GetDownloadFileSize Exception raised!");
             Debug.LogError(ex.ToString());
             Loom.Current.QueueOnMainThread(delegate
             {
                 this.ExceptionHandle();
             });
         }
     }
 }
Пример #3
0
 public void GoDownload()
 {
     try
     {
         Debug.LogFormat("GoDownload:{0} from:{1}", new object[]
         {
             this.URL,
             this.from
         });
         this.myRequestState.request = (HttpWebRequest)WebRequest.Create(this.URL);
         this.myRequestState.request.set_KeepAlive(false);
         this.myRequestState.request.set_Timeout(8000);
         this.myRequestState.request.set_ReadWriteTimeout(8000);
         this.myRequestState.request.AddRange(this.from);
         this.TimeOutListener();
         this.Result = this.myRequestState.request.BeginGetResponse(new AsyncCallback(this.RespCallback), this.myRequestState);
     }
     catch (Exception ex)
     {
         TimerHeap.DelTimer(this.timeOutTimer);
         if (this.Handle != null)
         {
             this.Handle.Unregister(this.Result.get_AsyncWaitHandle());
             this.Handle = null;
         }
         Debug.LogError("GoDownload Exception raised!");
         Debug.LogError(ex.ToString());
         if (!this.ManualHandle)
         {
             this.ExceptionHandle();
         }
     }
 }
Пример #4
0
    public void ShowRebornNotice()
    {
        int        seconds = 5;
        uint       timerId = 0;
        MsgBoxInfo info    = new MsgBoxInfo();

        info.Content = LanguageData.GetContent(122, seconds);
        info.ShowBtn = false;
        UIManager.I.ShowUI <MsgBoxUILogic>(info, delegate()
        {
            BattleUI.gameObject.SetActive(false);
            var mgr = UIManager.I.GetUILogic <MsgBoxUILogic>();
            timerId = TimerHeap.AddTimer(1000, 1000, delegate()
            {
                LoggerHelper.Debug("seconds=" + seconds);
                if (seconds < 0)
                {
                    TimerHeap.DelTimer(timerId);
                    mgr.Close();
                    BattleUI.gameObject.SetActive(true);
                    MogoWorld.thePlayer.RpcCall("Reborn", MogoWorld.thePlayer.ID);
                    return;
                }
                mgr.UpdateContent(LanguageData.GetContent(122, seconds));
                seconds--;
            });
        });
    }
Пример #5
0
    public void ShowFloatTxtForPower(string txt)
    {
        //m_msgBoxCamera.SetActive(true);
        TimerHeap.DelTimer(m_timerIdfloatMsgForPower);
        m_tpFloatMsgForPower.onFinished = (t) =>
        {
            m_timerIdfloatMsgForPower = TimerHeap.AddTimer(2000, 0, () =>
            {
                m_taFloatMsgForPowerBg.enabled = true;
                m_taFloatMsgForPower.enabled   = true;
            });
        };
        m_taFloatMsgForPower.onFinished = (t) =>
        {
            m_goFloatMsgForPower.SetActive(false);
            //m_msgBoxCamera.SetActive(false);
        };

        m_taFloatMsgForPowerBg.Reset();
        m_tpFloatMsgForPower.Reset();
        m_taFloatMsgForPower.Reset();

        m_tpFloatMsgForPower.enabled   = true;
        m_taFloatMsgForPower.enabled   = false;
        m_taFloatMsgForPowerBg.enabled = false;

        m_lblFloatMsgForPower.text = txt;

        m_goFloatMsgForPower.SetActive(true);
    }
Пример #6
0
    private void Move(float dst, float duration)
    {
        float   dst_per_frame  = 0f;
        uint    t              = 0u;
        float   already_move_x = 0f;
        Vector3 now_pos        = this.content.get_rectTransform().get_localPosition();

        dst_per_frame = dst / duration * 20f;
        if (already_move_x < dst)
        {
            t = TimerHeap.AddTimer(0u, 20, delegate
            {
                if (already_move_x < dst)
                {
                    now_pos.x -= dst_per_frame;
                    this.content.get_rectTransform().set_localPosition(now_pos);
                    already_move_x += dst_per_frame;
                }
                else
                {
                    TimerHeap.DelTimer(t);
                    BroadcastManager.Instance.MoveOver();
                }
            });
        }
    }
Пример #7
0
    protected void InitEffect(EffectMessage message)
    {
        if ((message.caster.IsEntitySelfType || message.caster.OwnerID == EntityWorld.Instance.EntSelf.ID || message.caster.IsEntityMonsterType) && message.effectData.cameraRelyPickup == 0)
        {
            for (int i = 0; i < message.effectData.cameraEffect.get_Count(); i++)
            {
                int cameraEffectID = message.effectData.cameraEffect.get_Item(i);
                this.effectCameraTimerList.Add(TimerHeap.AddTimer((uint)(20 * i), 0, delegate
                {
                    this.HandleCameraEffect(cameraEffectID);
                }));
            }
        }
        this.StartEffect(false, message);
        int count = message.effectData.time - 1;

        if (count > 0)
        {
            uint effectLoopTimer = 0u;
            effectLoopTimer = TimerHeap.AddTimer((uint)message.effectData.interval, message.effectData.interval, delegate
            {
                this.StartEffect(true, message);
                count--;
                if (count <= 0)
                {
                    TimerHeap.DelTimer(effectLoopTimer);
                }
            });
            this.effectLoopTimerList.Add(effectLoopTimer);
        }
    }
Пример #8
0
    public void AppClearFuse(long targetID, bool isDeadDefuse)
    {
        EntityParent entityByID = LocalAgent.GetEntityByID(targetID);

        if (entityByID == null)
        {
            return;
        }
        if (entityByID.BattleBaseAttrs == null)
        {
            return;
        }
        if (!this.fuseStateTable.ContainsKey(targetID))
        {
            return;
        }
        FuseState fuseState = this.fuseStateTable[targetID];

        TimerHeap.DelTimer(fuseState.timerID);
        if (!isDeadDefuse)
        {
            LocalBattleProtocolSimulator.SendExitFit(targetID, fuseState.petID, fuseState.modelID, fuseState.skill);
        }
        this.ResetFuseAttrs(targetID, 0L, fuseState);
        entityByID.SetValue(GameData.AttrType.MoveSpeed, DataReader <AvatarModel> .Get(fuseState.modelID).speed, true);
        this.fuseStateTable.Remove(targetID);
    }
Пример #9
0
 protected override void OnDisable()
 {
     base.OnDisable();
     TeamBasicManager.Instance.QueryTeamList = null;
     this.btnListPool.Clear();
     TimerHeap.DelTimer(this.quickBtnTimerID);
 }
Пример #10
0
 public override void ExitBattleField()
 {
     TimerHeap.DelTimer(this.cameraTimer);
     TimerHeap.DelTimer(this.showWinPoseTimer);
     TimerHeap.DelTimer(this.showWinUITimer);
     base.ExitBattleField();
 }
Пример #11
0
 protected override void OnDestroy()
 {
     TimerHeap.DelTimer(this.stopTimer);
     FXManager.Instance.DeleteFX(this.aimMarkFxID);
     ActorVisibleManager.Instance.Remove(base.FixTransform);
     base.OnDestroy();
 }
Пример #12
0
 public void OnGetRedPacketRes(short state, GetRedPacketRes down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         if (down.Status)
         {
             this.PanelData = down;
             UIManagerControl.Instance.OpenUI("RedBagUI", UINodesManager.NormalUIRoot, false, UIType.NonPush);
         }
         else
         {
             UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513247, false));
         }
         if (this.delayId != 0u)
         {
             TimerHeap.DelTimer(this.delayId);
         }
         this.isCantnotGetInfo = false;
         this.delayId          = TimerHeap.AddTimer(6000u, 0, delegate
         {
             this.isCantnotGetInfo = true;
         });
     }
 }
Пример #13
0
 public void Clean()
 {
     TimerHeap.DelTimer(timer);
     EventDispatcher.RemoveEventListener(Events.OtherEvent.SecondPast, CountDownSkillBuffTime);
     clientBuffs.Clear();
     m_skillBuffDataList.Clear();
 }
Пример #14
0
 protected void OnDelayExecuteTask()
 {
     if (this.mDelayExecuteId > 0u)
     {
         if (GuideManager.Instance.guide_lock)
         {
             Debug.Log("任务延迟后操作被指引打断!!!");
             return;
         }
         if (this.Task.status == Package.Task.TaskStatus.TaskReceived)
         {
             MainTaskManager.Instance.ExecuteTask(this.Task.taskId, false);
         }
         else if (this.Task.status == Package.Task.TaskStatus.TaskFinished)
         {
             BaseTask task = MainTaskManager.Instance.GetTask(MainTaskManager.Instance.CurTaskId, true);
             if (task != null && task.Task.taskType == this.Task.taskType)
             {
                 MainTaskManager.Instance.ExecuteTask(0, false);
             }
         }
         MainTaskManager.Instance.DelayExecuteTaskId = 0;
         TimerHeap.DelTimer(this.mDelayExecuteId);
         this.mDelayExecuteId = 0u;
     }
 }
Пример #15
0
    private void PlaySpineFX()
    {
        if (this.mType == DungeonManager.InsType.FIELD)
        {
            return;
        }
        int effectId;

        if (this.mIsWin)
        {
            effectId = ((this.mType != DungeonManager.InsType.MAIN) ? 1880 : 1800);
        }
        else
        {
            effectId = ((this.mType != DungeonManager.InsType.MAIN) ? 1890 : 1850);
        }
        FXSpineManager.Instance.PlaySpine(effectId + 1, this.mFXPool.get_transform(), "TaskProgressUI", 2001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        FXSpineManager.Instance.PlaySpine(effectId + 2, this.mFXPool.get_transform(), "TaskProgressUI", 2000, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        this.mDelayId = TimerHeap.AddTimer(2000u, 0, delegate
        {
            if (this.mDelayId > 0u)
            {
                FXSpineManager.Instance.PlaySpine(effectId + 3, this.get_transform(), string.Empty, 2001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
                Object.Destroy(this.mFXPool);
                TimerHeap.DelTimer(this.mDelayId);
                this.mDelayId = 0u;
            }
        });
    }
Пример #16
0
    public void HandleCameraEffect(int id)
    {
        CameraAnimation cameraAnimation = DataReader <CameraAnimation> .Get(id);

        if (cameraAnimation == null)
        {
            return;
        }
        switch (cameraAnimation.aniType)
        {
        case 1:
            this.StartCameraAnimation(cameraAnimation);
            break;

        case 3:
            if (cameraAnimation != null && cameraAnimation.shader != null && cameraAnimation.shader.get_Count() > 0)
            {
                for (int i = 0; i < cameraAnimation.shader.get_Count(); i++)
                {
                    int cameraShader = cameraAnimation.shader.get_Item(i);
                    EventDispatcher.Broadcast <int, bool>(ShaderEffectEvent.CAMERA_ANIMATION_EFFECT, cameraShader, true);
                    if (ShakeCamera.cameraShaderTimerList.ContainsKey(cameraAnimation.shader.get_Item(i)))
                    {
                        TimerHeap.DelTimer(ShakeCamera.cameraShaderTimerList[cameraShader]);
                    }
                    uint value = TimerHeap.AddTimer((uint)cameraAnimation.time, 0, delegate
                    {
                        EventDispatcher.Broadcast <int, bool>(ShaderEffectEvent.CAMERA_ANIMATION_EFFECT, cameraShader, false);
                    });
                    ShakeCamera.cameraShaderTimerList[cameraShader] = value;
                }
            }
            break;
        }
    }
Пример #17
0
    private void HandleDissonFx(FXData fx)
    {
        orgShader = GetMatShader();
        AssetCacheMgr.GetResource(fx.dissonShader, (shader) =>
        {
            SetMatShader(shader as Shader);
            currentShaderFx = fx.id;
            AssetCacheMgr.GetResource(fx.nosieTexture, (nosieTexture) =>
            {
                SetMatTexture("_NosieTex", nosieTexture as Texture);
                float nosieOffset = fx.nosieOffetFrom;
                SetMatFloat("_NosieOffset", nosieOffset);

                TimerHeap.AddTimer((uint)fx.dissonDelay, 0, () =>
                {
                    //Debug.Log("begin HandleDissonFx");
                    var duration  = fx.dissonDuration;
                    var loopTimer = TimerHeap.AddTimer(0, 100, () =>
                    {
                        SetMatFloat("_NosieOffset", nosieOffset);
                        nosieOffset = nosieOffset + (fx.nosieOffetTo - fx.nosieOffetFrom) * 100 / duration;
                        //Debug.Log("nosieOffset: " + nosieOffset);
                    });
                    TimerHeap.AddTimer((uint)duration, 0, () =>
                    {
                        //Debug.Log("DelTimer HandleDissonFx");
                        TimerHeap.DelTimer(loopTimer);
                    });
                });
            });
        });
        //Debug.Log("HandleDissonFx: " + fx.actionID);
    }
Пример #18
0
    public override void Enter(params System.Object[] args)
    {
        Debuger.Log("进入休闲状态");

        if (theOwner is EntityPlayer && GameWorld.inCity)
        {
            theOwner.SetAction(ActionConstants.CITY_IDLE);
        }
        else
        {
            theOwner.SetAction(ActionConstants.COPY_IDLE);
        }
        if (theOwner is EntityMonster)
        {
            if (tempTime > 0)
            {
                TimerHeap.DelTimer(tempTime);
            }
            tempTime = TimerHeap.AddTimer <EntityParent>((uint)1500, 0, (e) =>
            {
                if (e == null || e.Motor == null)
                {
                    return;
                }
                e.ChangeState(FSMStateType.Attacking);
            }, theOwner);
        }
    }
Пример #19
0
        public void FindServerUdp()
        {
            m_isStop = false;
            CreateFindUdp();
            if (serverFindSend == null)
            {
                //定义网络类型,数据连接类型和网络协议UDP
                serverFindSend = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            }

            List <string> ipList = GetAllLocalIp();

            LoggerHelper.Debug("===ipList===count:" + ipList.Count);
            for (int i = 0; i < ipList.Count; i++)
            {
                IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(ipList[i]), 13245);

                IPHostEntry ieh  = Dns.GetHostByName(Dns.GetHostName());
                string      myip = ieh.AddressList[0].ToString();
                SendMsg(myip, ipep);
                LoggerHelper.Debug("===SendMsg===ip:" + ipList[i] + ", msg:" + myip);
            }
            TimerHeap.DelTimer(timeOutTimer);
            timeOutTimer = TimerHeap.AddTimer(20000, 0, TimeOutHandle);
        }
Пример #20
0
 public void OnRedPacketNty(short state, RedPacketNty down = null)
 {
     if (this.delayId != 0u)
     {
         TimerHeap.DelTimer(this.delayId);
     }
     this.isCantnotGetInfo = false;
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         if (this.InfoData != null)
         {
             this.InfoData.redPackets.Add(down.redPackets);
         }
         else
         {
             this.InfoData = new OwnerRedPacketsNty();
             this.InfoData.redPackets.Add(down.redPackets);
         }
     }
     EventDispatcher.Broadcast(EventNames.RedBagFresh);
 }
Пример #21
0
 public override void StopNav()
 {
     m_cornersIdx     = 1;
     isMovingToTarget = false;
     m_isMovingOn     = false;
     TimerHeap.DelTimer(m_timerIdForNav);
 }
Пример #22
0
    void OnDialogUIDownSignUp()
    {
        Debug.Log("DialogUIDownSignUp Logic");

        TimerHeap.DelTimer(talkingTimer);
        ++m_iDialogIndex;

        if (m_iDialogIndex > m_iDialogTextMaxIndex && MogoWorld.thePlayer != null)
        {
            if (MogoWorld.thePlayer.sceneId == MogoWorld.globalSetting.homeScene)
            {
                MogoUIManager.Instance.ShowMogoNormalMainUI();
            }
            else
            {
                MogoUIManager.Instance.ShowMogoBattleMainUI();
            }
            if (GuideSystem.Instance.IsGuideDialog)
            {
                GuideSystem.Instance.IsGuideDialog = false;
                EventDispatcher.TriggerEvent <SignalEvents>(Events.CommandEvent.CommandEnd, SignalEvents.FinishDialog);
            }
        }
        else
        {
            SetDialogUINPCName(m_arrDialogName[m_iDialogIndex]);
            SetDialogUINPCImage(m_arrDialogImg[m_iDialogIndex]);
            SetDialogUINPCDialogText(m_arrDialogText[m_iDialogIndex]);

            // Auto
            talkingTimer = TimerHeap.AddTimer(3000, 0, OnDialogUIDownSignUp);
        }
    }
Пример #23
0
 protected override void OnDisable()
 {
     base.OnDisable();
     PetManager.Instance.IsLuckDrawing = false;
     using (List <int> .Enumerator enumerator = this.FxIdList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             int current = enumerator.get_Current();
             FXSpineManager.Instance.DeleteSpine(current, true);
         }
     }
     int[] fxIds = this.FxIds;
     for (int i = 0; i < fxIds.Length; i++)
     {
         int uid = fxIds[i];
         FXSpineManager.Instance.DeleteSpine(uid, true);
     }
     EventDispatcher.RemoveListener("TimeManagerEvent.UnscaleSecondPast", new Callback(this.OnSecondsPast));
     EventDispatcher.Broadcast <bool, RTManager.RtType>("RTManager.ENABLE_PROJECTION_TYPE", false, RTManager.RtType.ActorModel1);
     if (this.timerID != 0u)
     {
         TimerHeap.DelTimer(this.timerID);
     }
     LuckDrawManager.Instance.CheckTipsInTownUI();
 }
Пример #24
0
 public void OnDestroy()
 {
     this.RemoveListners();
     TimerHeap.DelTimer(this.timerID);
     this.owner      = null;
     this.ownerActor = null;
 }
Пример #25
0
 private void HideBubbleDialog(Transform targetTransform, long id)
 {
     if (targetTransform == null)
     {
         return;
     }
     if (this.MonsterDialogQueue.ContainsKey(targetTransform))
     {
         BubbleDialogueManager.Instance.RemoveBubbleDialogue(id, targetTransform);
         List <int> list = this.MonsterDialogQueue.get_Item(targetTransform);
         if (list.get_Count() > 0)
         {
             list.RemoveAt(0);
         }
         if (this.MonsterTimerQueue.ContainsKey(targetTransform))
         {
             TimerHeap.DelTimer(this.MonsterTimerQueue.get_Item(targetTransform));
             this.MonsterTimerQueue.Remove(targetTransform);
         }
         if (list.get_Count() > 0)
         {
             this.ShowBubbleDialog(targetTransform, id);
         }
     }
 }
Пример #26
0
 public override void Active()
 {
     if (base.IsActive)
     {
         return;
     }
     if (DataReader <Monster> .Get(this.owner.TypeID).mode == 1)
     {
         return;
     }
     TimerHeap.DelTimer(this.timerID);
     this.GetAIDataByType();
     base.AIRoot = BTLoader.GetBehaviorTree(this.AIType);
     if (base.AIRoot == null)
     {
         return;
     }
     base.IsActive   = true;
     base.IsThinking = InstanceManager.IsAIThinking;
     this.owner.GetConditionManager().RegistThinkCondition(base.GetAIConditionMessage(base.AIRoot));
     if (base.IsFirstActive)
     {
         base.IsFirstActive = false;
         this.timerID       = TimerHeap.AddTimer((uint)DataReader <Monster> .Get(this.owner.TypeID).aiDelay, this.ThinkInterval, new Action(this.Think));
     }
     else
     {
         this.timerID = TimerHeap.AddTimer(0u, this.ThinkInterval, new Action(this.Think));
     }
 }
Пример #27
0
 public void ResetData()
 {
     this.isWinEnd               = false;
     this.finishTime             = 0;
     this.selfLowestHPPercentage = 1f;
     this.selfPetNum             = 0;
     this.selfSkillIcon.Clear();
     this.selfSkillBound.Clear();
     this.selfSkillCD.Clear();
     this.selfCombo    = 0;
     this.selfMaxCombo = 0;
     this.selfHit      = 0;
     TimerHeap.DelTimer(this.comboTimer);
     this.selfFuse      = false;
     this.selfDeadCount = 0;
     this.playerDatas.Clear();
     this.petCD.Clear();
     this.petLowestHPPercentage = 1f;
     this.isAllPetAlive         = true;
     this.allAttendPet.Clear();
     this.allFusePet.Clear();
     this.isAnyNPCDead       = false;
     this.isAllNPCDead       = false;
     this.isAllNPCArrived    = false;
     this.isKillCountDownEnd = false;
     this.deadMonserCount.Clear();
     this.hasSetBoss   = false;
     this.bossHpLmt    = 0L;
     this.bossHp       = 0L;
     this.bossDead     = false;
     this.bossDeadTime = DateTime.get_Now();
     this.bossBornTime = DateTime.get_Now();
 }
Пример #28
0
    virtual public void ClearSkill(bool isRemove = false)
    {
        TimerHeap.DelTimer(delayAttackTimerID);
        TimerHeap.DelTimer(hitTimerID);

        if (currSpellID != -1)
        {
            if (SkillAction.dataMap.ContainsKey(currHitAction) && isRemove)
            {
                RemoveSfx(currHitAction);
            }
            SkillData s;
            if (SkillData.dataMap.TryGetValue(currSpellID, out s) && isRemove)
            {
                foreach (var i in s.skillAction)
                {
                    RemoveSfx(i);
                }
            }
            currHitAction = -1;
        }
        for (int i = 0; i < hitTimer.Count; i++)
        {
            TimerHeap.DelTimer(hitTimer[i]);
        }
        ChangeState(FSMStateType.Idle);
        hitTimer.Clear();
        currSpellID = -1;
    }
Пример #29
0
    private void HitActionRule(EntityParent theOwner, int act, int hitActionID)
    {
        int    action  = act;
        string actName = theOwner.CurrActStateName();

        if (actName.EndsWith(PlayerActionNames.names[ActionConstants.KNOCK_DOWN]))
        {//击飞状态,受非浮空打击,一直倒地
            action = ActionConstants.KNOCK_DOWN;
            return;
        }
        if (actName.EndsWith(PlayerActionNames.names[ActionConstants.HIT_AIR]))
        {//浮空受击
            action = ActionConstants.HIT_AIR;
        }
        else if (actName.EndsWith(PlayerActionNames.names[ActionConstants.HIT_GROUND]) || actName.EndsWith("knockout"))
        {
            action = ActionConstants.HIT_GROUND;
        }
        else if ((theOwner is EntityMyself) && (action == ActionConstants.HIT_AIR || action == ActionConstants.KNOCK_DOWN))
        {
            int random = Mogo.Util.RandomHelper.GetRandomInt(0, 100);
            if (random <= 70)
            {//主角受到倒地状态影响时,只有30%机会成功,否则变成普通受击 By.铭
                action = ActionConstants.HIT;
            }
        }

        theOwner.SetAction(action);

        // 回调函数, 切换到 idle
        if (changeIdleTime > 0)
        {
            TimerHeap.DelTimer(changeIdleTime);
        }
        changeIdleTime = TimerHeap.AddTimer <EntityParent, int>(100, 0,
                                                                (_theOwner, _hitAct) =>
        {
            if (_theOwner == null)
            {
                return;
            }
            if (_theOwner.Motor != null)
            {
                _theOwner.Motor.CancleLookAtTarget();
            }
            //_theOwner.TriggerUniqEvent<int>(Events.FSMMotionEvent.OnHitAnimEnd, _hitAct);
            if (_theOwner is EntityMyself)
            {
                _theOwner.SetSpeed(0);
                _theOwner.Motor.SetSpeed(0);
            }
            if (_theOwner is EntityMonster)
            {
                _theOwner.ChangeState(FSMStateType.Attacking);
            }
        },
                                                                theOwner, hitActionID
                                                                );
    }
Пример #30
0
    public void JewelCombineResp(byte subType, byte level, byte errorId)
    {
        m_isComposing = false;
        TimerHeap.DelTimer(m_timerId);
        int type = (int)subType;

        //int level = m_currentJewel.level;
        Debug.Log("JewelCombineResp:" + errorId);
        switch (errorId)
        {
        case 0:
            MogoGlobleUIManager.Instance.ShowComposeSucessSign(true);
            if (ComposeUIViewManager.Instance != null && InventoryManager.Instance.CurrentView == InventoryManager.View.ComposeView)
            {
                ComposeUIViewManager.Instance.PlayUIFXAnim();
            }
            if (MogoUIManager.Instance.CurrentUI == MogoUIManager.Instance.m_ComposeUI)
            {
                RefreshUI();
            }
            break;

        case 4:
            Debug.Log("JewelCombineResp:" + errorId);
            //string msg = LanguageData.dataMap[425].Format(ItemJewelData.JewelDic[type][level - 1].Name);
            //MogoMsgBox.Instance.ShowMsgBox(msg);
            //在背包点合成时候转到合成界面,合成界面无法点合成所以不会有这个返回

            SwitchToCompose(subType, level - 2);
            //InventoryManager.Instance.CurrentView = InventoryManager.View.ComposeView;

            //InventoryManager.Instance.m_currentEquipmentView = InventoryManager.View.ComposeView;
            //EquipTipManager.Instance.CloseEquipTip();
            //m_currentJewel = ItemJewelData.JewelDic[subType][level];
            //m_currentParentId = subType;
            //m_currentChildId = level - 2;
            //m_isSwitchFromBag = true;
            //MogoUIManager.Instance.SwitchComposeUI();//() => { OnSwitchComposeUIDone(subType, level); }

            break;

        default:
            Debug.Log("JewelCombineResp:" + errorId);
            Debug.Log("JewelCombineResp:" + type + "," + level);
            if (ItemJewelData.GetJewelDic()[type][level] == null)
            {
                Debug.Log("f**k!");
            }

            else
            {
                InsetManager.ShowInfoByErrorId(errorId, ItemJewelData.GetJewelDic()[type][level]);
            }
            break;
        }

        Debug.Log("JewelCombineResp:" + errorId);
        EquipTipManager.Instance.CloseEquipTip();
    }