Last active
February 13, 2020 19:35
-
-
Save kleberandrade/5d0a8d0900833d779c5f332899b6f40f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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