Megacity demo game for UOS
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
680 B

using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
namespace Unity.MegaCity.Utils
{
/// <summary>
/// Updates the transform position of HDAdditionalLightData gameobject,
/// based on the velocity (x,y) and the DeltaTime.
/// </summary>
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;
}
}
}