Join Harrison Ferrone for an in-depth discussion in this video Finishing touches, part of Unity 5: Build a Character Dialogue System.
- [Instructor] To round things out, we're going to make some minor adjustments to the UI, so our narrative event looks the best it can onscreen. First, let's change the avatar images, specifically their widths. I notice that when the mentor image comes on, because it's slightly smaller it gets a little squished. Select the avatar image under the right character panel. I'm just going to increase the width to 140 so it's a square. I'm going to do the same thing with the left character panel avatar image.
Let's run this and see what it looks like now. That's much better. Go ahead and save that. Let's also change the avatar images in our JSON so that they face each other. Since we have our JSON factory in place, when we want to make any changes, all we have to do is revisit our file.
If you don't have it open, revisit your resources folder. For this fix I'm just going to change the character types. So now we start with our hero, who is our heroine, and our ally is our male character, and our mentor will stay the same. We're also going to change the images, so we're going to say heroine surprised.
And hero surprised, if you're wondering where I'm getting the image names, they're back here in our event atlas that we created earlier in the course. So we've got heroine surprised, actually I'm going to go with heroine neutral, to start off with. Hero surprised, heroine angry, and hero default.
Back in Unity, let's run this again. That's beautiful. Let's go into our scripts folder and reorganize this a bit better. I'm going to right click, create new folder, I'm going to name this managers, I'm going to highlight all the manager scripts and drag them in there.
I'm going to delete our test script, going to create another folder, create folder, I'm going to name it utilities, I'm going to put our constants file in there. Our panel config and our JSON factory. I'm going to create one more folder, I'm going to name it classes.
And put our iManager interface in there, and our narrative event. So at least now it's a little bit more clean and organized. If you wanted to add another scene, all you would have to do, was go into the JSON assembly class, and update our resource list. For instance, we could have multiple scenes, even though they don't exist yet, resources.event2.JSON, that's it, then we could run the scene from our factory.
We've already seen how easy it was to change our JSON, and have really, cosmetic changes affected immediately. Let's run the scene one more time just for fun and see the fruits of our labor.
That looks wonderful. Going forward, you should know that even though this scene is a stand alone, it could be easily incorporated into a game, either 2D or 3D, it doesn't really matter, you could make this canvas a prefab and have it show up in game. On the other hand, if you wanted to segway between an endgame scene and this scene, you could save your scene preference in a player prefabs for instance, then modify the JSON assembly to pull from there.
There are so many ways that narrative game design comes in handy when you're trying to make an independent game, or even a triple A title. I wish you all the best of luck. Happy coding.
- Fostering engagement and an emotional investment
- Starting a project from scratch
- Importing the LitJSON library
- Using TexturePacker
- Creating the narrative event class
- Creating and finishing the JsonFactory
- Building a GUI animation system
- Writing and finishing the Panel Manager
- Adding player input and finishing touches