Exemple #1
0
    public void SpawnNotification()
    {
        NotificationController insertedNotificationController = Instantiate(prefabNotificationController, parentNotifications);

        insertedNotificationController.Init();
        FindObjectOfType <SoundController>().Play("msg1");
        foreach (var notificationController in _notificationsDisplayed)
        {
            notificationController.MoveDown();
        }

        if (_notificationsDisplayed.Count == 0)
        {
            _notificationsDisplayed.Add(insertedNotificationController);
        }
        else
        {
            _notificationsDisplayed.Insert(0, insertedNotificationController);
        }
    }