Skip to content

Instantly share code, notes, and snippets.

@sarkahn
Created April 10, 2020 07:26
Show Gist options
  • Save sarkahn/69cd5d8c7f6046eccb21745c3db48582 to your computer and use it in GitHub Desktop.
Save sarkahn/69cd5d8c7f6046eccb21745c3db48582 to your computer and use it in GitHub Desktop.
FixedRateUtils Test
using System.Collections;
using System.Collections.Generic;
using Unity.Entities;
using UnityEngine;
struct FixedRateTestUtilsTest : IComponentData
{ }
class FixedRateSystemGroup : ComponentSystemGroup
{
protected override void OnCreate()
{
base.OnCreate();
// Causes systems to still be updated every frame but does affect the ElapsedTime/DeltaTime that gets reported
// to that system
FixedRateUtils.EnableFixedRateSimple(this, .5f);
// Locks up the editor...
//FixedRateUtils.EnableFixedRateWithCatchUp(this, 3f);
}
}
[UpdateInGroup(typeof(FixedRateSystemGroup))]
class FixedRateSystem : SystemBase
{
protected override void OnUpdate()
{
Debug.Log($"FixedRateUpdate : {Time.ElapsedTime}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment