gpt4 book ai didi

c# - 并非所有代码路径都返回一个值 c#'

转载 作者:太空宇宙 更新时间:2023-11-03 21:08:39 26 4
gpt4 key购买 nike

<分区>

我尝试使用以下代码并出现上述错误。我绝对是新手编码员,所以可能很简单。我猜这与 if(a2dCollider) 有关。不过,我需要检查对撞机是否存在才能使该语句生效。

     private bool CheckIndex(int cIndex, bool a2DCollider)
{
if (a2DCollider)
{
if (floatingObjects2D.Count <= cIndex)
{
return true;
}
if (floatingObjects2D[cIndex] == null)
{
floatingObjects2D.RemoveAt(cIndex);
return true;
}
}
else
{
if (floatingObjects3D.Count <= cIndex)
return true;
if (floatingObjects3D[cIndex] == null)
{
floatingObjects3D.RemoveAt(cIndex);
return true;
}
}


}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com