UxrShotDescriptor Class

Class describing all the information of a type of projectile that a GameObject having a UxrProjectileSource component can shoot. Normally there will be a UxrFirearmWeapon with a UxrProjectileSource component supporting one or more UxrShotDescriptor. For example, a rifle with a grenade launcher attachment will be able to fire two types of projectiles: bullets and explosive grenades. UxrProjectileSource components, however, do not require to be part of a UxrFirearmWeapon and can be used on their own.

Inheritance Hierarchy

System.Object
  UltimateXR.Mechanics.Weapons.UxrShotDescriptor
Namespace: UltimateXR.Mechanics.Weapons
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

[SerializableAttribute]
public class UxrShotDescriptor


The UxrShotDescriptor type exposes the following members.

Constructors

NameDescription
Public methodUxrShotDescriptor

Properties

NameDescription
Public propertyCollisionLayerMask The layer mask used to determine which objects can be hit.
Public propertyCreateDecalLayerMask The layer mask used to determine if an impact will generate a decal.
Public propertyDecalFadeoutDuration Duration of the fadeout effect before a PrefabScenarioImpactDecal is destroyed.
Public propertyPrefabInstantiateOnImpact An optional prefab to instantiate at the point of impact.
Public propertyPrefabInstantiateOnImpactLife Life in seconds after which PrefabInstantiateOnImpact will be destroyed.
Public propertyPrefabInstantiateOnTipLife Life in seconds of PrefabInstantiateOnTipWhenShot after which it will be destroyed.
Public propertyPrefabInstantiateOnTipParent Whether PrefabInstantiateOnTipWhenShot will be parented to the Tip after being instantiated or will remain unparented.
Public propertyPrefabInstantiateOnTipWhenShot An optional prefab that will be instantiated on the Tip each time a round is fired.
Public propertyPrefabScenarioImpactDecal Default decal that will be used when the projectile impacted with something. Can be overriden using the UxrOverrideImpactDecal component.
Public propertyPrefabScenarioImpactDecalLife Life in seconds after which PrefabScenarioImpactDecal will fadeout and be destroyed.
Public propertyProjectileDamageFar The damage a projectile will do if it were to hit at the farthest distance. Damage will linearly decrease over distance from the start down to ProjectileDamageFar until the projectile reaches _projectileMaxDistance.
Public propertyProjectileDamageNear The damage a projectile will do if it were to hit at the closest distance. Damage will linearly decrease over distance down to ProjectileDamageFar until the projectile reaches _projectileMaxDistance.
Public propertyProjectileImpactForceMultiplier The force multiplier applied to a rigidbody that was hit by a projectile. The total force applied will be speed * ForceMultiplier.
Public propertyProjectileLength The physical length of the projectile, used in ray-casting computations.
Public propertyProjectileMaxDistance Maximum reach of the projectile, after which it will be destroyed.
Public propertyProjectilePrefab Prefab that will be instantiated as the projectile.
Public propertyProjectileSpeed Speed at which the projectile will move.
Public propertyShotAnimationVarName Optional Animator trigger variable name that will be triggered on the weapon each time a round is fired.
Public propertyShotSource Gets the Transform that is used to fire projectiles from, using the forward vector as direction.
Public propertyTip Gets the Transform that is used to instantiate effects on the tip when a shot was fired, using PrefabInstantiateOnTipWhenShot.
Public propertyUseAutomaticProjectileTrajectory Gets whether the projectiles fired should be updated automatically to compute their trajectory or they will be updated manually.

Extension Methods

NameDescription
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

See Also

Reference

UltimateXR.Mechanics.Weapons Namespace