Learn how to connect the player’s actions to the battle window. You’ll create an array of actions and from there choose the correct action based on the id supplied by the battle action buttons in the battle window. After performing the action you’ll update the player and monster stats to display any changes.
- [Voiceover] Now it's time for us to connect up…our player's attack action.…Let's go into our Advanced UI,…scripts, windows folder,…and open up our battle window.…Towards the top of our window,…let's add a new public field…with a type GenericBattleAction array,…and we'll call this actions.…This will allow us to add multiple actions…to the battle window,…and if you remember back…to when we press our attack and run button,…we simply pass an id in, and we'll back able to link that id…to an action inside of this array.…
Let's save this and go back into Unity…and inside of our canvas, game window, battle window,…let's scroll down,…and under the actions drop down,…let's change this to one,…and go ahead and pick from our assets folder…our attack battle action.…Now our actions are linked to our battle window.…Let's save this and go back into our battle window.…Let's scroll down to our OnAction method.…At the top of our method,…we're going to want to select the current action,…so let's create a new variable called var action…
- Preparing the user interface
- Creating game and message windows
- Building a battle window
- Adding a monster and action buttons
- Creating an actor class
- Adding player and monster attack actions
- Triggering battles from the map
- Ending a battle
- Cleaning up the battle and attack systems
- Rewarding the player
Skill Level Intermediate
1. Preparing the UI
2. Message Window
3. The Battle Window
4. Actor Classes
5. Battle Actions
6. Cleaning Up Combat
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.