using UnityEngine;
using System.Collections;
namespace MoreMountains.Tools
{
///
/// Image helpers
///
public class MMImage : MonoBehaviour
{
///
/// Coroutine used to make the character's sprite flicker (when hurt for example).
///
public static IEnumerator Flicker(Renderer renderer, Color initialColor, Color flickerColor, float flickerSpeed, float flickerDuration)
{
if (renderer==null)
{
yield break;
}
if (!renderer.material.HasProperty("_Color"))
{
yield break;
}
if (initialColor == flickerColor)
{
yield break;
}
float flickerStop = Time.time + flickerDuration;
while (Time.time