我是初学者.
我已经能够在圆圈内找到一个点并移动到那里,但我还没有找到任何工作方法.
这是找到并移动到圆内某个点的代码.
private void RandomizePosition()
{
double x = -0.5; // center of circle x
double y = -0.5; // center of circle y
this.transform.position = UnityEngine.Random.insideUnitCircle * 7; // this makes the circle
}
我已经厌倦了使用this.transform.position = new Vector3(Mathf.Round(x), Mathf.Round(y), 0.0f);
,但我得到了错误"cannot implicitly convert type double to float"如果有人有任何 idea ,请分享,谢谢.