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
Object
ScriptableObject
ProjectileAsset
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.name
Object.hideFlags

Constructors

ProjectileAsset()

public ProjectileAsset()

Fields

arcHeight

Visual arc height for ballistic shots.

[Min(0)]
public float arcHeight

Field Value

float

beamWidth

Width of the beam drawn for instant hits.

[Min(0)]
public float beamWidth

Field Value

float

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

float

hitRadius

Distance at which a fixed-aim single-target shot still hits a moving target.

[Min(0)]
public float hitRadius

Field Value

float

impactArea

Optional region created once where the projectile arrives (also on empty ground); may be pulse-only.

public AreaEffectData impactArea

Field Value

AreaEffectData

impactCue

Played on impact.

public AudioCue impactCue

Field Value

AudioCue

impactFxSize

Diameter of the impact flash; zero disables it.

[Min(0)]
public float impactFxSize

Field Value

float

impactVfx

Pooled VFX spawned at the impact point.

public GameObject impactVfx

Field Value

GameObject

kind

Travel model.

public ProjectileKind kind

Field Value

ProjectileKind

launchCue

Played when the shot is fired.

public AudioCue launchCue

Field Value

AudioCue

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

float

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

bool

shape

Fallback primitive shape.

public PrimitiveShape shape

Field Value

PrimitiveShape

size

Fallback size in world units.

[Min(0.01)]
public float size

Field Value

float

speed

Speed in world units per second.

[Min(0.01)]
public float speed

Field Value

float

splashRing

Show an expanding ring matching the damage radius on impact (area shots only).

public bool splashRing

Field Value

bool

trailTime

Seconds a trail lingers behind the projectile; zero disables the trail.

[Min(0)]
public float trailTime

Field Value

float

trailWidth

Trail width at the projectile, in world units.

[Min(0)]
public float trailWidth

Field Value

float

viewKey

View lookup key; blank uses the asset name.

public string viewKey

Field Value

string

Properties

ViewKey

The resolved view key.

public string ViewKey { get; }

Property Value

string

Methods

ToDef()

Bakes the immutable projectile definition.

public ProjectileDef ToDef()

Returns

ProjectileDef