Admin Panel

SCILLRewardPreview

public class SCILLRewardPreview : MonoBehaviour

Overview

This component will listen to the SCILLBattlePassLevels.OnSelectedBattlePassLevelChanged event to get notified whenever the user clicks on a SCILLBattlePassLevel component.

When a reward is set for this level (reward_amount of the BattlePass object) it will try to load SCILLReward asset with that name. If the reward is available it will show its UI and will set image, name and description to connected UI elements.

The reward preview will instantiate the prefab set in the SCILLReward asset as child into this GameObject. The default preview has this hierarchy:

  • Reward photo box
    • Reward camera
    • Photo Box

Photo Box is connected to the photoBox property and models will be instantiated into this transform. The reward camera renders the model into a Render Texture that is used in the Reward Preview UI as a RawImage field.

Important: You need to set the layer that the reward camera renders to the same layer that you set in the prefab. This layer should be included from the main games camera.

As every game has a different layer structure we cannot set a specific layer for SCILL. You need to organize that yourself.

Inspector properties

rewardName

public UnityEngine.UI.Text rewardName;

Connect to a text field to render the name of the reward as set in the SCILLReward asset.

rewardDescription

public UnityEngine.UI.Text rewardDescription;

Connect to a text field to render the description of the reward as set in the SCILLReward asset.

claimButton

public GameObject claimButton;

Connect to a claim button which should have a Button attached. This item is hidden unless the reward can be claimed and has not been yet claimed. Connect the buttons click event to the OnClaimButtonPassRewardButtonClicked so that the reward is claimed.

photoBox

public GameObject photoBox;

Set a container GameObject that will be used as the parent for the 3D model preview prefabs. See Overview for more details on this topic.

Methods

OnClaimButtonPassRewardButtonClicked

public void OnClaimButtonPassRewardButtonClicked()