Bullet Dynamics v1.0.0
Loading...
Searching...
No Matches
BulletDynamics.Weapons.WeaponZeroing Class Reference


Component that allows the weapon to be zeroed to the specified distance.
Use the method SetZeroing(float) to rotate the _affectedTransform to the correct rotation. More...

Public Member Functions

virtual void SetZeroing (float distance)
 Sets the weapon's zeroing based on the BulletData and BulletEnvironmentData of the current Weapon and BulletEnvironment.
 
virtual void SetRotationOfTheAffectedTransform (float rotation)
 Sets the rotation of the _affectedTransform to the rotation .
 

Public Attributes

UnityEvent< float > ZeroingChanged
 Action that is raised when the zeroing changes.
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 

Protected Attributes

Transform _affectedTransform = default
 
float _initialZeroing = 100f
 
Weapon _weapon
 
float _currentZeroing = 0f
 

Properties

float CurrentZeroing [get]
 Current zeroing of the Weapon.
 

Detailed Description


Component that allows the weapon to be zeroed to the specified distance.
Use the method SetZeroing(float) to rotate the _affectedTransform to the correct rotation.

Definition at line 12 of file WeaponZeroing.cs.

Member Function Documentation

◆ Awake()

virtual void BulletDynamics.Weapons.WeaponZeroing.Awake ( )
protectedvirtual

Definition at line 33 of file WeaponZeroing.cs.

◆ SetRotationOfTheAffectedTransform()

virtual void BulletDynamics.Weapons.WeaponZeroing.SetRotationOfTheAffectedTransform ( float rotation)
virtual

Sets the rotation of the _affectedTransform to the rotation .

Parameters
rotationRotation that needs to be set.

Definition at line 77 of file WeaponZeroing.cs.

◆ SetZeroing()

virtual void BulletDynamics.Weapons.WeaponZeroing.SetZeroing ( float distance)
virtual

Sets the weapon's zeroing based on the BulletData and BulletEnvironmentData of the current Weapon and BulletEnvironment.

Parameters
distance

Definition at line 47 of file WeaponZeroing.cs.

◆ Start()

virtual void BulletDynamics.Weapons.WeaponZeroing.Start ( )
protectedvirtual

Definition at line 38 of file WeaponZeroing.cs.

Member Data Documentation

◆ _affectedTransform

Transform BulletDynamics.Weapons.WeaponZeroing._affectedTransform = default
protected

Definition at line 16 of file WeaponZeroing.cs.

◆ _currentZeroing

float BulletDynamics.Weapons.WeaponZeroing._currentZeroing = 0f
protected

Definition at line 21 of file WeaponZeroing.cs.

◆ _initialZeroing

float BulletDynamics.Weapons.WeaponZeroing._initialZeroing = 100f
protected

Definition at line 18 of file WeaponZeroing.cs.

◆ _weapon

Weapon BulletDynamics.Weapons.WeaponZeroing._weapon
protected

Definition at line 20 of file WeaponZeroing.cs.

◆ ZeroingChanged

UnityEvent<float> BulletDynamics.Weapons.WeaponZeroing.ZeroingChanged

Action that is raised when the zeroing changes.

Definition at line 31 of file WeaponZeroing.cs.

Property Documentation

◆ CurrentZeroing

float BulletDynamics.Weapons.WeaponZeroing.CurrentZeroing
get

Current zeroing of the Weapon.

Definition at line 26 of file WeaponZeroing.cs.