Class ProjectileAsset
- Namespace
- TDMaker.Unity.Authoring
- Assembly
- TDMaker.Unity.dll
Projectile travel and presentation data shared by ranged attacks.
[CreateAssetMenu(menuName = "2D Tower Defense Maker/Projectile", fileName = "Projectile", order = 14)]
public sealed class ProjectileAsset : ScriptableObject
- Inheritance
-
ObjectScriptableObjectProjectileAsset
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Constructors
ProjectileAsset()
public ProjectileAsset()
Fields
arcHeight
Visual arc height for ballistic shots.
[Min(0)]
public float arcHeight
Field Value
beamWidth
Width of the beam drawn for instant hits.
[Min(0)]
public float beamWidth
Field Value
color
Fallback tint.
public Color color
Field Value
- Color
flightTime
Fixed flight time; zero uses distance divided by speed.
[Min(0)]
public float flightTime
Field Value
hitRadius
Distance at which a fixed-aim single-target shot still hits a moving target.
[Min(0)]
public float hitRadius
Field Value
impactArea
Optional region created once where the projectile arrives (also on empty ground); may be pulse-only.
public AreaEffectData impactArea
Field Value
impactCue
Played on impact.
public AudioCue impactCue
Field Value
impactFxSize
Diameter of the impact flash; zero disables it.
[Min(0)]
public float impactFxSize
Field Value
impactVfx
Pooled VFX spawned at the impact point.
public GameObject impactVfx
Field Value
- GameObject
kind
Travel model.
public ProjectileKind kind
Field Value
launchCue
Played when the shot is fired.
public AudioCue launchCue
Field Value
launchVfx
Pooled VFX spawned at the muzzle when the shot is fired.
[Header("Hooks (optional)")]
public GameObject launchVfx
Field Value
- GameObject
lifetime
Seconds before an unresolved projectile expires.
[Min(0.01)]
public float lifetime
Field Value
prefab
Optional prefab; otherwise a primitive sprite is generated.
[Header("View")]
public GameObject prefab
Field Value
- GameObject
shaded
Generated sprite uses the outlined, shaded style.
public bool shaded
Field Value
shape
Fallback primitive shape.
public PrimitiveShape shape
Field Value
size
Fallback size in world units.
[Min(0.01)]
public float size
Field Value
speed
Speed in world units per second.
[Min(0.01)]
public float speed
Field Value
splashRing
Show an expanding ring matching the damage radius on impact (area shots only).
public bool splashRing
Field Value
trailTime
Seconds a trail lingers behind the projectile; zero disables the trail.
[Min(0)]
public float trailTime
Field Value
trailWidth
Trail width at the projectile, in world units.
[Min(0)]
public float trailWidth
Field Value
viewKey
View lookup key; blank uses the asset name.
public string viewKey
Field Value
Properties
ViewKey
The resolved view key.
public string ViewKey { get; }
Property Value
Methods
ToDef()
Bakes the immutable projectile definition.
public ProjectileDef ToDef()