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
Name | Description | |
---|---|---|
![]() | UxrShotDescriptor |
Properties
Name | Description | |
---|---|---|
![]() | CollisionLayerMask | The layer mask used to determine which objects can be hit. |
![]() | CreateDecalLayerMask | The layer mask used to determine if an impact will generate a decal. |
![]() | DecalFadeoutDuration | Duration of the fadeout effect before a PrefabScenarioImpactDecal is destroyed. |
![]() | PrefabInstantiateOnImpact | An optional prefab to instantiate at the point of impact. |
![]() | PrefabInstantiateOnImpactLife | Life in seconds after which PrefabInstantiateOnImpact will be destroyed. |
![]() | PrefabInstantiateOnTipLife | Life in seconds of PrefabInstantiateOnTipWhenShot after which it will be destroyed. |
![]() | PrefabInstantiateOnTipParent | Whether PrefabInstantiateOnTipWhenShot will be parented to the Tip after being instantiated or will remain unparented. |
![]() | PrefabInstantiateOnTipWhenShot | An optional prefab that will be instantiated on the Tip each time a round is fired. |
![]() | PrefabScenarioImpactDecal | Default decal that will be used when the projectile impacted with something. Can be overriden using the UxrOverrideImpactDecal component. |
![]() | PrefabScenarioImpactDecalLife | Life in seconds after which PrefabScenarioImpactDecal will fadeout and be destroyed. |
![]() | ProjectileDamageFar | 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. |
![]() | ProjectileDamageNear | 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. |
![]() | ProjectileImpactForceMultiplier | The force multiplier applied to a rigidbody that was hit by a projectile. The total force applied will be speed * ForceMultiplier. |
![]() | ProjectileLength | The physical length of the projectile, used in ray-casting computations. |
![]() | ProjectileMaxDistance | Maximum reach of the projectile, after which it will be destroyed. |
![]() | ProjectilePrefab | Prefab that will be instantiated as the projectile. |
![]() | ProjectileSpeed | Speed at which the projectile will move. |
![]() | ShotAnimationVarName | Optional Animator trigger variable name that will be triggered on the weapon each time a round is fired. |
![]() | ShotSource | Gets the Transform that is used to fire projectiles from, using the forward vector as direction. |
![]() | Tip | Gets the Transform that is used to instantiate effects on the tip when a shot was fired, using PrefabInstantiateOnTipWhenShot. |
![]() | UseAutomaticProjectileTrajectory | Gets whether the projectiles fired should be updated automatically to compute their trajectory or they will be updated manually. |
Extension Methods
Name | Description | |
---|---|---|
![]() | ThrowIfNull | Throws an exception if the object is null. (Defined by ObjectExt.) |