void loginWindow(int id) { GUI.Label(new Rect(10, 20, 100, 30), "User Name"); username = GUI.TextField(new Rect(10, 40, 180, 30), username); GUI.Label(new Rect(10, 90, 100, 30), "Password"); password = GUI.PasswordField(new Rect(10, 110, 180, 30), password, '*'); if (GUI.Button(new Rect(10, 150, 80, 30), "Cancel")) { isLogin = false; } if (GUI.Button(new Rect(100, 150, 80, 30), "Login")) { int connect_result = EmotivCloudClient.EC_Connect(); if (connect_result == EmotivCloudClient.EC_OK) { var login_result = EmotivCloudClient.EC_Login(username, password); if (login_result == EmotivCloudClient.EC_OK) { Debug.Log("login success"); EmotivCloudClient.EC_GetUserDetail(ref userCloudId); Debug.Log("user cloud id: " + userCloudId.ToString()); nProfile = EmotivCloudClient.EC_GetAllProfileName(userCloudId); Debug.Log("number profiles: " + nProfile.ToString()); profiles = new List <PROFILE>(); for (var i = 0; i < nProfile; i++) { //Debug.Log("delete profile: "); //var _id = EmotivCloudClient.EC_ProfileIDAtIndex(userCloudId, i); //EmotivCloudClient.EC_DeleteUserProfile(userCloudId, _id); int ii = EmotivCloudClient.EC_ProfileIDAtIndex(userCloudId, i); EmotivCloudClient.Plugin_EC_ProfileNameAtIndex(userCloudId, 0); PROFILE t = new PROFILE(); t.id = EmotivCloudClient.EC_ProfileIDAtIndex(userCloudId, i); t.name = EmotivCloudClient.Plugin_EC_ProfileNameAtIndex(userCloudId, i); profiles.Add(t); Debug.Log("profile name: " + profiles[i].name + " profile id: " + profiles[i].id.ToString()); } isLogin = false; } else { Debug.Log("cannot login, error: " + login_result.ToString()); } } else { Debug.Log("cannot connect to emotiv cloud, error: " + connect_result.ToString()); } } if (userCloudId != -1) //logged in { if (GUI.Button(new Rect(10, 150, 80, 30), "Load Profile")) { } } }