Skip to content

OnTrapTrigger

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnTrapTrigger( BearTrap instance, GameObject obj )
{
    Puts( "OnTrapTrigger works!" );
}
csharp
private void OnTrapTrigger( Landmine instance, GameObject obj )
{
    Puts( "OnTrapTrigger works!" );
}

Location

  • BearTrap::ObjectEntered(UnityEngine.GameObject obj)
  • Landmine::ObjectEntered(UnityEngine.GameObject obj)
csharp
//---
{
	if (!this.Armed())
	{
		return;
	}
	if (Interface.CallHook("OnTrapTrigger", this, obj) != null)
	{
		return;
	}
	this.hurtTarget = obj;
	base.Invoke(new Action(this.DelayedFire), 0.05f);
//---
csharp
//---
	{
		base.CancelInvoke(new Action(this.Arm));
		this.blocked = true;
		return;
	}
	if (Interface.CallHook("OnTrapTrigger", this, obj) != null)
	{
		return;
	}
	BasePlayer ply = obj.ToBaseEntity(false) as BasePlayer;
	this.Trigger(ply);
//---

Released under the MIT License.