Exemplo n.º 1
0
        public void Unload()
        {
            _chunkController = null;

            Object.Destroy(gameObject);
            gameObject = null;
        }
Exemplo n.º 2
0
        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
                );
        }