1. The JoyMonster Box - Attaching the Box
The JoyMonster Box is called from the JoyMonster.World method. You may want to include this as a using statement at the top of your script. The examples below include the full call.
In order to attach a JoyMonster box to an object of your choice in your game, you'll just have to attach the JoyMonsterBox component at the root of this object. And inside your own script (attached to the object), you'll just have to call the AttachBox method of the JoyMonsterBox component, as such:

This will automatically attach the JoyMonsterBox on top of your object in the game, if one is available. If none are available, nothing will happen, so you don't have to worry about anything.
As each game is a bit different, this is also the place where you can define your own rules, such as only calling AttachBox once in a game, or once every x minutes etc…
When JoyMonster is initialized by the user, the plugin will ask the server if there are any rewards available to that user. The plugin will either return the number of engagements in the area or not.
If there is an engagement available, then JoyMonster will attach the box to the object. If the player is throttled, then the box will not attach to the object.
2. Destroying the Box
Once the player collected/destroyed/touched your object and it is now "collected", you'll also need to trigger the "collect" of the JoyMonsterBox. In order to do that, simply call the CollectBox method on the JoyMonsterBox component, as such:

This will trigger the animation of the JoyMonsterBox being destroyed, and add a reward to the wallet of the user.
3. Releasing the Box
In some cases, the player will miss your object thus will not collect the JoyMonsterBox. In this scenario, you want to "release" the JoyMonsterBox once it's out of screen, to be able to reuse it later in the game, when another call to AttachBox will be made. In order to do that, just call the ReleaseBox method on the JoyMonsterBox component.
In most cases, you already destroy your object when it's out of screen, if that's the case, just add the ReleaseBox call inside the OnDestroy callback of your script, so when your object is destroyed, it will also release the JoyMonsterBox.

4. The Reward Screen
Finally, at the end of the game, you'll want to display what is the reward the user collected during the game when he collected a JoyMonsterBox. In order to do that, when you display your game over screen, you'll just need to call the following:

Calling this method will display the reward the user won in fullscreen. The user will dismiss the screen and will be brought back to your game over screen.