The main bullet component class for bullets used by the WeaponSystem component.
More...
|
| bool | GetRicochetChance () |
| | Check to determine if a random roll meets the ricochet chance or not.
|
|
| static Vector2 | Reflect (Vector2 vector, Vector2 normal) |
| | This is a basic reflection algorithm (works the same way that Vector3.Reflect() works, but specifically for Vector2.
|
|
| float | speed = 1f |
| | The speed at which the bullet will travel at.
|
| float | amplitude = 0f |
| | Bullet sine wave oscillation amplitude factor, used only if greater than 0f.
|
| SpriteRenderer | bulletSpriteRenderer |
| | The sprite renderer for the bullet - used to modify bullet color when bullets are instantiated if custom color is selected in Weapon Configuration.
|
| float | directionAngle |
| | The direction bullet is travelling in radians.
|
| float | directionDegrees |
| | The direction bullet is travelling in degrees.
|
| Vector3 | newDirection |
| | Used when calculating reflection / ricochet angles when the bullet impacts a collider.
|
| float | bulletXPosition |
| | Used to set bullet travel direction based on directionAngle.
|
| float | bulletYPosition |
| | Used to set bullet travel direction based on directionAngle.
|
| float | ricochetChancePercent |
| | The percent chance this bullet has to ricochet (set from the Weapon configuration that fired the bullet).
|
| bool | canRichochet |
| | Flag to enable / disable ricochet chance.
|
| bool | useHitEffects |
| | Flag to enable / disable bullet impact effects.
|
| string | bloodEffectTriggerTag |
| | Tag of GameObjects that should generate a 'blood impact' effect if this bullet hits them.
|
| float | frequencyIncrement = 0.05f |
| | Used for sine wave-like movement if amplitude is used.
|
| float | sineX |
| | sinewave-like movement components
|
| float | sineY = 0f |
|
| BulletOwner | bulletOwner [get, set] |
| | Sample enum that allows differentiation of bullets based on whether fired from a 'player' or 'enemy'.
|
The main bullet component class for bullets used by the WeaponSystem component.
◆ BulletOwner
◆ GetRicochetChance()
| bool Bullet.GetRicochetChance |
( |
| ) |
|
Check to determine if a random roll meets the ricochet chance or not.
- Returns
◆ Reflect()
| Vector2 Bullet.Reflect |
( |
Vector2 | vector, |
|
|
Vector2 | normal ) |
|
static |
This is a basic reflection algorithm (works the same way that Vector3.Reflect() works, but specifically for Vector2.
Not currently used.
- Parameters
-
- Returns
◆ amplitude
| float Bullet.amplitude = 0f |
Bullet sine wave oscillation amplitude factor, used only if greater than 0f.
◆ bloodEffectTriggerTag
| string Bullet.bloodEffectTriggerTag |
Tag of GameObjects that should generate a 'blood impact' effect if this bullet hits them.
For example if you have a subject with tag 'Enemy' and this field is set to 'Enemy', when this bullet hits that subject, as the tags match, a bullet impact effect will be generated. (See demo scenes).
◆ bulletSpriteRenderer
| SpriteRenderer Bullet.bulletSpriteRenderer |
The sprite renderer for the bullet - used to modify bullet color when bullets are instantiated if custom color is selected in Weapon Configuration.
◆ bulletXPosition
| float Bullet.bulletXPosition |
Used to set bullet travel direction based on directionAngle.
◆ bulletYPosition
| float Bullet.bulletYPosition |
Used to set bullet travel direction based on directionAngle.
◆ canRichochet
Flag to enable / disable ricochet chance.
◆ directionAngle
| float Bullet.directionAngle |
The direction bullet is travelling in radians.
◆ directionDegrees
| float Bullet.directionDegrees |
The direction bullet is travelling in degrees.
◆ frequencyIncrement
| float Bullet.frequencyIncrement = 0.05f |
Used for sine wave-like movement if amplitude is used.
◆ newDirection
| Vector3 Bullet.newDirection |
Used when calculating reflection / ricochet angles when the bullet impacts a collider.
◆ ricochetChancePercent
| float Bullet.ricochetChancePercent |
The percent chance this bullet has to ricochet (set from the Weapon configuration that fired the bullet).
◆ sineX
sinewave-like movement components
◆ sineY
◆ speed
The speed at which the bullet will travel at.
◆ useHitEffects
| bool Bullet.useHitEffects |
Flag to enable / disable bullet impact effects.
◆ bulletOwner
Sample enum that allows differentiation of bullets based on whether fired from a 'player' or 'enemy'.
The documentation for this class was generated from the following file:
- C:/git/2dshooterweaponsystem/Assets/2DShooterWeaponSystem/Scripts/Bullet.cs