public void OnAlertFromLeftButtonClicked()
    {
        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize("Example with a dialog animation that comes from the left", null, "OK", "Alert!", MaterialIconHelper.GetRandomIcon(), null, null);
        dialog.dialogAnimator = new DialogAnimatorSlide(0.5f, DialogAnimatorSlide.SlideDirection.Left, DialogAnimatorSlide.SlideDirection.Right);
        dialog.Show();
    }
Ejemplo n.º 2
0
    public void OnAlertFromLeftButtonClicked()
    {
        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize("Example with a dialog animation that comes from the left", null, "OK", "Alert!", MaterialIconHelper.GetRandomIcon(), null, null);

        var oldAnimator = dialog.GetComponent <AbstractTweenBehaviour>() as Component;

        if (oldAnimator != null)
        {
            Object.DestroyImmediate(oldAnimator);
        }

        var animator = dialog.gameObject.AddComponent <EasyFrameAnimator>();

        animator.slideIn           = true;
        animator.slideInDirection  = ScreenView.SlideDirection.Left;
        animator.slideOut          = true;
        animator.slideOutDirection = ScreenView.SlideDirection.Left;

        dialog.Show();
    }
Ejemplo n.º 3
0
    static public DialogAlert ShowDialog(string text, Action yesAction, string yesText, Action cancelAction, string cancelText)
    {
        if (dialogAlert != null)
        {
            dialogAlert.Hide();
        }

        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize(text, yesAction, yesText, null, null, cancelAction, cancelText);

        var animator = new DialogAnimatorSlide(0.2f, DialogAnimatorSlide.SlideDirection.Left, DialogAnimatorSlide.SlideDirection.Right);

        animator.backgroundAlpha = 0f;

        dialog.dialogAnimator = animator;
        dialog.ShowModal();

        // 保证单实例
        dialogAlert = dialog;

        return(dialogAlert);
    }