Example #1
0
    public override void OnOpen(Intent intent)
    {
        base.OnOpen(intent);
        string titleStr    = intent.Value <string>("title");
        string contentStr  = intent.Value <string>("content");
        string positiveStr = intent.Value <string>("positiveStr");
        string negativeStr = intent.Value <string>("negativeStr");

        positive = intent.Value <AlertWindowClick>("positive");
        negative = intent.Value <AlertWindowClick>("negative");
        int mode = intent.Value <int>("mode");

        autoClose  = intent.Value <bool>("autoClose");
        title.text = titleStr;
        //content.text = "";
        content.text        = contentStr;
        positiveLabel0.text = positiveStr;
        positiveLabel.text  = positiveStr;
        negativeLabel.text  = negativeStr;
        OneButtonMode.SetActive(false);
        TwoButtonMode.SetActive(false);
        switch ((AlertWindowMode)mode)
        {
        case AlertWindowMode.OneButton:
            OneButtonMode.SetActive(true);
            break;

        case AlertWindowMode.TwoButton:
            TwoButtonMode.SetActive(true);
            break;
        }
        tween.ResetToBeginning();
        tween.PlayForward();
    }
 public static void OpenAlert(string title, string content, string positiveString, AlertWindowClick positive, bool autoClose = true)
 {
     OpenAlert(title, content, positiveString, positive, "", null, AlertWindowMode.OneButton, autoClose);
 }
 public static void OpenAlert(string title, string content, string positiveString, AlertWindowClick positive, string negativeString, AlertWindowClick negative, bool autoClose = true)
 {
     OpenAlert(title, content, positiveString, positive, negativeString, negative, AlertWindowMode.TwoButton, autoClose);
 }
        public static void OpenAlert(string title, string content, string positiveString, AlertWindowClick positive, string negativeString, AlertWindowClick negative, AlertWindowMode mode, bool autoClose = true)
        {
            Intent intent = new Intent();

            intent.Push("title", title);
            intent.Push("content", content);
            intent.Push("positiveStr", positiveString);
            intent.Push("negativeStr", negativeString);
            intent.Push("positive", positive);
            intent.Push("negative", negative);
            intent.Push("mode", mode);
            intent.Push("autoClose", autoClose);
            App.Manager.UI.OpenView("UIAlertWindow", intent);
        }