Skip to content

OnEntityEnter

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnEntityEnter( TriggerBase instance, BaseEntity ent )
{
    Puts( "OnEntityEnter works!" );
}
csharp
private void OnEntityEnter( TriggerComfort instance, BaseEntity ent )
{
    Puts( "OnEntityEnter works!" );
}

Location

  • TriggerBase::OnEntityEnter(BaseEntity ent)
  • TriggerComfort::OnEntityEnter(BaseEntity ent)
csharp
//---
	}
	if (this.entityContents == null)
	{
		this.entityContents = new HashSet<BaseEntity>();
	}
	if (Interface.CallHook("OnEntityEnter", this, ent) != null)
	{
		return;
	}
	this.entityContents.Add(ent);
	Action<BaseNetworkable> expr_40 = this.OnEntityEnterTrigger;
//---
csharp
//---
	BasePlayer basePlayer = ent as BasePlayer;
	if (!basePlayer)
	{
		return;
	}
	if (Interface.CallHook("OnEntityEnter", this, ent) != null)
	{
		return;
	}
	this._players.Add(basePlayer);
}

Released under the MIT License.