facebook twitter hatena line email

Unity/Csharp/Dialog

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

Comfirmダイアログを作成

  1. Ui/Panelを追加
  2. Panel内に、Ui/Buttonを2つ追加
void Start() {
        GameObject.Find("ConfirmButton").GetComponent<Button>().onClick.AddListener(OnClickConfirm);
        GameObject.Find("DeleteButton").GetComponent<Button>().onClick.AddListener(OnClickDelete);
        GameObject.Find("CancelButton").GetComponent<Button>().onClick.AddListener(OnClickCancel);
        GameObject.Find("Panel").transform.position = new Vector3(10000, 0, 0);
}
void OnClickConfirm()
{
        GameObject.Find("Panel").transform.position = new Vector3(0, 0, 0);
}
void OnClickDelete()
{
}
void OnClickCancel() {
        GameObject.Find("Panel").transform.position = new Vector3(10000, 0, 0);
}