Пример #1
0
    public virtual void ApplyPlayDataToResHandler()
    {
        if (LightingEffectResHandleInstance.isNullOrEmpry(ResourceHandle))
        {
            return;
        }

        ResHandleInstance.ApplyPlayData(ResHandlePlayData);
    }
Пример #2
0
 public void InvActiveCacheRendering(Vector3 pos)
 {
     if (!isValid)
     {
         return;
     }
     foreach (LightingEffectResHandleInstance instance in AllInstanceNode)
     {
         if (!LightingEffectResHandleInstance.isNullOrEmpry(instance))
         {
             instance.InvActiveCacheRendering(pos);
         }
     }
 }
Пример #3
0
    private void ApplyResHandle()
    {
        if (!bStartEffect)
        {
            return;
        }

        if (LightingEffectResHandleInstance.isNullOrEmpry(ResHandleInstance))
        {
            needClose = true;
            return;
        }

        if (!ResHandleInstance.CameraAnimation)
        {
            needClose = true;
            return;
        }
        if (cameraConfig.attackType == EffectAttackType.Source)
        {
            if (EffectParam.nSrcEntityID != EntityFactory.MainHeroID)
            {
                needClose = true;
                return;
            }
        }
        else if (cameraConfig.attackType == EffectAttackType.Target)
        {
            if (EffectParam.nTargetEntityID != EntityFactory.MainHeroID)
            {
                needClose = true;
                return;
            }
        }
        else if (cameraConfig.attackType == EffectAttackType.SourceAndTarget)
        {
            if (EffectParam.nSrcEntityID != EntityFactory.MainHeroID && EffectParam.nTargetEntityID != EntityFactory.MainHeroID)
            {
                needClose = true;
                return;
            }
        }

        uint tick = GameLogicAPI.getTickCount();

        m_camera = SoldierCamera.MainInstance <SoldierCamera>();
        if (!m_camera)
        {
            needClose = true;
            return;
        }

        if (ResHandleInstance.CameraAnimation.animationClip)
        {
            Transform sourceTransform = null;
            if (EffectParam.srcObject)
            {
                sourceTransform = EffectParam.srcObject.transform;
            }
            CamAnimStateParam param = new CamAnimStateParam(ResHandleInstance.CameraAnimation.animationClip, cameraConfig.animationOrgPos, cameraConfig.animationOrgProjectFloor, EffectParam.targetPos, sourceTransform, cameraConfig.animationMainCamera);
            m_camera.EnableMode(CameraMode.CameraAnim, true, param);

            return;
        }

        m_camera.playEffect(cameraConfig.delayTick, cameraConfig.effectLiveTick, ResHandleInstance.CameraAnimation.cameraAxis, cameraConfig.recoverTransform);
    }