In this video Jesse Freeman teaches you how to connect all of the action buttons inside of the battle window. You’ll leverage Unity 5’s new UI button OnClick event handlers to connect up the button GameObjects to the battle window’s own methods. This will enable you to begin wiring up the attack and run away actions.
- [Voiceover] Now It's time for us to connect up…the rest of the BattleWindow logic to get it ready…for us to start our combat loop.…To do this, let's open up our BattleWindow.…The first thing we wanna do, is hide the Actions Group…whenever we start a battle.…Let's create a new public field.…We'll type it to GameObject and call it actionsGroup.…Now, when we open up our window, let's go ahead…and call actionsGroup.SetActive and pass in false.…
This is gonna hide the Actions Group.…Let's save our code, and switch over to Unity.…Now before we run our game, let's go ahead…and click on the Battle Actions window…and drag the Actions Game Object over to the new…Actions Group field.…Now if we run our game, and select the GameWindow,…we can hit Start Battle.…You'll also notice that the action buttons are now hidden…as the battle begins.…One other thing that I'm seeing is that for some reason,…the message and the BattleWindow aren't being…triggered correctly when they start for the first time.…
It appears that we have a race condition…
- 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.