24 lines
884 B
C#
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);
|
|
}
|
|
}
|
|
}
|