Hello, I’ve set up a simple delegate and event and subscriber for two public classes but it results in a “expression denotes a type, where a variable” etc. error. I can’t seem to figure out what i did wrong here are the pieces of code
public class SpawnManger {
public delegate void Action();
public static event Action OnSpawnComplete;
public void Spawn(){
OnSpawnComplete();
}
}
@@ new c# script @@
public class Enemy {
OnEnable (){
SpawnManager.Action += SpawnCompleted;
}
void SpawnCompleted(){
//whatever
}
}
}