Skip to content

OnTurretToggle

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnTurretToggle( AutoTurret instance )
{
    Puts( "OnTurretToggle works!" );
    return null;
}

Location

  • AutoTurret::SetIsOnline(bool online)
csharp
//---
	BaseProjectile attachedWeapon = GetAttachedWeapon();
	if ((bool)attachedWeapon && attachedWeapon is ITurretNotify turretNotify)
	{
		turretNotify.OnAddedRemovedToTurret(online);
	}
	if (online != IsOn() && Interface.CallHook("OnTurretToggle", this) == null)
	{
		SetFlag(Flags.On, online);
		OnTurretPowerChanged(online);
		booting = false;
		BaseProjectile attachedWeapon2 = GetAttachedWeapon();
//---

Released under the MIT License.