private void ModifyTrail(XWeaponTrail trail, int length) { if (Configuration.Trail.TrailEnabled) { trail.enabled = true; trail.SetField("_maxFrame", length); trail.SetField("_granularity", length * 3); } else { trail.enabled = false; } }
private void RescaleWeaponTrail(XWeaponTrail trail, float lengthMultiplier, bool usingCustomModels) { float trailWidth = trail.GetField <float, XWeaponTrail>("_trailWidth"); trail.SetField("_trailWidth", trailWidth * lengthMultiplier); // Fix the local z position for the default trail on custom sabers if (usingCustomModels) { Transform pointEnd = trail.GetField <Transform, XWeaponTrail>("_pointEnd"); pointEnd.localPosition = Vector3Extensions.Rescale(pointEnd.localPosition, 1.0f, 1.0f, pointEnd.localPosition.z * lengthMultiplier); } }