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
    /// <summary>
    /// 属性更新后处理
    /// </summary>
    /// <param name="nPropID"></param>
    /// <param name="nNewValue"></param>
    /// <param name="nOldValue"></param>
    private void OnAfterUpdateNumProp(int nPropID, int nNewValue, int nOldValue, int nOtherValue)
    {
        switch (nPropID)
        {
        case (int)ENTITY_PROPERTY.PROPERTY_SKIN:
        {
            if (nNewValue != nOldValue)
            {
                if (Master.SkinControl.ChangeSkin(nNewValue, nOtherValue, Master.IsHero? AssetLoadPriority.Priority_Exclusive : AssetLoadPriority.Priority_Normal) == U3D_Render.SkinCtrl.SkinChangedReslut.Succes)
                //if (Master.SkinControl.ChangeSkin(nNewValue, nOtherValue) == U3D_Render.SkinCtrl.SkinChangedReslut.Succes)
                {
#if ENABLE_YUNYING_MODE
                    if (nOldValue > 0)
                    {
                        EffectHelper.UnloadPreLight(ASpeedGame.Data.Scheme.LightType.ActorSkin, nOldValue);
                    }

                    EffectHelper.LoadPreLight(ASpeedGame.Data.Scheme.LightType.ActorSkin, nNewValue, CachePriority.PRIORITY_VERY_HIGH);
#else
                    //主城才需要这个
                    if (GameLogicAPI.isMainMap(SceneManager.Instance.m_curMapID))
                    {
                        // 主角切英雄或皮肤时加载下光效
                        if (Master.IsHero)
                        {
                            if (nOldValue > 0)
                            {
                                EffectHelper.UnloadPreLight(ASpeedGame.Data.Scheme.LightType.ActorSkin, nOldValue);
                            }

                            EffectHelper.LoadPreLight(ASpeedGame.Data.Scheme.LightType.ActorSkin, nNewValue, CachePriority.PRIORITY_VERY_HIGH);
                        }
                    }
#endif
                }
            }
        }
        break;

        case (int)ENTITY_PROPERTY.PROPERTY_SD:
        {
            BaseStateMachine fsm = Master.StateMachine;
            if (fsm)
            {
                fsm.maxRunForwardSpeed  = nNewValue / 100.0f;
                fsm.maxRunSidewaySpeed  = nNewValue / 100.0f * GameLogicAPI.getHeroSidewaySpeedFactor();
                fsm.maxRunBackwardSpeed = fsm.maxRunForwardSpeed * GameLogicAPI.getHeroBackwardSpeedFactor();
                fsm.updateMovingAnimSpeed();
            }
        }
        break;

        case (int)ENTITY_PROPERTY.PROPERTY_MASK:
        {
            BaseStateMachine fsm = Master.StateMachine;
            if (fsm)
            {
                fsm.ChangeMask(Master);
            }
        }
        break;

        case (int)ENTITY_PROPERTY.PROPERTY_VOCATION:
        {
            if (EntityFactory.MainHeroView != null && EntityFactory.MainHeroView.Property == this)
            {
                foreach (SSchemePersonModelData data in PersonModelConfig.Instance.PersonModelConfigs)
                {
                    if (data.nHeroID == nNewValue)
                    {
                        OperationType fpsMode = new OperationType();
                        fpsMode.operationType = data.nOperationType;
                        UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_UPDATE_MAIN_HERO_VOCATION, fpsMode);
                        break;
                    }
                }
            }
        }
        break;

        case (int)ENTITY_PROPERTY.PROPERTY_OBSERVER:
        {
            if (EntityFactory.MainHeroView != null && EntityFactory.MainHeroView.Property == this)
            {
                if (nNewValue > 0)
                {
                    StageManager.Instance.CurPermissionState = EStage_PermissionState.ESPS_OB;
                }
                else
                {
                    StageManager.Instance.CurPermissionState = EStage_PermissionState.ESPS_NORMAL;
                }
            }
        }
        break;

        default:
            break;
        }
    }