-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestSystem.cs
42 lines (33 loc) · 869 Bytes
/
TestSystem.cs
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
32
33
34
35
36
37
38
39
40
41
42
/* Based on TwoStick examples
*
*/
using Unity.Collections;
using Unity.Entities;
using UnityEngine;
namespace FirstTrial01
{
struct SomeValue : IComponentData
{
public float f ;
}
public class TestSystem : ComponentSystem
{
struct Data
{
public readonly int Length;
[ReadOnly] public ComponentDataArray <SomeValue> a_f ;
}
// [Inject] private Data m_Data;
private Data m_Data ;
protected override void OnUpdate ()
{
Debug.Log ("ini2") ;
var dt = Time.deltaTime;
for (int index = 0; index < m_Data.Length; ++index)
// foreach (var entity in GetEntities<Data> () ) // hybrid
{
var someValue = m_Data.a_f [index].f ;
}
}
}
}