RewardIcon

A way for devs to provide reward icons to LionSDK.

LionSDK lets developers link images (icons) to specific rewards. These icons are used in Lion modules to show the rewards visually.

Reward Structure:

Each reward entry consists of:

  • name (string): A unique key used to identify and fetch a specific reward icon.

  • icon (Sprite): A UnityEngine.Sprite object representing the visual icon for the reward.

How it works:

LionSDK supports two methods for adding reward icons: Local and Server-based.

1. Local Setup (Editor)

LionSDK automatically generates a RewardIcons ScriptableObject at:

Assets/LionStudios/Resources/RewardIcons.asset

To use:

  • Open the RewardIcons asset in the Unity Editor.

  • Add as many reward icon entries as needed.

  • Assign each entry a unique name and a corresponding Sprite icon.

This method is ideal for static or build-time icon assignments.

2. Server-based

  • LionSDK supports remote configuration through platforms like:

    • Firebase

    • Satori

    • Balancy

    To configure reward icons remotely:

    1. Use the key LS_RewardIcons.

    2. Assign a Dictionary<string, Sprite>-like structure as the value.

    3. The icon data can be provided in multiple ways, i.e

      • Base64-encoded string: "base64:<...>"

      • Unity Resources path: "resources:Images/diamond.png"

      • Reference json object: "ref:star_icon"

    Example Remote Config JSON:

    {
        "LS_RewardIcons": {
            "hammer": "base64:a132bkalsdlb23122.........",
            "diamond": "resources:Images/diamond.png",
            "stars": "ref:star_icon"
        },
        "star_icon": "base64:a132bkalsdlb23122........."
    }

    🔗 Click here to learn more about integrating with Remote Configs.

💡 Notes

  • Remote icons take precedence over local entries if keys match.

  • For Balancy, Sprite can be a dictionary of actual sprite type not just json.

Last updated