using Engine.Scene.Component.BuiltIn;
using OpenTK.Mathematics;

namespace DoomDeathmatch.Component.Util;

public class CopySizeComponent : Engine.Scene.Component.Component
{
  public Vector3 Multiplier { get; set; } = Vector3.One;
  public Transform? Target { get; set; }

  public override void Update(double parDeltaTime)
  {
    if (Target == null)
      return;

    if (Multiplier.X != 0)
      GameObject.Transform.Size.X = Target.Size.X * Multiplier.X;

    if (Multiplier.Y != 0)
      GameObject.Transform.Size.Y = Target.Size.Y * Multiplier.Y;

    if (Multiplier.Z != 0)
      GameObject.Transform.Size.Z = Target.Size.Z * Multiplier.Z;
  }
}