你好!我稍微有点混乱,所以我在我的游戏里有一个文本系统,写成这样 text[0] = "{Character} : yo whats up" 我想找到每次 "{Character}" 出现的地方,以便看到每次这个人说话。 但我遇到了困难,知道 string_pos 的用法,但它在这里不起作用,因为它是数组?实际上,string_pos 可以用,但我只检查了第一个文本,例如: if (string_pos("{Character}", text[0]) != 0) { oTalksprite.sprite_index = sAuraTalksprite oTalksprite.image_speed = 3 oTalksprite.visible = true } 但这只检查了第一个文本,如果文本是 text[0] = "{Character} : yo whats up" text[1] = "{Other guy} : nothing much" text[2] = "{Character} : ok" 它只检查了第一个,那我想检查第一个和第三个,因为那些是这个角色说话的文本 如果有人知道解决方法,请告诉我
如何在数组中检查一个单词?
评论 (0)