MultiplayerHUDManager.cs: fix text fade maybe

This commit is contained in:
JohnCorby 2023-05-11 17:10:35 -07:00
parent 6c68bd97e0
commit c763c24bd5

View File

@ -193,11 +193,11 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
if (_writingMessage)
{
_lastMessageTime = Time.time;
}
}
if (Time.time > _lastMessageTime + FADE_DELAY
&& !_writingMessage
&& Time.time > _lastMessageTime + FADE_DELAY + FADE_TIME + 1)
if (!_writingMessage
&& Time.time > _lastMessageTime + FADE_DELAY
&& Time.time < _lastMessageTime + FADE_DELAY + FADE_TIME + 1)
{
var difference = Time.time - (_lastMessageTime + FADE_DELAY);
var alpha = Mathf.Lerp(1, 0, difference / FADE_TIME);