Use ScriptableObjects which are like prefabs in Unity but allow you to store serialized class instances in your project’s asset folder. By creating an AssetUtility class to instantiate ScriptableObjects, you’ll be able to create instances of the newly created actor class to set up a player and monster template in your RPG game.
- [Voiceover] In order for us to use our new actor,…we're gonna need a way to create the Scriptable Object…in our project.…To do this, we're gonna make a new utility class…that'll help us out.…Inside of our BattleSystem Editor folder,…let's Create a new C# Script,…and we're gonna call this AssetUtil.…Then let's open this up in MonoDevelop.…Since this will be a utility class, we can remove…MonoBehavior and also delete the Start and Update methods.…In order for us to work with asset folder inside…of our project, we're gonna need…to import the UnityEditor namespace.…
Now let's go ahead and create a new static method…that will allow us to create Scriptable Objects.…We'll start by making this public static…with a return type of void,…and we're gonna call it CreateScriptableObject.…Now before we finish this method,…we're gonna make this a generic method.…A generic method allows us to pass different types…of classes into it and still perform the same actions.…We're gonna make the base assumption that whatever…the generic class we pass in is always gonna be…
- 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.