Exemplo n.º 1
0
 private void OnDestroy()
 {
     if (usersTracker != null)
     {
         usersTracker.UserJoined -= NotifyUserJoined;
         usersTracker.UserLeft   -= NotifyUserLeft;
     }
     usersTracker = null;
 }
Exemplo n.º 2
0
        private void Connected(object sender = null, EventArgs e = null)
        {
            SharingStage.Instance.SharingManagerConnected -= Connected;

            usersTracker = SharingStage.Instance.SessionUsersTracker;
            localUser    = SharingStage.Instance.Manager.GetLocalUser();

            usersTracker.UserJoined += NotifyUserJoined;
            usersTracker.UserLeft   += NotifyUserLeft;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Called when a user is joining the current session.
 /// </summary>
 /// <param name="user">User that joined the current session.</param>
 private void UserJoinedSession(User user)
 {
     if (user.GetID() != SharingStage.Instance.Manager.GetLocalUser().GetID())
     {
     }
     if (mynumber == 0)
     {
         usersTracker = SharingStage.Instance.SessionUsersTracker;
         mynumber     = usersTracker.CurrentUsers.Count;
         myColor      = colorMap[mynumber];
         Debug.Log("mynumber=" + mynumber);
     }
 }
Exemplo n.º 4
0
        private void Connected(object sender = null, EventArgs e = null)
        {
            SharingStage.Instance.SharingManagerConnected -= Connected;

            usersTracker = SharingStage.Instance.SessionUsersTracker;

            for (var i = 0; i < usersTracker.CurrentUsers.Count; i++)
            {
                Users.Add(usersTracker.CurrentUsers[i].GetID(), usersTracker.CurrentUsers[i].GetName());
                CreateUserTextIdentifier(usersTracker.CurrentUsers[i]);
            }

            usersTracker.UserJoined += NotifyUserJoined;
            usersTracker.UserLeft   += NotifyUserLeft;
        }
        private void Connected(object sender, EventArgs e)
        {
            SharingStage.Instance.SharingManagerConnected -= Connected;

            usersTracker = SharingStage.Instance.SessionUsersTracker;

            Debug.LogFormat("{0} users in room.", usersTracker.CurrentUsers.Count);

            foreach (User currentUser in usersTracker.CurrentUsers)
            {
                Debug.LogFormat(currentUser.GetName());
            }

            usersTracker.UserJoined += NotifyUserJoined;
            usersTracker.UserLeft   += NotifyUserLeft;
        }
        private void Connected(object sender = null, EventArgs e = null)
        {
            SharingStage.Instance.SharingManagerConnected -= Connected;

            usersTracker = SharingStage.Instance.SessionUsersTracker;
            string users = string.Empty;

            for (int i = 0; i < usersTracker.CurrentUsers.Count; i++)
            {
                users += "\n" + usersTracker.CurrentUsers[i].GetName();
            }

            Debug.LogFormat("[User Notifications] {0} users in room.{1}", usersTracker.CurrentUsers.Count, users);

            localUser = SharingStage.Instance.Manager.GetLocalUser();

            usersTracker.UserJoined += NotifyUserJoined;
            usersTracker.UserLeft   += NotifyUserLeft;
        }