📜  Unity 制作归位对象 - C# 代码示例

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

代码示例1
Vector2 direction = (Vector2)Target.position - rb.position;
        direction.Normalize();
        float RotateAmount = Vector3.Cross(direction, transform.up).z;
        rb.angularVelocity = -RotateSpeed * RotateAmount;
        rb.velocity = transform.up * Speed;