using UnityEngine; using UnityEngine.Rendering.HighDefinition; namespace Unity.MegaCity.Utils { /// /// Updates the transform position of HDAdditionalLightData gameobject, /// based on the velocity (x,y) and the DeltaTime. /// public class PannerComponent : MonoBehaviour { public HDAdditionalLightData target; public Vector2 velocity; void Update() { var dt = Time.deltaTime; var pos = target.transform.position; pos.x += velocity.x * dt; pos.z += velocity.y * dt; target.transform.position = pos; } } }