Skip to content

Instantly share code, notes, and snippets.

@kleberandrade
Last active February 13, 2020 19:35
Show Gist options
  • Save kleberandrade/5d0a8d0900833d779c5f332899b6f40f to your computer and use it in GitHub Desktop.
Save kleberandrade/5d0a8d0900833d779c5f332899b6f40f to your computer and use it in GitHub Desktop.
using UnityEngine;
[RequireComponent(typeof(CanvasGroup))]
public class BlinkUI : MonoBehaviour
{
public float m_SmoothTime = 1.0f;
private CanvasGroup m_CanvasGroup;
private void Awake()
{
m_CanvasGroup = GetComponent<CanvasGroup>();
}
private void Update()
{
m_CanvasGroup.alpha = (Mathf.Sin(Time.time * m_SmoothTime) + 1.0f) * 0.5f;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment