Unity/Csharp/Dialog
提供: 初心者エンジニアの簡易メモ
Comfirmダイアログを作成
- Ui/Panelを追加
- 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); }