I currently have multiple scripts that have a baseclass called BaseAttackMethod. and i want to be able to call the AttackMethod
My question is: is there a way that i have a variable like this:
BaseAttackHitMethod attackMethod;
void Start () {
attackMethod.Attack()
}
and that a class like SingleAttackMethods Attack wil be called? Or am i doing this the wrong way?
It sounds like you want an abstract method in the base class, and then to override that in the child class?
public class BaseAttackMethod() {
public abstract void Attack();
}
public class SomeAttack : BaseAttackMethod {
public override void Attack() {
//do stuff
}
}
Yes that was what i was trying to do. But i’ve figured out that that wasn’t the issue but a Editor Script that didn’t assign it properly… But thank you for the quick response!