26 lines
892 B
C#
26 lines
892 B
C#
using UnityEngine;
|
|
|
|
[CreateAssetMenu(
|
|
fileName = "RocketItemDefinition",
|
|
menuName = "FORT-BO/Items/Definitions/Rocket")]
|
|
public sealed class RocketItemDefinition : ItemDefinition
|
|
{
|
|
[Tooltip("Stable rocket family id used by launchers and orders.")]
|
|
[SerializeField] private string rocketTypeId;
|
|
[Tooltip("Combat type sent to the map when this rocket is fired.")]
|
|
[SerializeField] private MissileType missileType = MissileType.Standard;
|
|
[SerializeField, Min(0.1f)] private float criticalImpactSpeed = 7f;
|
|
|
|
public string RocketTypeId => string.IsNullOrWhiteSpace(rocketTypeId)
|
|
? ItemId
|
|
: rocketTypeId;
|
|
public MissileType MissileType => missileType;
|
|
public float CriticalImpactSpeed => criticalImpactSpeed;
|
|
|
|
protected override void OnValidate()
|
|
{
|
|
base.OnValidate();
|
|
rocketTypeId = NormalizeId(rocketTypeId);
|
|
}
|
|
}
|