📜  让敌人走向玩家团结 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:43.309000             🧑  作者: Mango

代码示例1
float speed = whatever;
Vector2 positionToMoveTo = (whatever, whatever);

void Update()
{
  transform.position = Vector2.MoveTowards(transform.position, positionToMoveTo, speed * Time.deltaTime);
}