public IEnumerator NotificationHud_ShowTimedNotification() { var controller = new NotificationHUDController(); Notification.Model model = new Notification.Model() { type = NotificationFactory.Type.GENERIC, message = "text", timer = 3, scene = "" }; controller.ShowNotification(model); yield return(null); Notification[] notifications = GameObject.FindObjectsOfType <Notification>(); Assert.AreEqual(notifications.Length, 1); Assert.AreEqual(controller.model.notifications.Count, 1); yield return(new WaitForSeconds(4)); notifications = GameObject.FindObjectsOfType <Notification>(); Assert.AreEqual(notifications.Length, 0); Assert.AreEqual(controller.model.notifications.Count, 0); }
public IEnumerator NotificationHud_ShowNotification() { var controller = new NotificationHUDController(); Notification.Model model = new Notification.Model() { type = NotificationFactory.Type.GENERIC, message = "text", timer = -1, scene = "" }; controller.ShowNotification(model); yield return(null); Notification[] notifications = GameObject.FindObjectsOfType <Notification>(); Assert.AreEqual(notifications.Length, 1); Notification n = notifications[0]; Assert.AreEqual(n.model.type, model.type); Assert.AreEqual(n.model.message, model.message); Assert.AreEqual(n.model.timer, model.timer); Assert.AreEqual(n.model.scene, model.scene); }
public IEnumerator NotificationHud_ShowSeveralNotifications() { var controller = new NotificationHUDController(); Notification.Model model = new Notification.Model() { type = NotificationFactory.Type.GENERIC, message = "text", timer = -1, scene = "" }; controller.ShowNotification(model); Notification.Model model2 = new Notification.Model() { type = NotificationFactory.Type.SCRIPTING_ERROR, message = "text", timer = -1, scene = "" }; controller.ShowNotification(model2); yield return(null); Notification[] notifications = GameObject.FindObjectsOfType <Notification>(); Assert.AreEqual(2, notifications.Length); }
protected override IEnumerator SetUp() { yield return(base.SetUp()); controller = new NotificationHUDController(); sceneInitialized = false; }
public void NotificationHud_ModelDefaulted() { var controller = new NotificationHUDController(); Assert.IsNotNull(controller.model); Assert.IsNotNull(controller.model.notifications); Assert.AreEqual(controller.model.notifications.Count, 0); }
public void NotificationHud_Creation() { var controller = new NotificationHUDController(); var views = GameObject.FindObjectsOfType <NotificationHUDView>(); Assert.AreEqual(1, views.Length); var view = views[0]; Assert.NotNull(view); Assert.AreEqual(view, controller.view); }
public void Initialize(NotificationHUDController controller) { this.controller = controller; }
public void Initialize(NotificationHUDController controller) { this.controller = controller; allowNotifications = true; }
public virtual IHUD CreateHUD(HUDElementID hudElementId) { IHUD hudElement = null; switch (hudElementId) { case HUDElementID.NONE: break; case HUDElementID.MINIMAP: hudElement = new MinimapHUDController(); break; case HUDElementID.PROFILE_HUD: hudElement = new ProfileHUDController(); break; case HUDElementID.NOTIFICATION: hudElement = new NotificationHUDController(); break; case HUDElementID.AVATAR_EDITOR: hudElement = new AvatarEditorHUDController(); break; case HUDElementID.SETTINGS_PANEL: hudElement = new SettingsPanelHUDController(); break; case HUDElementID.EXPRESSIONS: hudElement = new ExpressionsHUDController(); break; case HUDElementID.PLAYER_INFO_CARD: hudElement = new PlayerInfoCardHUDController(); break; case HUDElementID.AIRDROPPING: hudElement = new AirdroppingHUDController(); break; case HUDElementID.TERMS_OF_SERVICE: hudElement = new TermsOfServiceHUDController(); break; case HUDElementID.WORLD_CHAT_WINDOW: hudElement = new WorldChatWindowHUDController(); break; case HUDElementID.FRIENDS: hudElement = new FriendsHUDController(); break; case HUDElementID.PRIVATE_CHAT_WINDOW: hudElement = new PrivateChatWindowHUDController(); break; case HUDElementID.TASKBAR: hudElement = new TaskbarHUDController(); break; case HUDElementID.MESSAGE_OF_THE_DAY: hudElement = new WelcomeHUDController(); break; case HUDElementID.OPEN_EXTERNAL_URL_PROMPT: hudElement = new ExternalUrlPromptHUDController(); break; case HUDElementID.NFT_INFO_DIALOG: hudElement = new NFTPromptHUDController(); break; case HUDElementID.TELEPORT_DIALOG: hudElement = new TeleportPromptHUDController(); break; case HUDElementID.CONTROLS_HUD: hudElement = new ControlsHUDController(); break; case HUDElementID.EXPLORE_HUD: hudElement = new ExploreHUDController(); break; case HUDElementID.HELP_AND_SUPPORT_HUD: hudElement = new HelpAndSupportHUDController(); break; case HUDElementID.USERS_AROUND_LIST_HUD: hudElement = new UsersAroundListHUDController(); break; case HUDElementID.GRAPHIC_CARD_WARNING: hudElement = new GraphicCardWarningHUDController(); break; case HUDElementID.BUILDER_IN_WORLD_MAIN: hudElement = new BuildModeHUDController(); break; case HUDElementID.QUESTS_PANEL: hudElement = new QuestsPanelHUDController(); break; case HUDElementID.QUESTS_TRACKER: hudElement = new QuestsTrackerHUDController(); break; case HUDElementID.SIGNUP: hudElement = new SignupHUDController(); break; case HUDElementID.BUILDER_PROJECTS_PANEL: hudElement = new BuilderProjectsPanelController(); break; case HUDElementID.LOADING: hudElement = new LoadingHUDController(); break; case HUDElementID.AVATAR_NAMES: hudElement = new AvatarNamesHUDController(); break; } return(hudElement); }