Exemplo n.º 1
0
    // Token: 0x06002012 RID: 8210 RVA: 0x000998D0 File Offset: 0x00097AD0
    private void EmitWaterImpactParticles(Ray ray, float radius)
    {
        Vector3 origin = ray.origin;
        Vector3 vector = origin + ray.direction * radius;

        if (GameState.Current.Map != null && GameState.Current.Map.HasWaterPlane && ((origin.y > GameState.Current.Map.WaterPlaneHeight && vector.y < GameState.Current.Map.WaterPlaneHeight) || (origin.y < GameState.Current.Map.WaterPlaneHeight && vector.y > GameState.Current.Map.WaterPlaneHeight)))
        {
            Vector3 hitPoint = vector;
            hitPoint.y = GameState.Current.Map.WaterPlaneHeight;
            if (!Mathf.Approximately(ray.direction.y, 0f))
            {
                hitPoint.x = (GameState.Current.Map.WaterPlaneHeight - vector.y) / ray.direction.y * ray.direction.x + vector.x;
                hitPoint.z = (GameState.Current.Map.WaterPlaneHeight - vector.y) / ray.direction.y * ray.direction.z + vector.z;
            }
            MoveTrailrendererObject trailRenderer = this.Decorator.TrailRenderer;
            ParticleEffectController.ShowHitEffect(ParticleConfigurationType.MeleeDefault, SurfaceEffectType.WaterEffect, Vector3.up, hitPoint, Vector3.up, origin, 1f, ref trailRenderer, this.Decorator.transform);
        }
    }
Exemplo n.º 2
0
    // Token: 0x06001E33 RID: 7731 RVA: 0x000949EC File Offset: 0x00092BEC
    protected void EmitImpactParticles(RaycastHit hit, Vector3 direction, Vector3 muzzlePosition, float distance, bool playSound)
    {
        string            tag       = TagUtil.GetTag(hit.collider);
        Vector3           point     = hit.point;
        Vector3           hitNormal = hit.normal;
        SurfaceEffectType surface   = SurfaceEffectType.Default;

        if (this._effectMap.TryGetValue(tag, out surface))
        {
            if (GameState.Current.Map != null && GameState.Current.Map.HasWaterPlane && ((this._muzzlePosition.position.y > GameState.Current.Map.WaterPlaneHeight && point.y < GameState.Current.Map.WaterPlaneHeight) || (this._muzzlePosition.position.y < GameState.Current.Map.WaterPlaneHeight && point.y > GameState.Current.Map.WaterPlaneHeight)))
            {
                surface   = SurfaceEffectType.WaterEffect;
                hitNormal = Vector3.up;
                point.y   = GameState.Current.Map.WaterPlaneHeight;
                if (!Mathf.Approximately(direction.y, 0f))
                {
                    point.x = (GameState.Current.Map.WaterPlaneHeight - hit.point.y) / direction.y * direction.x + hit.point.x;
                    point.z = (GameState.Current.Map.WaterPlaneHeight - hit.point.y) / direction.y * direction.z + hit.point.z;
                }
            }
            ParticleEffectController.ShowHitEffect(this._effectType, surface, direction, point, hitNormal, muzzlePosition, distance, ref this._trailRenderer, this._parent);
        }
    }
Exemplo n.º 3
0
 // Token: 0x06000892 RID: 2194 RVA: 0x00037730 File Offset: 0x00035930
 public static void ShowHitEffect(ParticleConfigurationType effectType, SurfaceEffectType surface, Vector3 direction, Vector3 hitPoint, Vector3 hitNormal, Vector3 muzzlePosition, float distance, ref MoveTrailrendererObject trailRenderer, Transform parent)
 {
     ParticleEffectController.ShowHitEffect(effectType, surface, direction, hitPoint, hitNormal, muzzlePosition, distance, ref trailRenderer, parent, 0);
 }