public static void AfterUpdate(StringBuilder infoBuilder) { if (desyncFrame == 0 && !savedRandomState.Equals(Random.state)) { desyncFrame = Time.frameCount; } if (desyncFrame > 0) { infoBuilder.Append($"desync at frame {desyncFrame}"); } }
public static void OnPreRender(StringBuilder infoBuilder) { Random.State origState = Random.state; Random.state = lastState; int increaseTimes = 0; while (!origState.Equals(Random.state)) { float _ = Random.value; rollTimes++; increaseTimes++; } lastState = Random.state; if (ConfigManager.ShowRng) { infoBuilder.AppendLine($"RNG: {rollTimes} +{increaseTimes}"); } Random.state = origState; }