mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Adds "ressys" and IEntitySystemManager dependency to scripting globals. (#2762)
"ressys" resolves an `EntitySystem`.
This commit is contained in:
committed by
GitHub
parent
5a5cfa1eba
commit
712c1f3559
@@ -23,6 +23,7 @@ namespace Robust.Shared.Scripting
|
||||
BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
|
||||
|
||||
[field: Dependency] public IEntityManager ent { get; } = default!;
|
||||
[field: Dependency] public IEntitySystemManager esm { get; } = default!;
|
||||
[field: Dependency] public IPrototypeManager prot { get; } = default!;
|
||||
[field: Dependency] public IMapManager map { get; } = default!;
|
||||
|
||||
@@ -78,6 +79,11 @@ namespace Robust.Shared.Scripting
|
||||
return IoCManager.Resolve<T>();
|
||||
}
|
||||
|
||||
public T ressys<T>() where T : EntitySystem
|
||||
{
|
||||
return esm.GetEntitySystem<T>();
|
||||
}
|
||||
|
||||
public object? prop(object target, string name)
|
||||
{
|
||||
return target.GetType().GetProperty(name, BindingFlags.Instance | BindingFlags.NonPublic)
|
||||
|
||||
Reference in New Issue
Block a user