private void Update() { switch (moveType) { case MoveType.Circular: case MoveType.CircularSin: angleSpeed = AngleUtils.Rad2Deg(speed / radius); newPos = GetCircularPos(moveType); velocity = (newPos - transform.position).normalized * speed; transform.position = newPos; break; case MoveType.InDirection: break; default: throw new ArgumentOutOfRangeException(); } dirRelativeRocket = PvoUtils.DecToPolar(transform.position - pvo.position); }
private Vector3 ConvertDecardToPolar(Vector3 vector3) => PvoUtils.DecToPolar(vector3 - pvo.position);