Nebula
Loading...
Searching...
No Matches
Nebula.Game.EntityExtensions Class Reference

Static Public Member Functions

static bool IsValid ([NotNullWhen(true)] this Entity? entity)
 Returns true if entity is valid (not destroyed).
static bool HasInstance ([NotNullWhen(true)] this Entity? entity)
 Returns true if the entity has an instance in the world.

Member Function Documentation

◆ HasInstance()

bool Nebula.Game.EntityExtensions.HasInstance ( [NotNullWhen(true)] this Entity? entity)
inlinestatic

Returns true if the entity has an instance in the world.

An entity can be valid without having one, because an id can be held by something that has taken the instance out and is waiting to put it back, which is what an editor command does while it is on the undo stack. Nothing that reads the world should run against one.

This is safe to call even if the entity == null.

◆ IsValid()

bool Nebula.Game.EntityExtensions.IsValid ( [NotNullWhen(true)] this Entity? entity)
inlinestatic

Returns true if entity is valid (not destroyed).

This is safe to call even if the entity == null.


The documentation for this class was generated from the following file:
  • /github/workspace/code/addons/nsharp/NebulaEngine/engine/Entity.cs