AbstractViewsHolder Class |
Namespace: Com.ForbiddenByte.OSA.Core
public abstract class AbstractViewsHolder
The AbstractViewsHolder type exposes the following members.
Name | Description | |
---|---|---|
AbstractViewsHolder |
Name | Description | |
---|---|---|
ItemIndex | The index of the data model from which this viewsholder's views take their display information |
Name | Description | |
---|---|---|
CollectViews | If instead of calling Init(GameObject, Int32, Boolean, Boolean), the initializaton is done manually, this should be called lastly as part of the initialization phase | |
Init(GameObject, Int32, Boolean, Boolean) |
Instantiates rootPrefabGO, assigns it to root and sets its itemIndex to itemIndex.
Activates the new instance if activateRootGameObject is true. Also calls CollectViews if callCollectViews is true
| |
Init(RectTransform, Int32, Boolean, Boolean) | ||
MarkForRebuild |
Make sure to override this when you have children layouts (for example, a [Vertical/Horizontal/Grid]LayoutGroup) and call MarkLayoutForRebuild(RectTransform) for them. Base's implementation should still be called!
| |
ShiftIndex |
This is only called when an item is being shifted due to an InsertItems(Int32, Int32, Boolean, Boolean) or
RemoveItems(Int32, Int32, Boolean, Boolean) call, but since its data remains the same (the models are shifted
to make room for the others, but they don't change), there's no need to call UpdateViewsHolder(TItemViewsHolder) Don't forget to call the base implementation first if you override this method! Don't forget to call the base implementation first if you override this method! | |
ShiftIntWithOverflowCheck | Internal utility for adding a shift to value and keeping it within range [0, modulo), and also preventing integer overflow |