Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Missions/Scenarios
  4. Campaign Menu

Campaign Menu

A campaign menu allows the player to load scenarios, complete and unlock other scenarios. The demo RTS Engine campaign menu can be found under: RTS Engine/Demo/Scenes/CampaignMenu.unity

The campaign menu mainly uses the Scenario Loader component to achieve this.


  1. Scenarios: A list of scenarios and the target map scene names (per scenario) where they will be played at are assigned for each element of this list. You can have different scenarios played at the same map or use the same scenario for multiple maps. A scenario is unlocked and can be loaded by the player if it’s either the first scenario in this array or the previous scenario has been already completed.
  2. Scenario UI Prefab: This prefab will be cloned for each element in the above scenarios array and will allow the player to load a scenario if it’s unlocked. This prefab has the Scenario Menu UI component attached to it:
    1. Name Text: Child of the prefab object, this UI Text element will display the associated scenario’s name.
    2. Description Text: Child of the prefab object, this UI Text element will display the associated description’s name.
    3. Load Button: Child of the prefab object, this UI Button allows the player to load the associated scenario. In the On Click () event of the Button component, drag and drop the prefab object as the event trigger source and assign the event to ScenarioMenuUI -> OnLoadButtonClick.
  3. Scenario UI Parent: All the created instances of the above scenario UI prefab will be children objects of the object assigned in this field which is required to have a Grid Layout Group component.
  4. Reset Scenario Progress: In the demo campaign menu, there’s a button that allows to reset the player’s progress regarding completed scenarios. To achieve this, in the On Click() event of the Button component, drag and drop the object that has the Scenario Loader component attached to it as the event trigger source and assign the event to ScenarioLoader -> Reset.

 

How can we help?