O'Reilly logo

Building an RPG with Unity 5.x by Vahé Karamian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Player data management

We have not saved the actual data representing the customization of our player. The next step is to enhance our PC.cs and CharacterCustomization.cs scripts to actually save the selected data in our PC object.

PC class enhancements

To do this, we need to modify our PC.cs code; here is the new code listing:

using System; [Serializable] public class PC : BaseCharacter { public enum SHOULDER_PAD { none = 0, SP01 = 1, SP02 = 2, SP03 = 3, SP04 = 4 }; public enum BODY_TYPE { normal = 1, BT01 = 2, BT02 = 3 }; // Shoulder Pad public SHOULDER_PAD selectedShoulderPad = SHOULDER_PAD.none; public BODY_TYPE selectedBodyType = BODY_TYPE.normal; public bool kneePad = false; public bool legPlate = false; public enum WEAPON_TYPE { none = 0, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required