Skip to content

Instantly share code, notes, and snippets.

@Densyakun
Last active July 23, 2019 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Densyakun/34324fd89d0500d33d00659c7fcfede7 to your computer and use it in GitHub Desktop.
Save Densyakun/34324fd89d0500d33d00659c7fcfede7 to your computer and use it in GitHub Desktop.
using Unity.Entities;
using Unity.Rendering;
using Unity.Transforms;
public class Main : MonoBehaviour
{
private World _world;
void OnEnable()
{
_world = World.Active = new World("MyWorld");
_world.CreateManager<EntityManager>();
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(_world);
}
void OnDisable()
{
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(null);
_world.Dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment