Skip to content

Instantly share code, notes, and snippets.

@kyubuns
Created October 4, 2018 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyubuns/9862a8b0ea3d891a90c59d4ea4f00d05 to your computer and use it in GitHub Desktop.
Save kyubuns/9862a8b0ea3d891a90c59d4ea4f00d05 to your computer and use it in GitHub Desktop.
public void LateUpdate()
{
if (CachedButton.IsInteractable() == ButtonInteractable) return;
ButtonInteractable = Cache.IsInteractable();
var color = ButtonInteractable ? Cache.colors.normalColor : Cache.colors.disabledColor;
foreach (var graphic in Cache.transform.GetComponentsInChildren<Graphic>())
{
graphic.color = color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment