コード例 #1
0
 /// <summary>
 /// 简化的调用方法
 /// </summary>
 /// <param name="messageToShow"></param>
 public static void Show(string messageToShow)
 {
     if (ToastManager._ins == null)
     {
         ToastManager.init();
     }
     if (messageToShow == null || messageToShow == string.Empty)
     {
         return;
     }
     ToastManager._ins.popToast(messageToShow, null);
 }
コード例 #2
0
    /// <summary>
    /// 弹出一个Toast或者多个有序Toast
    /// </summary>
    /// <param name="messageToShow">要显示的信息</param>
    /// <param name="callback">当前信息显示完成后的回调</param>
    /// <param name="showType">显示类型</param>
    public static void ShowWithCallback(string messageToShow, TweenCallback callback, ShowType showType)
    {
        if (ToastManager._ins == null)
        {
            ToastManager.init();
        }
        if (messageToShow == null || messageToShow == string.Empty)
        {
            return;
        }

        switch (showType)
        {
        case ShowType.Queue:
            ToastManager._ins.enqueueToast(messageToShow, callback);
            break;

        case ShowType.Upwards:
            ToastManager._ins.popToast(messageToShow, callback);
            break;
        }
    }