private void CreateAccount() { if (string.IsNullOrEmpty(fullNameIF.text.ToString()) || string.IsNullOrEmpty(fullNameIF.text.ToString()) || string.IsNullOrEmpty(fullNameIF.text.ToString()) || string.IsNullOrEmpty(fullNameIF.text.ToString()) || string.IsNullOrEmpty(fullNameIF.text.ToString())) { Debug.Log("Fill all the fields"); } else { UserAccount newAccount = new UserAccount(); newAccount.username = fullNameIF.text.ToString(); TestApp.GetInstance().lastIndex = TestApp.GetInstance().lastIndex + 2; newAccount.uniqueId = TestApp.GetInstance().lastIndex; TestApp.GetInstance().AddUser(newAccount); //TODO Handle Properly- Guid to next window MoveBackToPreUI(); } }
private void CheckForLocalAccounts() { if (!TestApp.GetInstance().isNoLocalAccounts) { ClearList(accountsRectTracker); accountsRectTracker = new List <GameObject>(); UserAccount[] allAccounts = TestApp.GetInstance().userAccounts.ToArray(); foreach (var item in allAccounts) { GameObject account = Instantiate(accountTemplateUi) as GameObject; accountsRectTracker.Add(account); account.transform.SetParent(rectParent); account.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); account.GetComponent <AccountTemplateUI>().accountUniqueId = item.uniqueId; account.GetComponent <AccountTemplateUI>().username.text = item.username; //TODO Add rest items } } else { Debug.Log("Create New account"); } }
public void RemoveAccount(int accountId) { TestApp.GetInstance().userAccounts = TestApp.GetInstance().userAccounts.Where(val => val.uniqueId != accountId).ToList(); CheckForLocalAccounts(); }