public void Initialize(UserProfile profile) { base.Initialize(); this.profile = profile; unreadNotificationBadge.Initialize(ChatController.i, profile.userId); if (profile.userName.Length > 10) { label.text = profile.userName.Substring(0, 10) + "..."; } else { label.text = profile.userName; } if (profile.faceSnapshot != null) { portrait.sprite = profile.faceSnapshot; } else { profile.OnFaceSnapshotReadyEvent += Profile_OnFaceSnapshotReadyEvent; } SetOnlineStatus(false); }
protected override IEnumerator SetUp() { chatController = new ChatController_Mock(); GameObject go = Object.Instantiate((GameObject)Resources.Load(UNREAD_NOTIFICATION_BADGE_RESOURCE_NAME)); unreadNotificationBadge = go.GetComponent <UnreadNotificationBadge>(); unreadNotificationBadge.Initialize(chatController, TEST_USER_ID); CommonScriptableObjects.lastReadChatMessages.Remove(TEST_USER_ID); CommonScriptableObjects.lastReadChatMessages.Remove(INVALID_TEST_USER_ID); Assert.AreEqual(0, unreadNotificationBadge.currentUnreadMessages, "There shouldn't be any unread notification after initialization"); Assert.AreEqual(false, unreadNotificationBadge.notificationContainer.activeSelf, "Notificaton container should be deactivated"); yield break; }
private void Start() { unreadNotificationBadge.Initialize(ChatController.i, userId); jumpInButton.Initialize(FriendsController.i, userId); jumpInButton.OnClick += () => OnJumpInClick?.Invoke(this); }
private void Start() { unreadNotificationBadge.Initialize(ChatController.i, userId); jumpInButton.Initialize(FriendsController.i, userId); }