private void Awake() { instance = this; // allows accessing mesh and material fields -> just for testing; not a good way to manage references EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager; EntityArchetype myArchetype = entityManager.CreateArchetype( typeof(Translation) ); Entity myEentity = entityManager.CreateEntity(myArchetype); }
protected override void OnUpdate() { Entities.ForEach((ref Translation t) => { Graphics.DrawMesh(SSSAnim_GameHandler.GetInstance().quadMesh, // the reference to the mesh t.Value, // the translation value (location of the object) Quaternion.identity, // no rotation SSSAnim_GameHandler.GetInstance().spriteMaterial, 0); // the layer to draw on }); }