Class EnemyProjectile
Represents a simple enemy projectile. By default, this script handles:
- Spawning the projectile at a random scale between scaleMin and scaleMax
- Squashing and stretching the sprite depending on how it's moving through the air
- Handling collision with both the player and the environment
Inheritance
Object
Component
Behaviour
MonoBehaviour
EnemyProjectile
Assembly: WeaverCore.dll
Syntax
[RequireComponent(typeof(Rigidbody2D))]
public abstract class EnemyProjectile : MonoBehaviour, IOnPool
Properties
|
Edit this page
View Source
Collider
Declaration
public Collider2D Collider { get; }
Property Value
Type |
Description |
Collider2D |
|
|
Edit this page
View Source
Rigidbody
Declaration
public Rigidbody2D Rigidbody { get; }
Property Value
Type |
Description |
Rigidbody2D |
|
|
Edit this page
View Source
ScaleFactor
Declaration
public float ScaleFactor { get; set; }
Property Value
Methods
|
Edit this page
View Source
Awake()
Declaration
protected virtual void Awake()
|
Edit this page
View Source
ForceHit(GameObject)
Declaration
public void ForceHit(GameObject collision)
Parameters
Type |
Name |
Description |
GameObject |
collision |
|
|
Edit this page
View Source
OnCollisionEnter2D(Collision2D)
Declaration
protected virtual void OnCollisionEnter2D(Collision2D collision)
Parameters
Type |
Name |
Description |
Collision2D |
collision |
|
|
Edit this page
View Source
OnCollisionStay2D(Collision2D)
Declaration
protected virtual void OnCollisionStay2D(Collision2D collision)
Parameters
Type |
Name |
Description |
Collision2D |
collision |
|
|
Edit this page
View Source
OnHit(GameObject)
Declaration
protected virtual void OnHit(GameObject collision)
Parameters
Type |
Name |
Description |
GameObject |
collision |
|
|
Edit this page
View Source
OnPool()
Called when the object is sent back to a pool
Declaration
public virtual void OnPool()
|
Edit this page
View Source
OnTriggerEnter2D(Collider2D)
Declaration
protected virtual void OnTriggerEnter2D(Collider2D collision)
Parameters
Type |
Name |
Description |
Collider2D |
collision |
|
|
Edit this page
View Source
OnTriggerStay2D(Collider2D)
Declaration
protected virtual void OnTriggerStay2D(Collider2D collision)
Parameters
Type |
Name |
Description |
Collider2D |
collision |
|
|
Edit this page
View Source
PointAwayFrom(Vector3)
Declaration
public void PointAwayFrom(Vector3 target)
Parameters
Type |
Name |
Description |
Vector3 |
target |
|
|
Edit this page
View Source
Update()
Declaration
protected virtual void Update()
Implements
Extension Methods