Guest User

Untitled

a guest
Feb 15th, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4.  
  5. public class CharacterGenerator : MonoBehaviour {
  6.     private PlayerCharacter _toon;
  7.     // Use this for initialization
  8.     void Start () {
  9.         _toon = new PlayerCharacter ();
  10.         _toon.Awake ();
  11.     }
  12.    
  13.     // Update is called once per frame
  14.     void Update () {
  15.    
  16.     }
  17.  
  18.     void OnGUI(){
  19.         DisplayName ();
  20.         DisplayAtt ();
  21.     }
  22.  
  23.     private void DisplayName(){
  24.         GUI.Label (new Rect(10,10, 50, 25),"Name");
  25.         _toon.Name = GUI.TextArea (new Rect (65, 10, 100, 25), _toon.Name);
  26.     }
  27.     private void DisplayAtt(){
  28.        
  29.         for(int i = 0; i < Enum.GetValues(typeof(AttributeName)).Length; i++){
  30.             GUI.Label(new Rect(10,40 + (i * 25),100,25), ((AttributeName)i).ToString());
  31.             GUI.Label(new Rect(115,40 + (i * 25),30,25), _toon.GetPrimaryAttribute(i).AdjustedBaseValue.ToString());
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment