// Use this for initialization void Start() { db = new Databasemanager (); string[] characters = db.GetCharactersByPlayerId (GameObject.Find ("_ACCOUNTINFO").GetComponent<Accountinformation> ().userId); List<string> tempchars = new List<string>(); foreach (string character in characters) { if(character != "") { tempchars.Add(character); } } while (tempchars.Count < 5) { tempchars.Add ("Empty"); } characters = tempchars.ToArray (); firstCharacter.GetComponentInChildren<Text> ().text = characters [0]; secondCharacter.GetComponentInChildren<Text> ().text = characters [1]; thirdCharacter.GetComponentInChildren<Text> ().text = characters [2]; fourthCharacter.GetComponentInChildren<Text> ().text = characters [3]; fifthCharacter.GetComponentInChildren<Text> ().text = characters [4]; firstCharacter.onClick.AddListener (() => CharacterInformation (firstCharacter.GetComponentInChildren<Text> ().text)); }
private void CharacterInformation(string name) { db = new Databasemanager (); string[] response = db.GetCharacterInformationByName (name); //response is made up with 4 parameters charname, classname, racename, lvl }
// Use this for initialization void Start() { ResetPoints(); db = new Databasemanager(); attributeSkilled = new List<int>(); for (int i = 0; i < 30; i++) { raceMods.Add(0); classMods.Add(0); } racePanel.SetActive(true); classPanel.SetActive(true); GetRaces(); GetClasses(); racePanel.SetActive(false); classPanel.SetActive(false); for (int y = 0; y < plusButtons.Length; y++) { int temp = y; plusButtons[temp].onClick.AddListener(() => AddSkillLevel(temp)); minusButtons[temp].onClick.AddListener(() => SubSkillLevel(temp)); plusButtons[temp].enabled = false; minusButtons[temp].enabled = false; } for (int x = 0; x < 4; x++) { int temp = x; attributePlus[temp].onClick.AddListener(() => AddAttributeLevel(temp)); attributeMinus[temp].onClick.AddListener(() => SubAttributeLevel(temp)); attributePlus[temp].enabled = false; attributeMinus[temp].enabled = false; } CreateBtn.onClick.AddListener(() => CreateCharacter()); }