I have just copied the Rotator.cs from one of the Unity example videos, attached it to a cube but it is not working. Entity Debugger shows RotatorSystem as 'not run'. If I delete the foreach block it runs. Unity 2018.2.6f1 Code (CSharp): using Unity.Entities; using UnityEngine; class Rotator : MonoBehaviour { // The data - editable in the inspector public float Speed; } class RotatorSystem : ComponentSystem { struct Components { // Define what components are required for this // ComponentSystem to handle them. public Transform transform; public Rotator rotator; } override protected void OnUpdate() { // We can immediately see a first optimization. // We know delta time is the same between all rotators, // so we can simply keep it in a local variable // to get better performance. float deltaTime = Time.deltaTime; // ComponentSystem.GetEntities<Group> // lets us efficiently iterate over all GameObjects // that have both a Transform & Rotator component // (as defined above in Group struct). foreach (var e in GetEntities<Components>()) { e.transform.rotation *= Quaternion.AngleAxis(e.rotator.Speed * deltaTime, Vector3.up); } } }
I followed this video. I didn't do anything about bootstrapping. https://unity3d.com/learn/tutorials/topics/scripting/introduction-ecs?playlist=17117 This same example works on my work computer.
I suggest check upon existing samples, if you haven't yet. https://forum.unity.com/threads/new-samples-release-is-out-0-0-10.546722/ Specifically Two Stick example, of Classic OOP, Hybrid and Pure ECS
You need to add a GameObjectEntity component otherwise the components on the game object will not be injected into the entity world to be seen there.