Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using UnityEngine;
using System.Collections;
namespace MoreMountains.Tools
{
/// <summary>
/// Image helpers
/// </summary>
public class MMImage : MonoBehaviour
{
/// <summary>
/// Coroutine used to make the character's sprite flicker (when hurt for example).
/// </summary>
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<flickerStop)
{
renderer.material.color = flickerColor;
yield return MMCoroutine.WaitFor(flickerSpeed);
renderer.material.color = initialColor;
yield return MMCoroutine.WaitFor(flickerSpeed);
}
renderer.material.color = initialColor;
}
}
}