public void DestroyChunk() { if (_tileChunkPoolNode != null) { _tileChunkPoolNode.name = ""; DestroyImmediate(_tileChunkPoolNode.gameObject); _tileChunkPoolNode = null; } }
public TileChunkPool InitChunk() { string nodeName = name + "_" + MapIdxSelect; GameObject obj = GameObject.Find(nodeName); if (obj == null) { obj = new GameObject(); } obj.name = nodeName; _tileChunkPoolNode = obj.AddComponent <TileChunkPool>(); return(_tileChunkPoolNode); }