public class TreasureHunt : MiniGame
_Slots |
Root object of all Slots (i.e. the objects hiding the rewards, e.g. chests ) |
_InitialSlots |
Number of closed chest to be shown. If -1 (default) then all slots children of _Slot will be shown |
_MaxRewardsPerGame |
How many rewards are going to be selected if all slots get opened. (-1 means that all rewards will be shown) |
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. |
.
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
|
|||
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