/// Credit setchi (https://github.com/setchi) /// Sourced from - https://github.com/setchi/FancyScrollView namespace UnityEngine.UI.Extensions { public abstract class FancyScrollViewCell : MonoBehaviour where TContext : class { /// /// Gets or sets the index of the data. /// /// The index of the data. public int DataIndex { get; set; } /// /// Gets a value indicating whether this is visible. /// /// true if is visible; otherwise, false. public virtual bool IsVisible { get { return gameObject.activeSelf; } } /// /// Gets the context. /// /// The context. protected TContext Context { get; private set; } /// /// Sets the context. /// /// Context. public virtual void SetContext(TContext context) { Context = context; } /// /// Sets the visible. /// /// If set to true visible. public virtual void SetVisible(bool visible) { gameObject.SetActive(visible); } /// /// Updates the content. /// /// Item data. public virtual void UpdateContent(TData itemData) { } /// /// Updates the position. /// /// Position. public virtual void UpdatePosition(float position) { } } public abstract class FancyScrollViewCell : FancyScrollViewCell { } }