public void SetContent(Item m, int amount, CombinationController combinationController, System.Action resetAction) { ItemType type = m.GetItemType(); int id = m.GetId(); image.sprite = Resources.Load <Sprite>("Image/" + type.ToString() + id) as Sprite; name.text = m.GetName(); this.amount.text = amount.ToString(); this.combinationController = combinationController; button.onClick.AddListener(() => { combinationController.setItemId(id); string title = "확인"; string message = m.GetName(); AlertViewController2.Show(title, message, new AlertViewOptions2 { cancelButtonTitle = "취소", itemType = type, combinationButtonDelegate = () => { combinationController.combination(); resetAction(); }, decombinationButtonDelegate = () => { combinationController.decombination(); resetAction(); }, CombinationController = combinationController }); }); }
// 알임 뷰를 표시하는 static 메서드 public static AlertViewController2 Show( string title, string message, AlertViewOptions2 options = null) { if (prefab == null) { // 프리팹을 읽어 들인다. prefab = Resources.Load("AlertView2") as GameObject; } GameObject go = Instantiate(prefab) as GameObject; AlertViewController2 alertView = go.GetComponent <AlertViewController2>(); alertView.UpadateContent(title, message, options); return(alertView); }