Show / Hide Table of Contents

Class FancyGridView<TItemData, TContext>

グリッドレイアウトのスクロールビューを実装するための抽象基底クラス. 無限スクロールおよびスナップには対応していません. Context が不要な場合は 代わりに FancyGridView<TItemData> を使用します.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
FancyScrollView<TItemData[], TContext>
FancyScrollRect<TItemData[], TContext>
FancyGridView<TItemData, TContext>
FancyGridView<TItemData>
Inherited Members
FancyScrollRect<TItemData[], TContext>.reuseCellMarginCount
FancyScrollRect<TItemData[], TContext>.paddingHead
FancyScrollRect<TItemData[], TContext>.paddingTail
FancyScrollRect<TItemData[], TContext>.spacing
FancyScrollRect<TItemData[], TContext>.CellSize
FancyScrollRect<TItemData[], TContext>.Scrollable
FancyScrollRect<TItemData[], TContext>.Scroller
FancyScrollRect<TItemData[], TContext>.Initialize()
FancyScrollRect<TItemData[], TContext>.Refresh()
FancyScrollRect<TItemData[], TContext>.Relayout()
FancyScrollRect<TItemData[], TContext>.RefreshScroller()
FancyScrollRect<TItemData[], TContext>.UpdateContents(IList<TItemData[]>)
FancyScrollRect<TItemData[], TContext>.UpdatePosition(Single)
FancyScrollRect<TItemData[], TContext>.JumpTo(Int32, Single)
FancyScrollRect<TItemData[], TContext>.ScrollTo(Int32, Single, Single, Action)
FancyScrollRect<TItemData[], TContext>.ScrollTo(Int32, Single, Ease, Single, Action)
FancyScrollRect<TItemData[], TContext>.UpdateScrollbarSize(Single)
FancyScrollRect<TItemData[], TContext>.ToFancyScrollViewPosition(Single)
FancyScrollRect<TItemData[], TContext>.ToScrollerPosition(Single)
FancyScrollRect<TItemData[], TContext>.ToScrollerPosition(Single, Single)
FancyScrollRect<TItemData[], TContext>.AdjustCellIntervalAndScrollOffset()
FancyScrollRect<TItemData[], TContext>.OnValidate()
FancyScrollView<TItemData[], TContext>.cellInterval
FancyScrollView<TItemData[], TContext>.scrollOffset
FancyScrollView<TItemData[], TContext>.loop
FancyScrollView<TItemData[], TContext>.cellContainer
FancyScrollView<TItemData[], TContext>.initialized
FancyScrollView<TItemData[], TContext>.currentPosition
FancyScrollView<TItemData[], TContext>.CellPrefab
FancyScrollView<TItemData[], TContext>.ItemsSource
FancyScrollView<TItemData[], TContext>.Context
FancyScrollView<TItemData[], TContext>.Initialize()
FancyScrollView<TItemData[], TContext>.UpdateContents(IList<TItemData[]>)
FancyScrollView<TItemData[], TContext>.Relayout()
FancyScrollView<TItemData[], TContext>.Refresh()
FancyScrollView<TItemData[], TContext>.UpdatePosition(Single)
Namespace: FancyScrollView
Assembly: FancyScrollView.dll
Syntax
public abstract class FancyGridView<TItemData, TContext> : FancyScrollRect<TItemData[], TContext> where TContext : class, IFancyGridViewContext, new()
Type Parameters
Name Description
TItemData

アイテムのデータ型.

TContext

Context の型.

Fields

cellSize

セルのサイズ.

Declaration
[SerializeField]
protected Vector2 cellSize
Field Value
Type Description
UnityEngine.Vector2

startAxisCellCount

最初にセルを配置する軸方向のセル数.

Declaration
[SerializeField]
protected int startAxisCellCount
Field Value
Type Description
System.Int32

startAxisSpacing

最初にセルを配置する軸方向のセル同士の余白.

Declaration
[SerializeField]
protected float startAxisSpacing
Field Value
Type Description
System.Single

Properties

CellPrefab

セルのグループ Prefab.

Declaration
protected override sealed GameObject CellPrefab { get; }
Property Value
Type Description
UnityEngine.GameObject
Overrides
FancyScrollView.FancyScrollView<TItemData[], TContext>.CellPrefab
Remarks

FancyGridView<TItemData, TContext> では, CellPrefab を最初にセルを配置する軸方向のセルコンテナとして使用します.

CellSize

Declaration
protected override float CellSize { get; }
Property Value
Type Description
System.Single
Overrides
FancyScrollView.FancyScrollRect<TItemData[], TContext>.CellSize

DataCount

アイテムの総数.

Declaration
public int DataCount { get; }
Property Value
Type Description
System.Int32

Methods

Initialize()

Declaration
protected override void Initialize()
Overrides
FancyScrollView.FancyScrollRect<TItemData[], TContext>.Initialize()

JumpTo(Int32, Single)

指定したアイテムの位置までジャンプします.

Declaration
protected override void JumpTo(int itemIndex, float alignment = 0.5F)
Parameters
Type Name Description
System.Int32 itemIndex

アイテムのインデックス.

System.Single alignment

ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).

Overrides
FancyScrollView.FancyScrollRect<TItemData[], TContext>.JumpTo(System.Int32, System.Single)

ScrollTo(Int32, Single, Ease, Single, Action)

指定したアイテムの位置まで移動します.

Declaration
protected override void ScrollTo(int itemIndex, float duration, Ease easing, float alignment = 0.5F, Action onComplete = null)
Parameters
Type Name Description
System.Int32 itemIndex

アイテムのインデックス.

System.Single duration

移動にかける秒数.

Ease easing

移動に使用するイージング.

System.Single alignment

ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).

System.Action onComplete

移動が完了した際に呼び出されるコールバック.

Overrides
FancyScrollView.FancyScrollRect<TItemData[], TContext>.ScrollTo(System.Int32, System.Single, EasingCore.Ease, System.Single, System.Action)

ScrollTo(Int32, Single, Single, Action)

指定したアイテムの位置まで移動します.

Declaration
protected override void ScrollTo(int itemIndex, float duration, float alignment = 0.5F, Action onComplete = null)
Parameters
Type Name Description
System.Int32 itemIndex

アイテムのインデックス.

System.Single duration

移動にかける秒数.

System.Single alignment

ビューポート内におけるセル位置の基準. 0f(先頭) ~ 1f(末尾).

System.Action onComplete

移動が完了した際に呼び出されるコールバック.

Overrides
FancyScrollView.FancyScrollRect<TItemData[], TContext>.ScrollTo(System.Int32, System.Single, System.Single, System.Action)

Setup<TGroup>(FancyCell<TItemData, TContext>)

セルテンプレートのセットアップを行います.

Declaration
protected virtual void Setup<TGroup>(FancyCell<TItemData, TContext> cellTemplate)
    where TGroup : FancyCell<TItemData[], TContext>
Parameters
Type Name Description
FancyCell<TItemData, TContext> cellTemplate

セルのテンプレート.

Type Parameters
Name Description
TGroup

セルグループの型.

SetupCellTemplate()

最初にセルが生成される直前に呼び出されます. Setup<TGroup>(FancyCell<TItemData, TContext>) メソッドを使用してセルテンプレートのセットアップを行ってください.

Declaration
protected abstract void SetupCellTemplate()
Examples
using UnityEngine;
using FancyScrollView;

public class MyGridView : FancyGridView<ItemData, Context>
{
    class CellGroup : DefaultCellGroup { }

    [SerializeField] Cell cellPrefab = default;

    protected override void SetupCellTemplate() => Setup<CellGroup>(cellPrefab);
}

UpdateContents(IList<TItemData>)

渡されたアイテム一覧に基づいて表示内容を更新します.

Declaration
public virtual void UpdateContents(IList<TItemData> items)
Parameters
Type Name Description
System.Collections.Generic.IList<TItemData> items

アイテム一覧.

Back to top Generated by DocFX