Inline Transform

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:20:34 +01:00
parent 69b270017b
commit a5b57c8e10
283 changed files with 742 additions and 709 deletions

View File

@@ -31,7 +31,7 @@ namespace Content.Client.Weapons.Melee.Components
_sprite?.AddLayer(new RSI.StateId(prototype.State));
_baseAngle = baseAngle;
if(followAttacker)
Owner.Transform.AttachParent(attacker);
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).AttachParent(attacker);
}
internal void Update(float frameTime)
@@ -55,12 +55,12 @@ namespace Content.Client.Weapons.Melee.Components
{
case WeaponArcType.Slash:
var angle = Angle.FromDegrees(_meleeWeaponAnimation.Width)/2;
Owner.Transform.WorldRotation =
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).WorldRotation =
_baseAngle + Angle.Lerp(-angle, angle, (float) (_timer / _meleeWeaponAnimation.Length.TotalSeconds));
break;
case WeaponArcType.Poke:
Owner.Transform.WorldRotation = _baseAngle;
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).WorldRotation = _baseAngle;
if (_sprite != null)
{

View File

@@ -56,8 +56,8 @@ namespace Content.Client.Weapons.Melee
var lunge = attacker.EnsureComponent<MeleeLungeComponent>();
lunge.SetData(msg.Angle);
var entity = EntityManager.SpawnEntity(weaponArc.Prototype, attacker.Transform.Coordinates);
entity.Transform.LocalRotation = msg.Angle;
var entity = EntityManager.SpawnEntity(weaponArc.Prototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(attacker.Uid).Coordinates);
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).LocalRotation = msg.Angle;
var weaponArcAnimation = IoCManager.Resolve<IEntityManager>().GetComponent<MeleeWeaponArcAnimationComponent>(entity.Uid);
weaponArcAnimation.SetData(weaponArc, msg.Angle, attacker, msg.ArcFollowAttacker);
@@ -73,7 +73,7 @@ namespace Content.Client.Weapons.Melee
{
EffectSprite = sourceSprite.BaseRSI.Path.ToString(),
RsiState = sourceSprite.LayerGetState(0).Name,
Coordinates = attacker.Transform.Coordinates,
Coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(attacker.Uid).Coordinates,
Color = Vector4.Multiply(new Vector4(255, 255, 255, 125), 1.0f),
ColorDelta = Vector4.Multiply(new Vector4(0, 0, 0, -10), 1.0f),
Velocity = msg.Angle.ToWorldVec(),