Quests

Lists all functions and model classes used within the SDK to support client-side quest functionality in Unity.

Functions and Methods

InitQuests

Initializes the local state of quests functionality. Should be called after player ID is available.

var paramsForQuestsPersonalization = new Dictionary<string, object>
{
    // Optional params go here
};
Kibotu.InitQuests(paramsForQuestsPersonalization);

TriggerQuestState

Handles the triggered event, which could involve progressing an active quest or starting a new one.

var paramsForQuestsPersonalization = new Dictionary<string, object>
{
    // Optional params go here
};
Kibotu.TriggerQuestState("GameWin", paramsForQuestsPersonalization);

TriggetQuestUI

Manages the visual communication of the quest's state to the player. If it returns true, then there is new information to be shown to the player.

var paramsForQuestsPersonalization = new Dictionary<string, object>
{
    // Optional params go here
};
if (Kibotu.TriggerQuestUI("Main_AutoShowPopup", paramsForQuestsPersonalization))
{
    QuestModal.ShowPopup(Kibotu.GetActiveQuest());
}

GetActiveQuest

Returns a KibotuQuest object that contains comprehensive data to be communicated to the player.

onQuestRewardAction

To be executed when the player acknowledges that they won the quest.

Kibotu.onQuestRewardAction(currentQuest.Id);

KibotuQuest.GetPrize

Returns a string that is the prize identifier when the player wins it.

KibotuQuestGraphics.GetGraphic

Returns KibotuQuestGraphic based on the quest's state.

var graphic = quest.Graphics.GetGraphic(currentQuest.Progress.Status);
await mainImage.SetImageAsync(graphic.Background);
await topBannerImage.SetImageAsync(graphic.TitleImage);

Models

KibotuQuest

public string Id;
public string Title;
public string Enabled;
[CanBeNull] public KibotuQuestProgress Progress;
public KibotuQuestProgressMilestone[] Milestones;
public List<string> CountryCodes;
public KibotuQuestGraphics Graphics;
public KibotuQuestTriggers Triggers;
public string CollectibleIconImage;

public int TotalSteps;
public JObject TargetFilter;
public DateTime from;
public DateTime to;

KibotuQuestProgress

public string CurrentState;
public int CurrentStep = 0;
public EnumQuestStates Status;

public enum EnumQuestStates
{
    Welcome,
    Progress,
    Won,
    Lost
}

KibotuQuestProgressMilestone

public int Order;
public string PrizeTitle;
public string PrizeImage;
public string PrizeSku;
public int Goal;
public string GoalImage;

KibotuQuestGraphics

public KibotuQuestGraphic Welcome;
public KibotuQuestGraphic Progress;
public KibotuQuestGraphic Lost;
public KibotuQuestGraphic Won;

KibotuQuestGraphic

public string Background;
public string TitleImage;

KibotuQuestTriggers

public KibotuQuestTriggerEvents State;
public KibotuQuestTriggerEvents UI;

KibotuQuestTriggerEvents

public List<KibotuQuestEvent> Welcome;
public List<KibotuQuestEvent> Progress;
public List<KibotuQuestEvent> Finish;

KibotuQuestEvent

public string EventName;
public string EventValue;

Last updated