Class Projectile
Behavior of projectiles such as arrows or spells. The default behavior is to go straight towards the target.
Namespace: AutoBattleFramework.Skills
Assembly: cs.temp.dll.dll
Syntax
public class Projectile : MonoBehaviour
Fields
source
GameCharacter that launches this projectile.
Declaration
public GameCharacter source
Field Value
Type | Description |
---|---|
GameCharacter |
speed
Travelling speed of the projectile.
Declaration
public float speed
Field Value
Type | Description |
---|---|
Single |
target
GameCharacter that is the target of this projectile.
Declaration
public GameCharacter target
Field Value
Type | Description |
---|---|
GameCharacter |
Methods
Movement()
Default movement of the projectile. Travels in a straight line to the target. When the target is hit, it activates the default effects and the projectile is destroyed.
Declaration
public virtual void Movement()
OnHit()
Applies on hit effects and damage, and then destroy the projectile.
Declaration
public void OnHit()
SetTarget(GameCharacter, GameCharacter, Single, IAttackEffect)
Set the projectile properties.
Declaration
public virtual void SetTarget(GameCharacter source, GameCharacter target, float speed, IAttackEffect effect)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | source | GameCharacter who launches this projectile. |
GameCharacter | target | GameCharacter target of this projectile. |
Single | speed | Travelling speed of the projectile. |
IAttackEffect | effect | Attack effects attached to this projectile. |