且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在unityscript中的字符串数组中搜索子字符串

更新时间:2023-02-21 15:33:21

除了Kolink的答案,您的if还在Boundary的开头寻找Boundary(clone),而不是相反.我认为您正在寻找:

In addition to Kolink's answer, your if is looking for Boundary(clone) at the beginning of Boundary, rather than the other way around. I think you're looking for:

if (hitFront.collider.gameObject.name.IndexOf(obstacles[i]) >= 0)