SCILLBattlePassLevel

public class SCILLBattlePassLevel : MonoBehaviour

Overview

Implements a level component in the Battle Pass User Interface. It will embed SCILLBattlePassRewardIcon prefabs to show available rewards for this level. Create a prefab with this component attached and set as the levelPrefab, currentLevelPrefab and lockedLevelPrefab in the SCILLBattlePassLevels component.

Inspector properties

rewardContainer

public Transform rewardContainer;

A transform object in that the reward icons will be instantiated. If this is not set, the reward icon prefabs will be instantiated as child of this components transform.

battlePassLevelInfo

public GameObject battlePassLevelInfo;

Set a game object that will be hidden if showLevelInfo of the SCILLBattlePassLevels script will be false. It typically shows the level number which is rendered in the levelName Text field.

levelName

public UnityEngine.UI.Text levelName;

A textfield that will be used to render the level number.

rewardIconPrefab

public SCILLBattlePassRewardIcon rewardIconPrefab;

A prefab that will be used as a reward icon. It must have a SCILLBattlePassRewardIcon component attached to the root object.

progressSlider

public UnityEngine.UI.Slider progressSlider;

A slider that will be used to render the current progress in this level. Remove the handle so that users cannot change the value as this is only a progress bar without user interaction.

Methods

UpdateUI

public void UpdateUI()

Trigger a UI update. That is done automatically whenever the level or a challenge within that level changes to update progress bar and state. However, you may want to trigger an update in between. It will rebuild the hierarchy for the reward icons.

Virtual methods

Select

public virtual void Select()

This class does nothing if the level is selected. However, you may want to implement some sort of selection rect or a glowing effect for the selected level. This class is called whenever this level is selected.

Deselect

public virtual void Deselect()

This class does nothing if the level is deselected. However, you may want to implement some sort of selection rect or a glowing effect for the selected level. This class is called whenever this level is deselected.