Exemplo n.º 1
0
        private void onElementHidden(int index, GameObject element)
        {
            LockedItemGroup component = element.GetComponent <LockedItemGroup>();

            for (int num = component.ItemsContainer.childCount - 1; num >= 0; num--)
            {
                Transform child = component.ItemsContainer.GetChild(num);
                itemPool.Unspawn(child.gameObject);
            }
        }
Exemplo n.º 2
0
        private void onElementShown(int index, GameObject element)
        {
            LockedItemGroup component = element.GetComponent <LockedItemGroup>();

            component.ShowUnlockedBG = ShowUnlockedBGs;
            ItemGroup itemGroup = itemGroups[index];

            switch (itemGroup.State)
            {
            case ItemGroup.LockedState.LevelLocked:
                component.GoToLevelLockState(itemGroup.Level);
                break;

            case ItemGroup.LockedState.MascotLocked:
                component.GoToMascotLockState(itemGroup.MascotIconContentKey);
                break;

            case ItemGroup.LockedState.MemberLocked:
                component.GoToMemberLockState();
                break;

            case ItemGroup.LockedState.Unlocked:
                component.GoToUnlockedState();
                break;

            case ItemGroup.LockedState.CustomLocked:
                component.GoToCustomLockState();
                break;
            }
            component.SetThemeState(itemGroup.LocalizedThemeName, itemGroup.ThemeIconContentKey);
            component.SetBackgroundImage(itemGroup.BGImage);
            component.SetChildAlignment((itemGroup.GroupPosition == GroupPosition.None) ? TextAnchor.MiddleCenter : TextAnchor.MiddleLeft);
            for (int i = 0; i < itemGroup.Items.Length; i++)
            {
                spawnAndCreateItem(itemGroup.Items[i], component.ItemsContainer, itemGroup.State);
            }
            modifyShownElement(index, element);
        }