The main bullet component class for bullets used by the WeaponSystem component.
More...
|
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. More...
|
|
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()
static 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
◆ 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.
◆ 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)
◆ 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