Created
May 15, 2015 20:14
-
-
Save JonRurka/d39980c36c4f5b11069b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void SpawnChunk(Vector3Int location) | |
{ | |
if (!pageController.BuilderExists(location.x, location.y, location.z)) | |
{ | |
SmoothChunk chunkInstance = new SmoothChunk(); | |
ScriptComponent scriptComp = new ScriptComponent(); | |
Entity chunkObj = new Entity(); | |
//chunkObj.Transform.Parent = Entity.Transform; | |
SceneSystem.SceneInstance.Scene.AddChild<Entity>(chunkObj); | |
chunkObj.Name = string.Format("Chunk_{0}.{1}.{2}", location.x, location.y, location.z); | |
chunkObj.Add<ScriptComponent>(ScriptComponent.Key, scriptComp); | |
scriptComp.Scripts.Add(chunkInstance); | |
chunkInstance.Init(new Vector3Int(location.x, location.y, location.z), pageController); | |
pageController.Add(location, chunkInstance); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment