//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; } } }
/// <summary> /// Deletes All trees subelements. /// Releases all the corresponding texture tiles. /// </summary> /// <param name="owner">Owner of quad.</param> public void RecursiveDeleteChildren(TileSampler owner) { if (!IsLeaf) { for (byte i = 0; i < 4; i++) { Children[i].RecursiveDelete(owner); Children[i] = null; } } }
// 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 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; } } }
/// <summary> /// Deletes this tree and all its subelements. /// Releases all the corresponding texture tiles. /// </summary> /// <param name="owner"></param> public void RecursiveDelete(TileSampler owner) { if (Tile != null && owner != null) { owner.Producer.PutTile(Tile); Tile = null; } if (!IsLeaf) { for (byte i = 0; i < 4; i++) { Children[i].RecursiveDelete(owner); Children[i] = null; } } }