Exemplo n.º 1
0
 public void OnHandleMessage(string methodName, object value)
 {
     if (_ilrObject != null)
     {
         _ilrObject.OnHandleMessage(methodName, value);
     }
 }
Exemplo n.º 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);
        }
    }