Esempio n. 1
0
	// 알림 뷰의 내용을 갱신하는 메서드
	public void UpdateContent(
		string title, string message, AlertViewOptions options=null)
	{
		// 타이틀과 메시지를 설정한다
		titleLabel.text = title;
		messageLabel.text = message;
		
		if(options != null)
		{
			// 표시 옵션이 지정돼 있을 때 옵션의 내용에 맞춰 버튼을 표시하거나 표시하지 않는다
			cancelButton.transform.parent.gameObject.SetActive(
				options.cancelButtonTitle != null || options.okButtonTitle != null
			);

			cancelButton.gameObject.SetActive(options.cancelButtonTitle != null);
			cancelButtonLabel.text = options.cancelButtonTitle ?? "";
			cancelButtonDelegate = options.cancelButtonDelegate;

			okButton.gameObject.SetActive(options.okButtonTitle != null);
			okButtonLabel.text = options.okButtonTitle ?? "";
			okButtonDelegate = options.okButtonDelegate;
		}
		else
		{
			// 표시 옵션이 지정돼 있지 않을 때 기본 버튼을 표시한다
			cancelButton.gameObject.SetActive(false);
			okButton.gameObject.SetActive(true);
			okButtonLabel.text = "OK";
		}
	}
Esempio n. 2
0
    // アラートビューの内容を更新するメソッド
    public void UpdateContent(
		string title, string message, AlertViewOptions options=null)
    {
        // タイトルとメッセージを設定する
        titleLabel.text = title;
        messageLabel.text = message;

        if(options != null)
        {
            // 表示オプションが指定されている場合、オプションの内容に合わせてボタンを表示/非表示する
            cancelButton.transform.parent.gameObject.SetActive(
                options.cancelButtonTitle != null || options.okButtonTitle != null
            );

            cancelButton.gameObject.SetActive(options.cancelButtonTitle != null);
            cancelButtonLabel.text = options.cancelButtonTitle ?? "";
            cancelButtonDelegate = options.cancelButtonDelegate;

            okButton.gameObject.SetActive(options.okButtonTitle != null);
            okButtonLabel.text = options.okButtonTitle ?? "";
            okButtonDelegate = options.okButtonDelegate;
        }
        else
        {
            // 表示オプションが指定されていない場合、デフォルトのボタン表示にする
            cancelButton.gameObject.SetActive(false);
            okButton.gameObject.SetActive(true);
            okButtonLabel.text = "OK";
        }
    }
    //알림 뷰의 내용을 갱신하는 메서드
    public void UpdateContent(string title, string message, AlertViewOptions options = null)
    {
        if (title.Equals(""))
        {
            titleLabel.transform.gameObject.SetActive(false);
        }
        else
        {
            titleLabel.text = title;
        }
        messageLabel.text = message;

        if (options != null)
        {
            //표시 옵션이 지정돼 있을 때 옵션의 내용에 맞춰 버튼을 표시하거나 표시하지 않는다.
            cancelButton.transform.parent.gameObject.SetActive(options.cancelButtonTitle != null || options.okButtonTitle != null);
            cancelButton.gameObject.SetActive(options.cancelButtonTitle != null);
            cancelButtonLabel.text = options.cancelButtonTitle ?? "";
            cancelButtonDelegate   = options.cancelButtonDelegate;

            okButton.gameObject.SetActive(options.okButtonTitle != null);
            okButtonLabel.text = options.okButtonTitle ?? "";
            okButtonDelegate   = options.okButtonDelegate;
        }
        else
        {
            cancelButton.gameObject.SetActive(false);
            okButton.gameObject.SetActive(true);
            okButtonLabel.text = "확인";
        }
    }
Esempio n. 4
0
    public static AlertViewController Show(string title, string message, AlertViewOptions options = null)
    {
        if (prefab == null)
        {
            prefab = Resources.Load("Alert View") as GameObject;
        }
        GameObject          obj       = Instantiate(prefab) as GameObject;
        AlertViewController alertView = obj.GetComponent <AlertViewController>();

        alertView.UpdateContent(title, message, options);
        return(alertView);
    }
Esempio n. 5
0
    Text titleLabel; // タイトルを表示するテキスト

    #endregion Fields

    #region Methods

    // 実行されるデリゲートを保持
    // アラートビューを表示するstaticメソッド
    public static AlertViewController Show(
		string title, string message, AlertViewOptions options=null)
    {
        if(prefab == null)
        {
            // プレハブを読み込む
            prefab = Resources.Load("Alert View") as GameObject;
        }

        // プレハブをインスタンス化してアラートビューを表示する
        GameObject obj = Instantiate(prefab) as GameObject;
        AlertViewController alertView = obj.GetComponent<AlertViewController>();
        alertView.UpdateContent(title, message, options);

        return alertView;
    }
    // 읽어 들인 내용을 갱신하는 메서드
    public void UpadateContent(
        string title, string message, AlertViewOptions options = null)
    {
        //타이틀과 메시지를 설정
        titleLabel.text   = title;
        messageLabel.text = message;

        if (options != null)
        {
            cancelButton.gameObject.SetActive(true);
            cancelButtonDelegate = options.cancelButtonDelegate;
            okButton.gameObject.SetActive(true);
            okButtonDelegate = options.okButtonDelegate;
        }

        else
        {
            // 표시 옵션이 지정된 경우 기본 버튼을 표시한다.
            cancelButton.gameObject.SetActive(true);
            okButton.gameObject.SetActive(false);
        }
    }
Esempio n. 7
0
    public void UpdateContent(string title, string message, AlertViewOptions options = null)
    {
        titleLabel.text   = title;
        messageLabel.text = message;

        if (options != null)
        {
            cancelButton.transform.parent.gameObject.SetActive(options.cancelButtonTitle != null || options.okButtonTitle != null);
            cancelButton.gameObject.SetActive(options.cancelButtonTitle != null);
            cancelButtonLabel.text = options.cancelButtonTitle ?? "";
            cancelButtonDelegate   = options.cancelButtonDelegate;

            okButton.gameObject.SetActive(options.okButtonTitle != null);
            okButtonLabel.text = options.okButtonTitle ?? "";
            okButtonDelegate   = options.okButtonDelegate;
        }
        else
        {
            cancelButton.gameObject.SetActive(false);
            okButton.gameObject.SetActive(true);
            okButtonLabel.text = "OK";
        }
    }