Files
megakoop/Game/Scripts/Vfx/ProjectileImpactVfxSettings.cs
2025-10-26 14:17:31 +01:00

24 lines
884 B
C#

using UnityEngine;
namespace MegaKoop.Game.Vfx
{
[CreateAssetMenu(fileName = "ProjectileImpactVfxSettings", menuName = "MegaKoop/VFX/Projectile Impact Settings")]
public class ProjectileImpactVfxSettings : ScriptableObject
{
public const string ResourcePath = "ProjectileImpactVfxSettings";
[SerializeField] private GameObject heroImpactPrefab;
[SerializeField] private GameObject enemyImpactPrefab;
[SerializeField] private float fallbackLifetime = 4f;
public GameObject HeroImpactPrefab => heroImpactPrefab;
public GameObject EnemyImpactPrefab => enemyImpactPrefab;
public float FallbackLifetime => Mathf.Max(0.5f, fallbackLifetime);
public static ProjectileImpactVfxSettings LoadFromResources()
{
return Resources.Load<ProjectileImpactVfxSettings>(ResourcePath);
}
}
}