// Use this for initialization public override void Start() { base.Start(); InitCache(); //Get any layers attached to same game object. May have 0 to many attached. m_layers = GetComponents <TileLayer>(); //Get the samplers attached to game object. Must have one sampler attahed. m_sampler = GetComponent <TileSampler>(); }
//Deletes All trees subelements. Releases //all the corresponding texture tiles. public void RecursiveDeleteChildren(TileSampler owner) { if (children[0] != null) { for (int i = 0; i < 4; i++) { children[i].RecursiveDelete(owner); children[i] = null; } } }
//Deletes this Tree and all its subelements. Releases //all the corresponding texture tiles. public void RecursiveDelete(TileSampler owner) { if (tile != null && owner != null) { owner.GetProducer().PutTile(tile); tile = null; } if (children[0] != null) { for (int i = 0; i < 4; i++) { children[i].RecursiveDelete(owner); children[i] = null; } } }