diff --git a/Assets/Scripts/Abilities/Stealth.cs b/Assets/Scripts/Abilities/Stealth.cs index fa5220dd9..edef9045d 100644 --- a/Assets/Scripts/Abilities/Stealth.cs +++ b/Assets/Scripts/Abilities/Stealth.cs @@ -64,7 +64,7 @@ protected override void Execute() isActive = true; // set to active isOnCD = true; // set to on cooldown ToggleIndicator(true); - + SpriteRenderer[] renderers = craft.GetComponentsInChildren(true); for (int i = 0; i < renderers.Length; i++) { diff --git a/Assets/Scripts/Game Object Definitions/ShellPart.cs b/Assets/Scripts/Game Object Definitions/ShellPart.cs index 6ec562142..d4987ec5b 100644 --- a/Assets/Scripts/Game Object Definitions/ShellPart.cs +++ b/Assets/Scripts/Game Object Definitions/ShellPart.cs @@ -275,7 +275,8 @@ private IEnumerator InitColorLerp(float lerpVal) lerpVal += 0.05F; lerpVal = Mathf.Min(lerpVal, 1); var lerpedColor = Color.Lerp(Color.gray, info.shiny ? ShinyFactionColors.colors[faction] : FactionColors.colors[faction], lerpVal); - + lerpedColor.a = (craft.invisible ? (craft.faction == 0 ? 0.2f: 0f) : 1f); + spriteRenderer.color = lerpedColor; if(shooter) shooter.GetComponent().color = lerpedColor; @@ -298,8 +299,10 @@ public void TakeDamage(float damage) { if(partHealth != 0 && colorLerped) { - spriteRenderer.color = Color.Lerp(Color.gray, info.shiny ? ShinyFactionColors.colors[faction] : + var color = Color.Lerp(Color.gray, info.shiny ? ShinyFactionColors.colors[faction] : FactionColors.colors[faction], currentHealth / partHealth); + color.a = (craft.invisible ? (craft.faction == 0 ? 0.2f: 0f) : 1f); + spriteRenderer.color = color; if(shooter) shooter.GetComponent().color = spriteRenderer.color; } }