protected void Update() { if (fader != null) { float d = (ship.transform.position - shipStartPosition).magnitude; if (d > shipStartFadeDistance) { float alpha = 1.0f - ((shipMaxDistance - d) / (shipMaxDistance - shipStartFadeDistance)); Color c = new Color(0.25f, 0.0f, 0.0f, alpha); fader.SetColor(c); fader.ShowWarning(alpha > 0.5f); if (d > shipMaxDistance) { Die(); } } } }