API ››
Parent Previous Next


public class TreasureHunt : MiniGame



Root object of all Slots (i.e. the objects hiding the rewards, e.g. chests )


Number of closed chest to be shown. If -1 (default) then all slots children of _Slot will be shown


How many rewards are going to be selected if all slots get opened. (-1 means that all rewards will be shown)

Internal Variables

List<TreasureHunt_Slot> mSlots

When ApplyLayout is called, all slots children of _Slot will get into this list, and the function FilterSlot is called to remove slots until gameplay and _InitialSlots is meet.

TreasureHunt_Slot mCurrentSlot

Temporal variable used to know which slot is selected while validating the round.


Public Methods

override void ApplyLayout ()

Initializes the game and fills the mSlots list with the children of _Slots

virtual void FilterSlots( int numSlots )

Remove the extra slots so that only numSlots be available

Here you can remove slots in between to make the shape you want

for example


456  -(7,9)-->



456   instead of





override bool CanPlayAnotherRound()

A new round can only be played if there are closed slots.

void OnSlotSelected( TreasureHunt_Slot slot )

This function starts the round logic. It gets called whenever a slot is clicked and it checks if the slot can be opened without paying or if there is enough currency to open it.

override void StartRound()

After the round is validated, this selected the reward and opens the slot

Created with the Personal Edition of HelpNDoc: Easily create EPub books