예제 #1
0
 /// <summary>
 /// Refresh menu item.
 /// </summary>
 /// <param name="data">Data of context menu item, type is ContextMenuItemData.</param>
 /// <returns>Succeed?</returns>
 public override bool Refresh(ContextMenuElementData data)
 {
     if (data is ContextMenuItemData itemData)
     {
         itemText.text       = itemData.name;
         itemTag             = itemData.tag;
         button.interactable = itemData.interactable;
     }
     else
     {
         LogUtility.LogWarning("Refresh menu item failed: The type of info is not ContextMenuItemData.");
         return(false);
     }
     return(true);
 }
예제 #2
0
 /// <summary>
 /// Refresh menu separator.
 /// </summary>
 /// <param name="data">Data of context menu separator, type is ContextMenuSeparatorData.</param>
 /// <returns>Succeed?</returns>
 public override bool Refresh(ContextMenuElementData data)
 {
     return(true);
 }