pooper_minigame (#62)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Reviewed-on: #62
This commit is contained in:
33
Assets/Scripts/Interactions/BoosterGlowEffect.cs
Normal file
33
Assets/Scripts/Interactions/BoosterGlowEffect.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple glow effect component for booster pack pickups.
|
||||
/// Attach to a GameObject with a SpriteRenderer for basic glow visual.
|
||||
/// The BoosterPackPickup will handle the scale animation.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(SpriteRenderer))]
|
||||
public class BoosterGlowEffect : MonoBehaviour
|
||||
{
|
||||
[Header("Glow Settings")]
|
||||
[SerializeField] private Color glowColor = Color.yellow;
|
||||
[SerializeField] private float baseAlpha = 0.5f;
|
||||
|
||||
private SpriteRenderer spriteRenderer;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
||||
|
||||
// Apply glow color with alpha
|
||||
Color color = glowColor;
|
||||
color.a = baseAlpha;
|
||||
spriteRenderer.color = color;
|
||||
|
||||
// Set sorting order to be behind the item
|
||||
spriteRenderer.sortingOrder = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user