The new great feature is available for you with Ultimate Ads plugin - Ads Constructor. Implement all behind the scene logic with zero lines of code. Define the set of triggers and rules for displaying the ads, and you are ready to go!
Our starting point is User Rules tab of Ultimate Ads plugin settings Unity Inspector window. You can see two lists - Rules and Triggers. Let me explain the purpose of each of these entities. Please, see the screenshot below with the predefined sets of triggers and rules.
The first one is a trigger or so-called trigger event. Basically, the trigger is an event that will be fired during the game session in a certain moment of time under the certain conditions. There are three types of triggers
- LevelLoaded. Will be fired up when the game scene with the certain name has been loaded. How to bind advertising trigger with an appropriate game scene will be described further. The additional rule can be added to this type of trigger as well.
- LevelFinished. Will be fired up when the game scene with the certain name has been unloaded. The additional rule can be added to this type of trigger as well.
- Custom Trigger. The most interesting type of trigger. Each custom trigger has its own condition fo be fired up (called rule). In other words, in a case of a custom trigger we will have the trigger with its own condition and additional rule to be checked before firing up (or not firing if the rule returns false).
All the custom triggers are listed in the User Rules tab. The LevelLoaded and LevelFinished triggers can be added from the Ads Constructor tab directly.
The internal condition of a trigger will check each frame. So, each frame the PlayerPrefs will check for a certain equation of the value with the given key. E.g. we have the following trigger
It means that each frame the trigger with name StartTrigger will check the PlayerPrefs for the integer value with _UserAttempt key. If the value is greater than 5, the trigger will be fired up. If the trigger has the rule attached, the rule will be checked. And if the rule condition returns true as well, the trigger will be fired up. Three types of trigger condition values are supported - Integer, Bool or String. You will be prompted to choose the trigger value condition type before adding the new trigger.
The rule is simply a container for a logic condition. The same as triggers, there are three types of rule condition values supported - Integer, Bool or String. You will be prompted to choose the rule value condition type before adding the new rule. Each rule has to be assigned to certain trigger (will be described in Ads Constructor section).
The Ads Constructor is a place where all the triggers and rules are going together providing you with the great mechanism for displaying ads in your project. You can set up the triggers and rules for Banner Ads, Interstitial Ads, Video Ads and Rewarded Video Ads. The view of Ads Constructor is provided on the screenshot below
The triggers are linked by the scene name. You will be prompted to choose the scene before adding the new trigger to it. As you can see from the screenshot, there are triggers with LevelLoaded, LevelFinished and Custom triggers as well. If you want to add the custom trigger to your scene, please, select the appropriate scene and select the name of an appropriate trigger from the drop-down list (highlighted with red colour on the screenshot below).
Of course, you can assign the appropriate rule to the trigger in such approach. If the trigger has its own condition only, the [Empty] label will be displayed in the Rule field. Otherwise, you will see the name of the corresponding rule there.
In general, you will be able to implement all the logic for displaying the appropriate ads in your project by using Ads Constructor ONLY. Please, check it out, maybe it will save a lot of time for your development process.
Important: Ads Constructor has scene-dependent logic. I mean, all the triggers and rules will be reset after reloading the scene. Please, be VERY careful with your Player Prefs flags related to triggers and rules. Make sure that all the flags are cleared or have the consistent state when you are navigating between your game scenes.
Ultimate Ads testing is available in Unity Editor mode to simulate the behaviour you will get in your game. Check it out, this feature will save you a huge amount of time. If you have any comments/suggestions, please, feel free to contact our support team via firstname.lastname@example.org