I was wondering if I can use inheritance to create multiple attacks easily. Here is what I mean
Base Class
public class ShootingAttack extends MonoBehaviour{
public var Target : Vector3;
public var HitParticle = "";
public var ShootParticle = "";
public var ParticleS = "";
public var Part_number : int = 1;
public var Damage : int = 1;
public var gravity : int = 0;
public var Cooldown : int = 5;
public var Move;
public var timer;
public function Start () {
//start
}
}
public function Update () {
}
public function PlayerAttack(){
// attack
}
and this would be inherited.
class Ember extends ShootingAttack {
public function start(){
super.HitParticle = "FireAt";
ShootParticle = "FireAt";
ParticleS = "Attack";
Part_number = 1;
Damage = 5;
gravity = 0;
Cooldown = 5;
}
}
and pretty much the base class would use the inherited values to attack so I can quickly create multiple attaks by changing values.