Projectile class to be used along with projectile weapons.
More...
|
| virtual void | Movement () |
| | Handles the projectile's movement, every frame.
|
| virtual void | SetDirection (Vector3 newDirection, Quaternion newRotation, bool spawnerIsFacingRight=true) |
| | Sets the projectile's direction.
|
| virtual void | SetWeapon (Weapon newWeapon) |
| | Sets the projectile's parent weapon.
|
| virtual void | SetDamage (float minDamage, float maxDamage) |
| | Sets the damage caused by the projectile's DamageOnTouch to the specified value.
|
| virtual void | SetOwner (GameObject newOwner) |
| | Sets the projectile's owner.
|
| virtual GameObject | GetOwner () |
| | Returns the current Owner of the projectile.
|
| virtual void | StopAt () |
| | On death, disables colliders and prevents movement.
|
| delegate void | Events () |
| virtual void | Destroy () |
| | Turns the instance inactive, in order to eventually reuse it.
|
| virtual void | TriggerOnSpawnComplete () |
| | Triggers the on spawn complete event.
|
| virtual Bounds | GetBounds () |
| | Returns the bounds of the object, based on what has been defined.
|
|
| bool | FaceDirection = true |
| | if true, the projectile will rotate at initialization towards its rotation
|
| bool | FaceMovement = false |
| | if true, the projectile will rotate towards movement
|
| MovementVectors | MovementVector = MovementVectors.Forward |
| | if FaceMovement is true, the projectile's vector specified below will be aligned to the movement vector, usually you'll want to go with Forward in 3D, Right in 2D
|
| float | Speed = 0 |
| | the speed of the object (relative to the level's speed)
|
| float | Acceleration = 0 |
| | the acceleration of the object over time. Starts accelerating on enable.
|
| Vector3 | Direction = Vector3.left |
| | the current direction of the object
|
| bool | DirectionCanBeChangedBySpawner = true |
| | if set to true, the spawner can change the direction of the object. If not the one set in its inspector will be used.
|
| Vector3 | FlipValue = new Vector3(-1,1,1) |
| | the flip factor to apply if and when the projectile is mirrored
|
| bool | ProjectileIsFacingRight = true |
| | set this to true if your projectile's model (or sprite) is facing right, false otherwise
|
| float | InitialInvulnerabilityDuration =0f |
| | the initial delay during which the projectile can't be destroyed
|
| bool | DamageOwner = false |
| | should the projectile damage its owner?
|
| UnityEvent | ExecuteOnEnable |
| UnityEvent | ExecuteOnDisable |
| float | LifeTime = 0f |
| | The life time, in seconds, of the object. If set to 0 it'll live forever, if set to any positive value it'll be set inactive after that time.
|
| WaysToDetermineBounds | BoundsBasedOn |
|
| virtual void | Awake () |
| | On awake, we store the initial speed of the object.
|
| virtual IEnumerator | InitialInvulnerability () |
| | Handles the projectile's initial invincibility.
|
| virtual void | Initialization () |
| | Initializes the projectile.
|
| virtual void | FixedUpdate () |
| | On update(), we move the object based on the level's speed and the object's speed, and apply acceleration.
|
| virtual void | Flip () |
| | Flip the projectile.
|
| virtual void | Flip (bool state) |
| | Flip the projectile.
|
| virtual void | OnDeath () |
| | On death, we stop our projectile.
|
| override void | OnEnable () |
| | On enable, we trigger a short invulnerability.
|
| override void | OnDisable () |
| | On disable, we plug our OnDeath method to the health component.
|
| virtual void | Update () |
| | Called every frame.
|
| virtual void | Reset () |
| | When this component is added we define its bounds.
|
| virtual void | DefineBoundsChoice () |
| | Tries to determine automatically what the bounds should be based on. In this order, it'll keep the last found of these : Collider2D, Collider or Renderer. If none of these is found, it'll be set as Undefined.
|
Projectile class to be used along with projectile weapons.
◆ MovementVectors
| Enumerator |
|---|
| Forward | |
| Right | |
| Up | |
◆ Awake()
| virtual void MoreMountains.TopDownEngine.Projectile.Awake |
( |
| ) |
|
|
protectedvirtual |
On awake, we store the initial speed of the object.
◆ FixedUpdate()
| virtual void MoreMountains.TopDownEngine.Projectile.FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
◆ Flip() [1/2]
| virtual void MoreMountains.TopDownEngine.Projectile.Flip |
( |
| ) |
|
|
protectedvirtual |
◆ Flip() [2/2]
| virtual void MoreMountains.TopDownEngine.Projectile.Flip |
( |
bool | state | ) |
|
|
protectedvirtual |
◆ GetOwner()
| virtual GameObject MoreMountains.TopDownEngine.Projectile.GetOwner |
( |
| ) |
|
|
virtual |
Returns the current Owner of the projectile.
- Returns
◆ InitialInvulnerability()
| virtual IEnumerator MoreMountains.TopDownEngine.Projectile.InitialInvulnerability |
( |
| ) |
|
|
protectedvirtual |
Handles the projectile's initial invincibility.
- Returns
- The invulnerability.
◆ Initialization()
| virtual void MoreMountains.TopDownEngine.Projectile.Initialization |
( |
| ) |
|
|
protectedvirtual |
◆ Movement()
| virtual void MoreMountains.TopDownEngine.Projectile.Movement |
( |
| ) |
|
|
virtual |
◆ OnDeath()
| virtual void MoreMountains.TopDownEngine.Projectile.OnDeath |
( |
| ) |
|
|
protectedvirtual |
On death, we stop our projectile.
◆ OnDisable()
| override void MoreMountains.TopDownEngine.Projectile.OnDisable |
( |
| ) |
|
|
protectedvirtual |
◆ OnEnable()
| override void MoreMountains.TopDownEngine.Projectile.OnEnable |
( |
| ) |
|
|
protectedvirtual |
◆ SetDamage()
| virtual void MoreMountains.TopDownEngine.Projectile.SetDamage |
( |
float | minDamage, |
|
|
float | maxDamage ) |
|
virtual |
Sets the damage caused by the projectile's DamageOnTouch to the specified value.
- Parameters
-
◆ SetDirection()
| virtual void MoreMountains.TopDownEngine.Projectile.SetDirection |
( |
Vector3 | newDirection, |
|
|
Quaternion | newRotation, |
|
|
bool | spawnerIsFacingRight = true ) |
|
virtual |
◆ SetOwner()
| virtual void MoreMountains.TopDownEngine.Projectile.SetOwner |
( |
GameObject | newOwner | ) |
|
|
virtual |
Sets the projectile's owner.
- Parameters
-
◆ SetWeapon()
| virtual void MoreMountains.TopDownEngine.Projectile.SetWeapon |
( |
Weapon | newWeapon | ) |
|
|
virtual |
Sets the projectile's parent weapon.
- Parameters
-
◆ StopAt()
| virtual void MoreMountains.TopDownEngine.Projectile.StopAt |
( |
| ) |
|
|
virtual |
On death, disables colliders and prevents movement.
◆ _collider
| Collider MoreMountains.TopDownEngine.Projectile._collider |
|
protected |
◆ _collider2D
| Collider2D MoreMountains.TopDownEngine.Projectile._collider2D |
|
protected |
◆ _damageOnTouch
| DamageOnTouch MoreMountains.TopDownEngine.Projectile._damageOnTouch |
|
protected |
◆ _facingRightInitially
| bool MoreMountains.TopDownEngine.Projectile._facingRightInitially |
|
protected |
◆ _health
| Health MoreMountains.TopDownEngine.Projectile._health |
|
protected |
◆ _initialFlipX
| bool MoreMountains.TopDownEngine.Projectile._initialFlipX |
|
protected |
◆ _initialInvulnerabilityDurationWFS
| WaitForSeconds MoreMountains.TopDownEngine.Projectile._initialInvulnerabilityDurationWFS |
|
protected |
◆ _initialLocalScale
| Vector3 MoreMountains.TopDownEngine.Projectile._initialLocalScale |
|
protected |
◆ _initialSpeed
| float MoreMountains.TopDownEngine.Projectile._initialSpeed |
|
protected |
◆ _movement
| Vector3 MoreMountains.TopDownEngine.Projectile._movement |
|
protected |
◆ _owner
| GameObject MoreMountains.TopDownEngine.Projectile._owner |
|
protected |
◆ _rigidBody
| Rigidbody MoreMountains.TopDownEngine.Projectile._rigidBody |
|
protected |
◆ _rigidBody2D
| Rigidbody2D MoreMountains.TopDownEngine.Projectile._rigidBody2D |
|
protected |
◆ _shouldMove
| bool MoreMountains.TopDownEngine.Projectile._shouldMove = true |
|
protected |
◆ _spawnerIsFacingRight
| bool MoreMountains.TopDownEngine.Projectile._spawnerIsFacingRight |
|
protected |
◆ _spriteRenderer
| SpriteRenderer MoreMountains.TopDownEngine.Projectile._spriteRenderer |
|
protected |
◆ _weapon
| Weapon MoreMountains.TopDownEngine.Projectile._weapon |
|
protected |
◆ Acceleration
| float MoreMountains.TopDownEngine.Projectile.Acceleration = 0 |
the acceleration of the object over time. Starts accelerating on enable.
◆ DamageOwner
| bool MoreMountains.TopDownEngine.Projectile.DamageOwner = false |
should the projectile damage its owner?
◆ Direction
| Vector3 MoreMountains.TopDownEngine.Projectile.Direction = Vector3.left |
the current direction of the object
◆ DirectionCanBeChangedBySpawner
| bool MoreMountains.TopDownEngine.Projectile.DirectionCanBeChangedBySpawner = true |
if set to true, the spawner can change the direction of the object. If not the one set in its inspector will be used.
◆ FaceDirection
| bool MoreMountains.TopDownEngine.Projectile.FaceDirection = true |
if true, the projectile will rotate at initialization towards its rotation
◆ FaceMovement
| bool MoreMountains.TopDownEngine.Projectile.FaceMovement = false |
if true, the projectile will rotate towards movement
◆ FlipValue
| Vector3 MoreMountains.TopDownEngine.Projectile.FlipValue = new Vector3(-1,1,1) |
the flip factor to apply if and when the projectile is mirrored
◆ InitialInvulnerabilityDuration
| float MoreMountains.TopDownEngine.Projectile.InitialInvulnerabilityDuration =0f |
the initial delay during which the projectile can't be destroyed
◆ MovementVector
if FaceMovement is true, the projectile's vector specified below will be aligned to the movement vector, usually you'll want to go with Forward in 3D, Right in 2D
◆ ProjectileIsFacingRight
| bool MoreMountains.TopDownEngine.Projectile.ProjectileIsFacingRight = true |
set this to true if your projectile's model (or sprite) is facing right, false otherwise
◆ Speed
| float MoreMountains.TopDownEngine.Projectile.Speed = 0 |
the speed of the object (relative to the level's speed)
◆ SourceWeapon
| virtual Weapon MoreMountains.TopDownEngine.Projectile.SourceWeapon |
|
get |
◆ TargetDamageOnTouch
| virtual DamageOnTouch MoreMountains.TopDownEngine.Projectile.TargetDamageOnTouch |
|
get |
Returns the associated damage on touch zone.
The documentation for this class was generated from the following file:
- H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/Weapons/Projectile.cs