Summary
A projectile that flies straight and creates an
Weaver.Examples.Explosion when it hits something or takes damage.
- Assembly
- Weaver
.dll - Namespace
- Weaver
.Examples - Interfaces
- Base Types
-
- MonoBehaviour
- PoolableBehaviour
<Missile>
graph BT
Type-->Base0["PoolableBehaviour<Missile>"]
Base0-->Base1["MonoBehaviour"]
Type-.->Interface0["IPoolable"]
click Interface0 "/weaver/api/Weaver/IPoolable"
Type-.->Interface1["ITakeDamage"]
click Interface1 "/weaver/api/Weaver.Examples/ITakeDamage"
Type["Missile"]
class Type type-node
Syntax
public sealed class Missile : PoolableBehaviour<Missile>, IPoolable, ITakeDamage
Properties
| Name | Value | Summary |
|---|---|---|
| ExplosionPrefab | Explosion |
The
Weaver.Examples.Explosion prefab to instantiate on impact or when damaged. |
| IsWorthPoints | bool |
Indicates whether this missile will increase the player's score when destroyed.
|
| Rigidbody | Rigidbody |
The
Weaver.Examples.Missile.Rigidbody which moves this missile. |
| Source | IDealDamage |
The owner of this missile.
|
| Speed | float |
The speed at which this missile is moving.
|
| SpeedMultiplier | float |
The movement speed specified in
Weaver.Examples.Missile.Fire(Weaver.Examples.IDealDamage,UnityEngine.Vector3,UnityEngine.Quaternion,System.Single,System.Boolean) is multiplied by this value. |
Methods
| Name | Value | Summary |
|---|---|---|
| Fire |
void |
Initializes and activates this missile.
|
| OnCollisionEnter |
void |
Called by Unity when this object collides with something.
Causes this missile to
Explode.
|
| OnRelease |
void |
Called when this object is released back to its
Weaver.ObjectPool`1.
Resets its values back to their defaults.
|
| OnTakeDamage |
void |
Called when this object is damaged by something.
Spawns an explosion and releases this missile back to its
Weaver.ObjectPool`1.
|
Extension Methods
| Name | Value | Summary |
|---|---|---|
| Try |
bool |
If the `behaviour` was created by an
Weaver.ObjectPool`1 this method releases the `behaviour` to
it, disables its UnityEngine.GameObject, and returns true.
Otherwise this method destroys the UnityEngine.GameObject and returns false.
From ObjectPool
|