The code for character customization

Things don't happen automatically. We need to create some C# code that will handle the customization of our character model. The script we create here will handle the UI events that will drive the enabling and disabling of different parts of the model mesh.

Create a new C# script and call it BarbarianCharacterCustomization.cs. Create an empty GameObject called __Base and attach the script to __Base GameObject in the scene. Here is a listing of the script:

path of the code

using System;using UnityEngine;using UnityEngine.UI;namespace com.noorcon.rpg2e{  public class BarbarianCharacterCustomization : MonoBehaviour  {    public GameObject PLAYER_CHARACTER;    public PlayerCharacter PlayerCharacterData; public Material[] ...

Get Building an RPG with Unity 2018 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.