-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEcsTestBase.cs
More file actions
31 lines (27 loc) · 809 Bytes
/
EcsTestBase.cs
File metadata and controls
31 lines (27 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Unity.Entities;
namespace E7.EcsTesting
{
public abstract class EcsTestBase
{
protected World w { get; private set; }
protected EntityManager em { get; private set; }
protected EntityAssertionQuery eaq { get; private set; }
protected void SetUpBase()
{
w = new World("Test World");
em = w.EntityManager;
eaq = new EntityAssertionQuery(w);
}
/// <summary>
/// Call to make the next world update go in a specific time.
/// </summary>
protected void ForceDeltaTime(float deltaTime)
{
w.GetExistingSystem<ConstantDeltaTimeSystem>().ForceDeltaTime(deltaTime);
}
protected void TearDownBase()
{
w.Dispose();
}
}
}