/// <summary>
    /// Initializes a new instance of the <see cref="GJHNotification"/> class.
    /// </summary>
    /// <param name='title'>
    /// The title.
    /// </param>
    /// <param name='description'>
    /// The description. Default empty.
    /// </param>
    /// <param name='icon'>
    /// The icon. Default null.
    /// </param>
    public GJHNotification(string title, string description = "", Texture2D icon = null)
    {
        Title = title;

        if (!string.IsNullOrEmpty(description))
        {
            Description = description;
            Icon        = icon;
            type        = GJHNotificationType.WithIcon;
        }
        else
        {
            type = GJHNotificationType.Simple;
        }

        SetPosition();

        notificationBgStyle          = GJAPIHelper.Skin.FindStyle("NotificationBg") ?? GJAPIHelper.Skin.label;
        notificationTitleStyle       = GJAPIHelper.Skin.FindStyle("NotificationTitle") ?? GJAPIHelper.Skin.label;
        notificationDescriptionStyle = GJAPIHelper.Skin.FindStyle("NotificationDescription") ?? GJAPIHelper.Skin.label;
        smallNotificationTitleStyle  = GJAPIHelper.Skin.FindStyle("SmallNotificationTitle") ?? GJAPIHelper.Skin.label;
    }
Пример #2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="GJHNotification"/> class.
    /// </summary>
    /// <param name='title'>
    /// The title.
    /// </param>
    /// <param name='description'>
    /// The description. Default empty.
    /// </param>
    /// <param name='icon'>
    /// The icon. Default null.
    /// </param>
    public GJHNotification(string title, string description = "", Texture2D icon = null)
    {
        Title = title;

        if (!string.IsNullOrEmpty (description))
        {
            Description = description;
            Icon = icon;
            type = GJHNotificationType.WithIcon;
        }
        else
        {
            type = GJHNotificationType.Simple;
        }

        SetPosition ();

        notificationBgStyle = GJAPIHelper.Skin.FindStyle ("NotificationBg") ?? GJAPIHelper.Skin.label;
        notificationTitleStyle = GJAPIHelper.Skin.FindStyle ("NotificationTitle") ?? GJAPIHelper.Skin.label;
        notificationDescriptionStyle = GJAPIHelper.Skin.FindStyle ("NotificationDescription") ?? GJAPIHelper.Skin.label;
        smallNotificationTitleStyle = GJAPIHelper.Skin.FindStyle ("SmallNotificationTitle") ?? GJAPIHelper.Skin.label;
    }