Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
hi 8bdefaf Dec 30, 2019
1 contributor

Users who have contributed to this file

32 lines (29 sloc) 1.09 KB
using NUnit.Framework;
using Unity.Entities;
namespace E7.EcsTesting
{
/// <summary>
/// Base class to begin writing a world-based test. It pours all systems available in to the world, plus
/// one more system which allows you to <see cref="EcsTestBase.ForceDeltaTime"/> to change delta time of the next update.
///
/// You then create some entities and run `w.Update()` in sequences and check results.
/// </summary>
public abstract class WorldTestBase : EcsTestBase
{
[SetUp]
public void SetUp()
{
SetUpBase();
SetUpWorld();
}
[TearDown]
public void TearDown() => TearDownBase();
private void SetUpWorld()
{
var allSystems =
DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default, requireExecuteAlways: false);
allSystems.Add(typeof(ConstantDeltaTimeSystem)); //Need to be added with UpdateWorldTimeSystem at the same time.
DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(w, allSystems);
}
}
}
You can’t perform that action at this time.