/// <summary> /// Unregister an active box (Used internally). /// </summary> /// <param name="box"></param> public void UnregisterActiveBox(UIModalBox box) { if (this.m_ActiveBoxes.Contains(box)) { this.m_ActiveBoxes.Remove(box); } }
/// <summary> /// Register a box as active (Used internally). /// </summary> /// <param name="box"></param> public void RegisterActiveBox(UIModalBox box) { if (!this.m_ActiveBoxes.Contains(box)) { this.m_ActiveBoxes.Add(box); } }
public void CreateAndShow() { UIModalBox box = UIModalBoxManager.Instance.Create(this.gameObject); box.SetText1(this.m_Text1); box.SetText2(this.m_Text2); box.SetConfirmButtonText(this.m_ConfirmText); box.SetCancelButtonText(this.m_CancelText); box.onConfirm.AddListener(OnConfirm); box.onCancel.AddListener(OnCancel); box.Show(); }
/// <summary> /// Event invoked when when a character delete button is pressed. /// </summary> /// <param name="character">The character.</param> private void OnCharacterDeleteRequested(Demo_CharacterSelectList_Character character) { // Save the deleting character reference this.m_DeletingCharacter = character; // Create a modal box UIModalBox box = UIModalBoxManager.Instance.Create(this.gameObject); if (box != null) { box.SetText1("Do you really want to delete this character?"); box.SetText2("You wont be able to reverse this operation and yourcharcater will be permamently removed."); box.SetConfirmButtonText("DELETE"); //box.SetCancelButtonText(string.Empty); box.onConfirm.AddListener(OnCharacterDeleteConfirm); box.onCancel.AddListener(OnCharacterDeleteCancel); box.Show(); } }
public void CreateAndShow() { if (UIModalBoxManager.Instance == null) { Debug.LogWarning("Could not load the modal box manager while creating a modal box."); return; } UIModalBox box = UIModalBoxManager.Instance.Create(this.gameObject); if (box != null) { box.SetText1(this.m_Text1); box.SetText2(this.m_Text2); box.SetConfirmButtonText(this.m_ConfirmText); box.SetCancelButtonText(this.m_CancelText); box.onConfirm.AddListener(OnConfirm); box.onCancel.AddListener(OnCancel); box.Show(); } }
/// <summary> /// This method is raised when the slot is denied to be thrown away and returned to it's source. /// </summary> protected override void OnThrowAwayDenied() { if (!this.IsAssigned()) { return; } if (UIModalBoxManager.Instance == null) { Debug.LogWarning("Could not load the modal box manager while creating a modal box."); return; } UIModalBox box = UIModalBoxManager.Instance.Create(this.gameObject); if (box != null) { box.SetText1("Do you really want to destroy \"" + this.m_ItemInfo.Name + "\"?"); box.SetText2("You wont be able to reverse this operation and your item will be permamently removed."); box.SetConfirmButtonText("DESTROY"); box.onConfirm.AddListener(Unassign); box.Show(); } }