UnityScript If(var =“this”OR“that”){//做某事}

时间:2015-06-03 18:07:16

标签: if-statement unity3d unityscript

我不确定如何使以下代码有效:

if(response!==("usernamewrong" OR "passwordwrong")){
    print("login Wrong");
} else {
    //if anything else other than the two shows up into the response goes here
}

1 个答案:

答案 0 :(得分:2)

在条件中进行多项检查时,您必须明确:

if (response == "usernamewrong" || response == "passwordwrong")