public void Initialize() { var player = contexts.game.CreateEntity(); player.isPlayer = true; player.AddPosition(Vector2.zero); Game.chunks = new WorldProvider(0); eventThreads = new ChunkEventThread[2]; for (int i = 0; i < eventThreads.Length; i++) { eventThreads[i] = new ChunkEventThread(); } }
public RenderViewSystem(Contexts contexts) { this.contexts = contexts; world = new WorldProvider(1); renderProvider = new RenderChunkProvider(world, View.setup.viewSize); var r = new Rect(0, 0, 1, 1); cube = Geometry.CreateCube2(new Rect[] { r, r, r, r, r, r }); planes = new Plane[6]; var blockCount = (int)Enum.GetValues(typeof(BlockType)).Cast <BlockType>().Max() + 1; Model.Create(); material2 = MaterialProvider.material; viewThread = new ChunkEventThread(); View.setup.StartCoroutine(UpdateQueue()); }