From c8f81bd9b04e24dad3b2f81e5430632339b1c9ca Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 7 May 2022 22:57:12 -0400 Subject: [PATCH] shadowElevationScl --- core/src/mindustry/type/UnitType.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index ea8b829625..4dc8ac6ed3 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -112,6 +112,8 @@ public class UnitType extends UnlockableContent{ targetPriority = 0f, /** Elevation of shadow drawn under this (ground) unit. Visual only. */ shadowElevation = -1f, + /** Scale for length of shadow drawn under this unit. Does nothing if this unit has no shadow. */ + shadowElevationScl = 1f, /** backwards engine offset from center of unit */ engineOffset = 5f, /** main engine radius */ @@ -1147,7 +1149,7 @@ public class UnitType extends UnlockableContent{ } public void drawShadow(Unit unit){ - float e = Math.max(unit.elevation, shadowElevation) * (1f - unit.drownTime); + float e = Mathf.clamp(unit.elevation, shadowElevation, 1f) * shadowElevationScl * (1f - unit.drownTime); float x = unit.x + shadowTX * e, y = unit.y + shadowTY * e; Floor floor = world.floorWorld(x, y);