Created
April 10, 2020 07:26
-
-
Save sarkahn/69cd5d8c7f6046eccb21745c3db48582 to your computer and use it in GitHub Desktop.
FixedRateUtils Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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