/// <summary> /// Start an invalidation call from this object on the specified channel. /// </summary> /// <param name="sender">Who call this invalidation.</param> /// <param name="channel">Channel to invalidate.</param> /// <param name="direction">Propagation direction.</param> public virtual void Invalidate(GameObject sender, string channel, InvalidationDirection direction) { bool propagate = OnInvalidation(sender, channel, direction); if (direction.HasFlag(InvalidationDirection.Parent) && Parent != null) { Parent.Invalidate(sender, channel, direction); } }
/// <summary> /// Invalidate a property of this object/tree. /// </summary> /// <param name="sender">Object sender.</param> /// <param name="channel">Channel to invalidate.</param> /// <param name="direction">Propagation direction.</param> public override void Invalidate(GameObject sender, string channel, InvalidationDirection direction) { base.Invalidate(sender, channel, direction); if (direction.HasFlag(InvalidationDirection.Children)) { foreach (Drawable obj in Children) { obj.Invalidate(sender, channel, InvalidationDirection.Children); } } }
/// <summary> /// Called on object invalidation. /// </summary> /// <param name="sender">Who call this invalidation.</param> /// <param name="channel">Channel invalidated.</param> /// <param name="direction">Propagation direction.</param> /// <returns>True if invalidation is full handled and propagation must stop.</returns> protected virtual bool OnInvalidation(GameObject sender, string channel, InvalidationDirection direction) { Cache.Invalidate(channel); return(false); }
/// <summary> /// Start an invalidation call from this object on the specified channel. /// </summary> /// <param name="sender">Who call this invalidation.</param> /// <param name="channel">Channel to invalidate.</param> public void Invalidate(string channel, InvalidationDirection direction) { Invalidate(this, channel, direction); }