1
0

ParallaxComponent.cs 804 B

12345678910111213141516171819202122232425262728
  1. using JetBrains.Annotations;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Parallax;
  4. /// <summary>
  5. /// Handles per-map parallax
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
  8. public sealed partial class ParallaxComponent : Component
  9. {
  10. // I wish I could use a typeserializer here but parallax is extremely client-dependent.
  11. [DataField, AutoNetworkedField]
  12. public string Parallax = "Default";
  13. [UsedImplicitly, ViewVariables(VVAccess.ReadWrite)]
  14. // ReSharper disable once InconsistentNaming
  15. public string ParallaxVV
  16. {
  17. get => Parallax;
  18. set
  19. {
  20. if (value.Equals(Parallax)) return;
  21. Parallax = value;
  22. IoCManager.Resolve<IEntityManager>().Dirty(this);
  23. }
  24. }
  25. }