Ejemplo n.º 1
0
        /// <summary>
        /// 结束PK
        /// </summary>
        /// <param name="uidTarget">PK目标</param>
        /// <param name="nPKResult">PK结果</param>
        public void EndPK(int uidTarget, int nPKResult, int bForceEnd)
        {
            SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            if (sc != null)
            {
                sc.doingPKSelection  = false;
                sc.enablePKSelection = true;
            }

            PKResult result = new PKResult();

            result.nResult   = nPKResult;
            result.bForceEnd = bForceEnd == 1? true: false;

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PKINFO_ENDPK, result);
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WAR_FLOATFONT_UNLOAD, null);

            UTopNameManager.Instance.SetPKMode(EntityFactory.MainHeroID, false);
            UTopNameManager.Instance.SetPKMode(uidTarget, false);
            UTopNameManager.PkTargetID = -1;

            UBloodManager.Instance.PkTargetID = -1;
            UBloodManager.Instance.DestroyALL();

            EffectHelper.UnloadPreLight(LightType.ActorSkin, pkTargetSkinID);
            UnLoadPKRelateSkin(pkTargetSkinID);
            UnLoadPKRelateSkin(pkSrcSkinID);
            pkSrcSkinID    = 0;
            pkTargetSkinID = 0;

            m_bIsPK = false;
        }
Ejemplo n.º 2
0
        public void EndPK(PKResult result)
        {
            admit.gameObject.SetActive(false);
            elapsedTime.gameObject.SetActive(false);
            elapsedTimeDes.gameObject.SetActive(false);
            distanceDes.gameObject.SetActive(false);
            distance.gameObject.SetActive(false);
            KillTimer((int)EMT_PKinfo_Timer.COUNTDOWN);
            KillTimer((int)EMT_PKinfo_Timer.ELAPSEDTIME);
            curCountDownTime = 0;
            curElapsedTime   = 0;
            if (m_EffectParam != null)
            {
                UEffectManager.Instance.DestroyEffect(UEffectType.UET_EffectPrefab, ref m_EffectParam);
                m_EffectParam = null;
            }
            Data.UISoundConfig.SSchemeUSoundData soundData = new Data.UISoundConfig.SSchemeUSoundData();
            switch (result.nResult)
            {
            case 0:
            {
                if (result.bForceEnd)
                {
                    // 强制结束不让播光效
                    break;
                }
                UEffectParamBase param = new UEffectPrefabParam(_eType: UEffectPrefabType.UEPT_PKInfo_PKLost, _tfAttachParent: this.gameObject.transform, _bAutoDestroy: true);
                UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref param);
                if (Data.UISoundConfig.UISoundConfig.Instance.GetData(SoundFilter, SoundKey_Lost, ref soundData))
                {
                    SoundManager.CreateUISound(soundData.USoundID);
                }
            }
            break;

            case 1:
            {
                UEffectParamBase param2 = new UEffectPrefabParam(_eType: UEffectPrefabType.UEPT_PKInfo_PKWin, _tfAttachParent: this.gameObject.transform, _bAutoDestroy: true);
                UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref param2);
                if (Data.UISoundConfig.UISoundConfig.Instance.GetData(SoundFilter, SoundKey_Win, ref soundData))
                {
                    SoundManager.CreateUISound(soundData.USoundID);
                }
            }
            break;

            case 2:
            {
                UEffectParamBase param3 = new UEffectPrefabParam(_eType: UEffectPrefabType.UEPT_PKInfo_PKTie, _tfAttachParent: this.gameObject.transform, _bAutoDestroy: true);
                UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref param3);
                if (Data.UISoundConfig.UISoundConfig.Instance.GetData(SoundFilter, SoundKey_Tied, ref soundData))
                {
                    SoundManager.CreateUISound(soundData.USoundID);
                }
            }
            break;

            default:
                break;
            }
        }