Пример #1
0
 public void Update(float time)
 {
     if (Application.isPlaying)
     {
         if (!_played)
         {
             if (time >= _startTime)
             {
                 MoveCameraShakeHelper.Shake(_event);
                 _played = true;
             }
         }
     }
     else
     {
         if (!_played)
         {
             if (time >= _startTime)
             {
                 MoveCameraShakeHelper.Shake(_event);
                 _played = true;
             }
         }
     }
 }
Пример #2
0
    private void PlayEffects(ProjectileEvent projectileEvent)
    {
        if (_fxHelper == null)
        {
            return;
        }

        for (int j = 0; j < projectileEvent._particles.Count; ++j)
        {
            MoveEditor.ParticleEventInfo particleEventInfo = projectileEvent._particles[j];

            // Dirty hack here - if the particle's set to spawn at hit point, we call the player's FXHelper
            // the reason being that if we don't then the effects will get destroyed since the projectile would likely be deactivated on hit, thus destroying all its fx
            if (particleEventInfo._particleProperties._spawnAtHitPoint)
            {
                MoveEditor.MoveAnimationEvent moveEvent = new MoveEditor.MoveAnimationEvent()
                {
                    EventRef = particleEventInfo
                };
                _owner.OnHandleMessage("OnPlayParticle", moveEvent);
                //_owner.FXHelper.PlayParticle(particleEventInfo._particleProperties);
            }
            else
            {
                _fxHelper.PlayParticle(particleEventInfo._particleProperties);
            }
        }

        for (int j = 0; j < projectileEvent._trails.Count; ++j)
        {
            MoveEditor.TrailRendererEventInfo trailEventInfo = projectileEvent._trails[j];
            _fxHelper.PlayTrailRenderer(trailEventInfo._trailRendererProperties);
        }

        for (int j = 0; j < projectileEvent._dynamicLights.Count; ++j)
        {
            MoveEditor.DynamicLightEventInfo dynamicLights = projectileEvent._dynamicLights[j];
            _fxHelper.PlayDynamicLight(dynamicLights._dynamicLightProperties);
        }

        AttributeData attr = _owner.OnGetAttributeData("IsCurrentAttackCritical");

        for (int i = 0; i < projectileEvent._cameraShakes.Count; ++i)
        {
            MoveEditor.CameraShakeEventInfo shakeInfo = projectileEvent._cameraShakes[i];
            MoveCameraShakeHelper.Shake(shakeInfo, _owner != null && attr.IsCurrentAttackCritical);
        }
    }
Пример #3
0
        //public void OnPlayCameraShake(MoveEditor.MoveAnimationEvent e)
        //{
        //    //var info = new MoveEditor.CameraShakeEventInfo(e.stringParameter);
        //    var info = e.EventRef as CameraShakeEventInfo;
        //    bool isCrit = false;
        //    if (_player == null)
        //    {
        //        _player = GetComponent<Hotfix_LT.Combat.Combatant>();
        //    }
        //    if (_player != null)
        //    {
        //        isCrit = _player.IsCurrentAttackCritical();
        //    }
        //    MoveCameraShakeHelper.Shake(info, isCrit);
        //}

        public void OnPlayCameraShakeEx(MoveEditor.MoveAnimationEvent e, bool isCrit)
        {
            var info = e.EventRef as CameraShakeEventInfo;

            MoveCameraShakeHelper.Shake(info, isCrit);
        }