You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
943 B

using CoreGame.Render;
namespace CoreGame.Render
{
public static class SuppressorSrv
{
public static CombatEntity CreateSuppressorEntityByAbility(GameAbilityContext ctx, float radius,
float duration, string prefabPath)
{
var caster = ctx.ownerEnt;
var ce = Contexts.Combat.CreateEntity("Suppressor");
ce.AddFaction(caster.faction.faction, SelectUseType.Suppressor);
ce.AddSuppressor(caster.creationIndex, radius, duration);
ce.AddAsset(
new MainAssetParam()
{
path = prefabPath,
parentNodeName = "RenderWorld",
}
, null);
ce.AddTransformProxy(caster.transformProxy.position, caster.transformProxy.direction, ce);
ce.transformProxy.Sync();
ce.transformProxy.Flush();
return ce;
}
}
}