Unity3D error CS1525: Unexpected symbol `else'

Assets/Plugin91Manager.cs(124,20): error CS1525: Unexpected symbol `else'
Assets/Plugin91Manager.cs(130,20): error CS1519: Unexpected symbol `else' in class, struct, or interface member declaration
Assets/Plugin91Manager.cs(130,36): error CS1519: Unexpected symbol `==' in class, struct, or interface member declaration
Assets/Plugin91Manager.cs(132,40): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
Assets/Plugin91Manager.cs(136,20): error CS8025: Parsing error

 유니티3D 안드로이드에 중국 91 마켓 Platform SDK 연동중에 위와 같이 에러가 발생했습니다. 오류 메세지를 보면 딱히 91 마켓 SDK 문제는 아니고 문법적인 이슈인 듯하죠.

// public static final int UPDATESTATUS_NONE = 0;
// 이미 최신 버전임
if (strResult == "0")
{
 this.strLogMsg = "Update None";
}
// public static final int UPDATESTATUS_UNMOUNTED_SDCARD = 1;
// SD 장착 안됨
else if(strResult == "1")
{
 this.strLogMsg = "Update Failed. SDCard Unmounted";
}
// public static final int UPDATESTATUS_CANCEL_UPDATE = 3;
// 유저가 업데이트 취소
else if(strResult == "3")
{
 this.strLogMsg = "Update Cancel";
}
// public static final int UPDATESTATUS_CHECK_FAILURE = 4;
// 업데이트 확인 실패
else if(strResult == "4")
{
 this.strLogMsg = "Update Check Failed";
}
// public static final int UPDATESTATUS_FORCES_LOADING = 5;
// 강제 업데이트 중
else if(strResult == "5")
{
 this.strLogMsg = "Update Force!";
}
// public static final int UPDATESTATUS_RECOMMEND_LOADING = 6;
// 추천 업데이트 중
else if(strResult == "6")
{
 this.strLogMsg = "Update Recommend";
}
else
{
 this.strLogMsg = "Update Failed " + strResult;
}

 오류가 발생한 소스부분입니다. 별다른건 없고 앱 업데이트에 대한 콜백을 SDK로부터 받아서 간단히 로그를 남기는 처리입니다. 뭐가 문제일까요? else if(strResult == "3") 부분부터 맨 밑에까지 주석으로 막고 해보니 이번에는,

Assets/Plugin91Manager.cs(124,20): error CS1525: Unexpected symbol `else'
Assets/Plugin91Manager.cs(158,21): error CS0116: A namespace can only contain types and namespace declarations
Assets/Plugin91Manager.cs(163,1): error CS8025: Parsing error

 비슷하면서 CS0116에러가 추가되네요.

 문제의 원인은 한글 주석에 있었습니다. 주석을 영어로 달거나 제거하니 잘되네요. 그런데 이상한건

//public static final int ND_COM_PLATFORM_SUCCESS = 0;
// 구매 성공
if (strResult == "0")
{
 this.strLogMsg = "Pay Success";
}
// public static final int ND_COM_PLATFORM_ERROR_PAY_FAILURE = -18003;
// 구매 실패
else if(strResult == "-18003")
{
 this.strLogMsg = "Pay Failed";
}
// public static final int ND_COM_PLATFORM_ERROR_PAY_CANCEL = -18004;
// 구매 취소
else if(strResult == "-18004")
{
 this.strLogMsg = "Pay Cancel";
}
// public static final int ND_COM_PLATFORM_ERROR_UNEXIST_ORDER = -19032;
// 오더 번호가 존재하지 않음
else if(strResult == "-19032")
{
 this.strLogMsg = "Pay UnExist Order";
}
// 구매 실패
else
{
 this.strLogMsg = "Pay Failed " + strResult;
}

 업데이트 구현전 이미 작업된 결제 처리 부분도 한글주석인데 잘 되고 있다는거죠. 아무튼 유니티3D 개발할 땐 주석을 영어로 달아야겠네요.

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.