这个语法很恶心,经常忘记,网上找半天才能找到。一怒之下写道博客里,随时翻阅。
moveCells.Sort((a, b) => {
if (Mathf.Abs(selfCell.x-a.x)<Mathf.Abs(selfCell.x-b.x))
{
return 1;
}
else
{
return -1;
}
}
);