private List CoinPos = new List();
private void CreateCoinPos()
{
Vector3 offset = new Vector3(0, 20, 0);
CoinPos.Clear();
int _Diameter = 4;
int _Distance = 60;
for (int x = -_Diameter; x < _Diameter + 1; x++)
{
int r = Math.Abs(x % 2);
int dis = _Diameter - Math.Abs(x);
for (int y = -dis; y < dis + 1; y++)
{
int ry = Math.Abs(y % 2);
if (ry != r)
continue;
Vector3 _Pos = new Vector3(x * _Distance, y * _Distance, 0);
_Pos += offset;
CoinPos.Add(_Pos);
}
}
CoinPos.Sort(delegate(Vector3 a, Vector3 b)
{
float ad = Vector3.Distance(a, Vector3.zero);
float bd = Vector3.Distance(b, Vector3.zero);
if (ad < bd) return -1;
if (ad > bd) return 1;
return 0;
});
}
public void DropCoin(int Length)
{
}
2021年9月2日
[筆記]讓金幣依照菱形圖案去跳舞
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言
歡迎大家留言提問,我會答的都會盡力回答!
如果太久沒出現回應就是我又忘記回來看留言了TAT