Advertisement
uurha

Untitled

Apr 19th, 2022
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. public static class CanvasGroupExtension
  2.     {
  3.         public static void SetActive(this CanvasGroup canvasGroup, bool isActive)
  4.         {
  5.             canvasGroup.alpha = isActive ? 1 : 0;
  6.             canvasGroup.interactable = isActive;
  7.             canvasGroup.blocksRaycasts = isActive;
  8.         }
  9.  
  10.         public static bool Interactable(this CanvasGroup[] canvasGroups)
  11.         {
  12.             return canvasGroups != null && canvasGroups.Length > 0 && canvasGroups.All(x => x.interactable);
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement