Resolve WES-117 "Persistent data handling"
This commit is contained in:
@@ -22,11 +22,6 @@ public class ChangeUserScreen : MonoBehaviour
|
||||
/// </summary>
|
||||
public GameObject error;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the user list
|
||||
/// </summary>
|
||||
public UserList userList;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the current selected user in the UserList
|
||||
/// </summary>
|
||||
@@ -42,7 +37,7 @@ public class ChangeUserScreen : MonoBehaviour
|
||||
/// </summary>
|
||||
void Start()
|
||||
{
|
||||
userList.Load();
|
||||
PersistentDataController.GetInstance().Load();
|
||||
error.SetActive(false);
|
||||
DisplayUsers();
|
||||
}
|
||||
@@ -57,8 +52,8 @@ public class ChangeUserScreen : MonoBehaviour
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
List<User> users = userList.GetUsers();
|
||||
currentUserIndex = userList.GetCurrentUserIndex();
|
||||
List<User> users = UserList.GetUsers();
|
||||
int currentUserIndex = UserList.IndexOf(UserList.GetCurrentUser().GetUsername());
|
||||
for (int i = 0; i < users.Count; i++)
|
||||
{
|
||||
User user = users[i];
|
||||
@@ -99,8 +94,7 @@ public class ChangeUserScreen : MonoBehaviour
|
||||
/// </summary>
|
||||
public void IChooseYou()
|
||||
{
|
||||
userList.ChangeCurrentUser(currentUserIndex);
|
||||
userList.Save();
|
||||
UserList.ChangeCurrentUser(currentUserIndex);
|
||||
SystemController.GetInstance().BackToPreviousScene();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user