ArrowFlightSettings
A class in Root.Township, the global namespace.
ScriptableObject for how arrows wobble in flight: a deviance curve over time, scaled by speed, arrow weight and flight modifiers. Also draws a debug flight path.
- Listed in Global namespace: A to B
- Inherits or implements
ScriptableObject - Attributes
CreateAssetMenu
Constructors
| Member | What it is |
|---|---|
ArrowFlightSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
9 private and internal fields
Methods
4 private and internal methods
| Member | What it is |
|---|---|
internal void DrawGizmos(int randomSeed, Transform arrowTransform, Transform tipTransform) | Editor: draws a simulated flight path from the arrow tip for the given seed. |
private float GetDeviance(IEnumerable<ArrowFlightSettingsModifier> modifiers) | devianceMultiplier times the deviance multiplier of every flight modifier. |
internal Vector3 GetVelocity(Vector3 currentVelocity, float flightTime, float flightSpeed, float materialWeightModifier, IEnumerable<ArrowFlightSettingsModifier> modifiers = null) | Returns the next velocity: the current direction turned toward a random rotation by the curve's deviance, at the given speed. |
private void OnValidate() | Updates simulationLength from the iteration count. |
Used in
Members of other types that take, return or hold a ArrowFlightSettings: