Gonna move to server authority
This commit is contained in:
31
Assets/FirstGearGames/Scripts/Utilities/Canvases.cs
Normal file
31
Assets/FirstGearGames/Scripts/Utilities/Canvases.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
namespace FirstGearGames.Utilities.Objects
|
||||
{
|
||||
|
||||
|
||||
public static class Canvases
|
||||
{
|
||||
|
||||
/// <returns>Returns true part is within whole.</returns>
|
||||
public static void SetActive(this CanvasGroup group, bool active, bool setAlpha)
|
||||
{
|
||||
if (group == null)
|
||||
return;
|
||||
|
||||
if (setAlpha)
|
||||
{
|
||||
if (active)
|
||||
group.alpha = 1f;
|
||||
else
|
||||
group.alpha = 0f;
|
||||
}
|
||||
|
||||
group.interactable = active;
|
||||
group.blocksRaycasts = active;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user