mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 10:07:15 +02:00
Refactored some functions off of Eye, removed the IEyeManager dependence from it.
32 lines
871 B
C#
32 lines
871 B
C#
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.GameObjects.Systems;
|
|
|
|
namespace Robust.Client.GameObjects.EntitySystems
|
|
{
|
|
/// <summary>
|
|
/// Updates the position of every Eye every frame, so that the camera follows the player around.
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
internal class EyeUpdateSystem : EntitySystem
|
|
{
|
|
/// <inheritdoc />
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
EntityQuery = new TypeEntityQuery(typeof(EyeComponent));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void FrameUpdate(float frameTime)
|
|
{
|
|
foreach (var entity in RelevantEntities)
|
|
{
|
|
var eyeComp = entity.GetComponent<EyeComponent>();
|
|
eyeComp.UpdateEyePosition();
|
|
}
|
|
}
|
|
}
|
|
}
|