using UnityEngine; using System.Collections; public class Player : MonoBehaviour { public Player(int _charID, int _roleID){ SetCharacter(_charID); SetRole(_roleID); } void Awake(){ //Debug SetCharacter(charID); SetRole(roleID); Game.Get().SetMainPlayer(this); } public void DebugInfo() { Debug.Log(charname+" is a "+Rdb.GetStrRef(rolename_strref)+" with "+hp.ToString()+" hit points"); } void SetCharacter(int _charID){ charID = _charID; var ct = Rdb.GetTable("characters"); charname = ct.GetValue(charID, "name"); spellID = ct.GetValue(charID, "spell"); hp = ct.GetValue(charID, "hp"); } void SetRole(int _roleID){ roleID = _roleID; var rt = Rdb.GetTable("roles"); rolename_strref = rt.GetValue(roleID, "name_strref"); ultiID = rt.GetValue(roleID, "ulti"); align = rt.GetValue(roleID, "alignment"); } public int charID; public string charname; public int spellID; public int hp; public int roleID; public int rolename_strref; public int ultiID; public string align; }