Partial Toolgun class, UI weapon component that holds effect references and toggles a firing mode. It stores two effect GameObject properties and flips a local ping flag, updating the weapon model renderer parameter when switching modes.
public partial class Toolgun : ScreenWeapon
{
[Header( "Effects" )]
[Property] public GameObject SuccessImpactEffect { get; set; }
[Property] public GameObject SuccessBeamEffect { get; set; }
bool ping = false;
public void SwitchToolMode()
{
ping = !ping;
WeaponModel?.Renderer?.Set( "firing_mode", ping ? 1 : 0 );
}
}