public void Unload() { _chunkController = null; Object.Destroy(gameObject); gameObject = null; }
public void Generate() { if (gameObject) { return; } gameObject = Object.Instantiate( Resources.Load <GameObject>("Chunks/" + type.ToString() + "_type/" + _variant + "_num") ); _chunkController = gameObject.GetComponent <ChunkController>(); gameObject.transform.position = new Vector3( Position.x * WorldManager.ChunkSize.x, 0, Position.y * WorldManager.ChunkSize.y ); }