I’ve looked for this answer in quite a few places on this forum, but so far none have proved helpful to get the job done. So my situation is, I have a “Boss” that is controlled by an enum in a script. He has 6 states (in the enum), one of them being Special. These are triggered in the Update() method with a switch statement inside of it. So when the CurrentState is BossActions.Special, it calls Special() in the switch statement which is going to move the boss and then i want him to shoot.
I created another script called BossSpecial where I want to check if the BossAction.Special == true and then call the method if so. Something like
void Update()
{
if(BossScript.BossActions.Special == true )
{
Shoot();
}
}
public void Shoot()
{
//code here
}
I know you can’t do this this way but I don’t know how to accurately compare it. I’ve tried setting it equal to a variable and then comparing that, but i couldn’t figure that out. I tried taking the enum out of the class, but I don’t think that’s my answer either. I’m just not sure how to check in this instance.