POCKETS
Terrarian
Alright, so this one has me stumped.
I'm attempting to use a boolean value from my ModWeapon's class to create an event in my ModProjectile's class.
Here's the breakdown -
My ModWeapon has dual use functionality (normal and right-click). This weapon has a damage increase over time. Once the damage hits a certain threshold, a new projectile spawns, and the boolean variable is set to false. This projectile is simply an indicator letting the player know that the right-click functionality is available for use. Once I use the right-click function, the bool is then set to true.
Alright, so here's what I need to do -
I need to access that bool value to perform an event inside my projectile's class (the same indicator projectile). Basically, I need to projectile.Kill() the indicator projectile once the bool value has been set to true.
How can I do this without having to resort to using a public static bool variable (which does happen to work), which I've been told is a no-no in C#?
OR, perhaps there's an easier way to handle this?
I'm attempting to use a boolean value from my ModWeapon's class to create an event in my ModProjectile's class.
Here's the breakdown -
My ModWeapon has dual use functionality (normal and right-click). This weapon has a damage increase over time. Once the damage hits a certain threshold, a new projectile spawns, and the boolean variable is set to false. This projectile is simply an indicator letting the player know that the right-click functionality is available for use. Once I use the right-click function, the bool is then set to true.
Alright, so here's what I need to do -
I need to access that bool value to perform an event inside my projectile's class (the same indicator projectile). Basically, I need to projectile.Kill() the indicator projectile once the bool value has been set to true.
How can I do this without having to resort to using a public static bool variable (which does happen to work), which I've been told is a no-no in C#?
OR, perhaps there's an easier way to handle this?