SCILLBattlePassChallengeItem
public class SCILLBattlePassChallengeItem : MonoBehaviour
Overview
This component will handle UI for a challenge of a battle pass level. It will update progress whenever the challenge progress changes.
It listens on the OnBattlePassChallengeUpdate
delegate of the SCILLBattlePassManager and
will update the progress accordingly.
Please note: This class is intended to be used with the SCILLBattlePassLevels
component (set as prefab for a challenge). As SCILLBattlePassLevels does hide
all challenges that are not in progress, this class does not handle challenges that are not in-progress
correctly, i.e.
the progress bar is always visible, as the goal. If you want to implement special behavior, derive this class and override
the UpdateUI function to adjust UI accordingly.
Inspector properties
challengeName
public UnityEngine.UI.Text challengeName;
Text UI that is used to render the challenge name.
challengeProgressSlider
public Slider challengeProgressSlider;
Progress slider that is used to show the progress of the challenge. Remove the handle as this is a non-interactive display of the current challenges progress. The progress will automatically updated whenever the challenge progress changes.
challengeGoal
public UnityEngine.UI.Text challengeGoal;
Text used to render the challenge progress and goal in this format: 34/500
.
challengeIcon
public Image challengeIcon;
The BattlePassLevelChallenge has a challenge_icon
setting. This is a string value that
you can set in the Admin Panel. The class will try to load a sprite with the same name from your Asset database and will
set that as the sprite of the connected UnityEngine.UI.Image
class.
Please note: The sprite is loaded at runtime and must be within a Resources
folder in your Asset database so that Unity
exposes that asset so that it can be loaded dynamically.
Virtual methods
UpdateUI
public void UpdateUI()
Trigger a UI update. That is done automatically whenever the challenge changes. However, you might also trigger an update of the UI manually.