CEntityInstance
Interface CEntityInstance
Namespace: SwiftlyS2.Shared.SchemaDefinitions
Assembly: SwiftlyS2.CS2.dll
public interface CEntityInstance : ISchemaClass<CEntityInstance>, ISchemaField, ISchemaClass, INativeHandleImplements
Properties
CScriptComponent
CScriptComponent? CScriptComponent { get; }DesignerName
The designer name of the entity.
string DesignerName { get; }Entity
CEntityIdentity? Entity { get; }Index
The index of the entity.
uint Index { get; }PrivateVScripts
string PrivateVScripts { get; set; }Methods
AcceptInput<T>(string, T?, CEntityInstance?, CEntityInstance?, int)
Fire an input to the entity.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void AcceptInput<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, int outputID = 0)- input string — Input name.
- value T? — Input value.
- activator CEntityInstance? — Activator entity. Nullable.
- caller CEntityInstance? — Caller entity. Nullable.
- outputID int — Output ID.
- T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color
AcceptInputAsync<T>(string, T?, CEntityInstance?, CEntityInstance?, int)
Fire an input to the entity asynchronously.
Task AcceptInputAsync<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, int outputID = 0)- input string — Input name.
- value T? — Input value.
- activator CEntityInstance? — Activator entity. Nullable.
- caller CEntityInstance? — Caller entity. Nullable.
- outputID int — Output ID.
- T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color
AddEntityIOEvent<T>(string, T?, CEntityInstance?, CEntityInstance?, float)
Add an entity IO event to the entity.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void AddEntityIOEvent<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, float delay = 0)- input string — Input name.
- value T? — Input value.
- activator CEntityInstance? — Activator entity. Nullable.
- caller CEntityInstance? — Caller entity. Nullable.
- delay float — Delay in seconds.
- T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color
AddEntityIOEventAsync<T>(string, T?, CEntityInstance?, CEntityInstance?, float)
Add an entity IO event to the entity asynchronously.
Task AddEntityIOEventAsync<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, float delay = 0)- input string — Input name.
- value T? — Input value.
- activator CEntityInstance? — Activator entity. Nullable.
- caller CEntityInstance? — Caller entity. Nullable.
- delay float — Delay in seconds.
- T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color
Despawn()
Despawn the entity.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void Despawn()DespawnAsync()
Despawn the entity asynchronously.
Task DespawnAsync()DispatchSpawn(CEntityKeyValues?)
Dispatch a spawn event to the entity.
Thread unsafe, use async variant instead for non-main thread context.
[ThreadUnsafe]
void DispatchSpawn(CEntityKeyValues? entityKV = null)- entityKV CEntityKeyValues? — Entity key values. Nullable.
DispatchSpawnAsync(CEntityKeyValues?)
Dispatch a spawn event to the entity asynchronously.
Task DispatchSpawnAsync(CEntityKeyValues? entityKV = null)- entityKV CEntityKeyValues? — Entity key values. Nullable.
EntityUpdated()
void EntityUpdated()IsTransmitting(int)
Check if the entity is transmitting for one player.
bool IsTransmitting(int playerId)- playerId int — The player ID to check the transmit state for.
SetTransmitState(bool, int)
Set the transmit state of the entity for one player.
void SetTransmitState(bool transmitting, int playerId)- transmitting bool — Whether the entity should be transmitting.
- playerId int — The player ID to set the transmit state for.
SetTransmitState(bool)
Set the global transmit state of the entity.
void SetTransmitState(bool transmitting)- transmitting bool — Whether the entity should be transmitting.