Skip to main content

CosmeticScrollElement

A class in Root.Township, Alta.Customization.

One page of the cosmetic scroller in the customization room. Spawns a pickup per slot for the items on that page and shows a lock icon on unowned ones.

Constructors​

MemberWhat it is
CosmeticScrollElement()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

10 private and internal fields
MemberWhat it is
private Animator animatorAnimator that shows and hides the page.
private uint[] currentDefinitionsItem hash shown in each slot, 0 for empty.
private static Logger loggerNLog logger for this class.
private CosmeticScrollManager managerParent scroll manager, which gives the customization session.
private CustomizationPickup[] pickupsPickup spawned in each slot.
private ItemScroller scrollerItem scroller this page belongs to; its count sets how many pages there are.
private CosmeticScrollSource scrollSourceSource of the item hashes to show.
private Transform[] slotsTransforms where pickups are placed.
private GameObject[] unownedIconsPer-slot icons shown when the item isn't owned.
private static int VisibleHash of the animator bool Visible.

Methods​

MemberWhat it is
override void Hide()Hides the page and sets its pickups to destroy once released.
override async void Show(int index)Shows the page for an index (wrapping around), clears old pickups and spawns the items for that page; stops early if the item list changes.
3 private and internal methods
MemberWhat it is
private void FilterInteractionAfterRelease(Interactor interactor, Interactable interactable, ref bool result)Interaction filter on the spawned pickups; blocks grabbing while the page is hidden.
private void OnDestroy()Destroys the page's pickups and unsubscribes from ownership updates.
private void UpdateOwned()Refreshes the unowned icons when the owned list changes.