Пример #1
0
 /// <summary>
 /// Update the text of a specified button on the message box display.
 /// </summary>
 /// <param name="btn">The message box button to affect</param>
 /// <param name="newText">The text to set to this button</param>
 public void UpdateButtonText(MessageBoxCustomButtons btn, string newText)
 {
     if (btn == MessageBoxCustomButtons.Button1)
     {
         if (btnCustom1.gameObject.activeSelf)
         {
             btnCustom1.gameObject.transform.GetChild(0).GetComponent <Text>().text = newText;
         }
     }
     else if (btn == MessageBoxCustomButtons.Button2)
     {
         if (btnCustom2.gameObject.activeSelf)
         {
             btnCustom2.gameObject.transform.GetChild(0).GetComponent <Text>().text = newText;
         }
     }
     else if (btn == MessageBoxCustomButtons.Button3)
     {
         if (btnCustom3.gameObject.activeSelf)
         {
             btnCustom3.gameObject.transform.GetChild(0).GetComponent <Text>().text = newText;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Set the lock state of a specified button on the message box display.
 /// </summary>
 /// <param name="btn">The message box button to affect</param>
 /// <param name="lockButton">Should this button be locked/unclickable or unlocked/clickable</param>
 public void LockButtonInteraction(MessageBoxCustomButtons btn, bool lockButton = true)
 {
     if (btn == MessageBoxCustomButtons.Button1)
     {
         if (btnCustom1.gameObject.activeSelf)
         {
             btnCustom1.interactable = !lockButton;
         }
     }
     else if (btn == MessageBoxCustomButtons.Button2)
     {
         if (btnCustom2.gameObject.activeSelf)
         {
             btnCustom2.interactable = !lockButton;
         }
     }
     else if (btn == MessageBoxCustomButtons.Button3)
     {
         if (btnCustom3.gameObject.activeSelf)
         {
             btnCustom3.interactable = !lockButton;
         }
     }
 }