示例#1
0
    //----------------------------------------------------------------------------------------------------------------------------------------------//

    public void GetUserInfo()
    {
        print(DateTime.Now.ToString("MMMM") + " " + DateTime.Now.Day.ToString() + " at " + DateTime.Now.ToString("hh") + ":" + DateTime.Now.Minute.ToString() + " " + DateTime.Now.ToString("tt"));

        //debug.message = "Process Starting (Get User Info)";
        debug.message = FirebaseDatabase.DefaultInstance.RootReference.ToString();
        DataRef.CurrentUser().GetValueAsync().ContinueWith(async(task) => {
            await new WaitForUpdate();
            if (task.IsCanceled || task.IsFaulted)
            {
                return;
            }
            DataSnapshot snapshot = task.Result;
            username.text         = snapshot.Child("Username").Value.ToString();
            currentUsername       = snapshot.Child("Username").Value.ToString();
            DateTime tempDate     = Convert.ToDateTime(snapshot.Child("CreatedDate").Value.ToString());
            string month          = tempDate.ToString("MMMM");
            string year           = tempDate.Year.ToString();
            createdDate.text      = "Member Since " + month + " " + year;
            userPermissions       = snapshot.Child("Permissions").Value.ToString();
            menuNav.SetComingSoon(userPermissions);
            topUp.target  = (int.Parse(snapshot.Child("Balance").Value.ToString())) / 100;
            topUp.balance = (int.Parse(snapshot.Child("Balance").Value.ToString())) / 100;
            pictureManager.DisplayPicture(snapshot.Child("PictureID").Value.ToString());
            pictureManager.RevealProfileInfo();

            transform.GetComponent <UserAuthentication> ().loading = false;

            GetGroupInfo(snapshot);

            activityManager.StartActivityProcess();
            circlesManager.StartCircleProcess();
        });
    }