단순화 현재 내 문제는 이것이다 : 유니티 www가 항복 반환 요청은 편집기에서 작동하지만 FB 응용 프로그램에
코드 아래 단결 편집기에서 작동
, 나는 여러 번 전에 PHP를 확인하고 이제 URL이 전송되는 것을 작품 한 올바른 값을 반환하지만 페이스 북 앱에서 사용할 공간에 빌드를 업로드하면 어떤 이유로 중지되므로 img가 멈추는 위치를 표시합니다.일부 기타 세부 사항 :
주변의 모든 흔적을 찾고은 3.0 (내가 v4.3.3f1 인에서 일하고 있어요 버전) 버그 인 가리하지만, 내 코드 동안 아래 편집기에서 작동 아무런 문제가 없으면 제공된 html 공간에 빌드를 업로드 할 때 수익 요청이 www 요청을 지나치지 않게됩니다.
아래의 블록 이전에 로그인이 작동하는 현재 방법은 FB 게임 객체를 초기화하고 페이스 북에 로그인 한 다음 오류가 없는지 확인한 다음 FB 사용자 ID를 다시 전달하여 아래 코드로 전달합니다. 예정된.
빠른 편집 - DB 커넥터에는 아래의 코드가 PHP get에 필요한 문자열에 추가되는 주 URL이 들어 있습니다.
어디서 문제를 해결하기 시작해야할지 모르겠지만 진행되는 동안 표시되는 텍스트를 변경하면 여기에서 내 질문에 맞출 수 있습니다. 이 스틱 로그인 화면의
이미지 : http://i.imgur.com/ti2YLrW.png?1
코드 : 브라우저에서 실행할 때 다른 규칙이 있습니다
using UnityEngine;
using System.Collections;
using System;
public class ConnectToDataBase : MonoBehaviour {
public bool bDatabaseConnected = false;
public bool bConnectionFailed = false;
public string sFacebookID;
public WWWForm wwwForm;
public void vStartConnection()
{
var text = GameObject.FindGameObjectWithTag ("Other");
text.guiText.text = "Login : connectToDatabase: prepping query";
//call databasequeries and get sDBConnect
string sConnectPhp = GameObject.FindGameObjectWithTag("DBConnector").GetComponent<DatabaseQueries>().sDBConnect;
//now ready the url with the necessary code for php's get, and the FacebookID
string url = sConnectPhp + "?UserID=" + sFacebookID;
text.guiText.text = "Login : connectToDatabase: url being sent:\n" + url;
WWW wwwGet = new WWW(url);
text.guiText.text = "Login : connectToDatabase: wwwGet created";
text.guiText.text = "Login : connectToDatabase: starting coroutine";
StartCoroutine(Connect(wwwGet));
}
IEnumerator Connect(WWW www)
{
var text = GameObject.FindGameObjectWithTag("Other");
text.guiText.text = "Login : connectToDatabase: coroutine started - sending www request";
yield return www;
text.guiText.text = "Login : connectToDatabase: wwwGet yield return";
string sTemp = www.text;
if(www.error == null)
{
text.guiText.text = "Login : connectToDatabase: wwwGet has not errored";
string newString = sTemp.ToString();
int newInt = Convert.ToInt32(newString);
//print (newString);
text.guiText.text = "Login : connectToDatabase: checking wwwGet return as int";
if(newInt == 0)
{
//if successfully connected set to true
print ("connectToDatabase: olduser successful");
text.guiText.text = "Login : connectToDatabase: olduser successful";
bDatabaseConnected = true;
yield break;
}
else if(newInt == 1)
{
//if successfully connected set to true
print ("connectToDatabase: newuser successful");
text.guiText.text = "Login : connectToDatabase: newuser successful";
bDatabaseConnected = true;
yield break;
}
else if(newInt == 2)
{
//game connection has failed
print ("connectToDatabase: failed");
text.guiText.text = "Login : connectToDatabase: failed";
bDatabaseConnected = false;
bConnectionFailed = true;
yield break;
}
else
{
text.guiText.text = "Login : connectToDatabase: php did not return a 0/1/2 value";
}
}
else
{
//game connection has failed
print ("connectToDatabase: failed");
text.guiText.text = "Login : connectToDatabase: wwwGet has errored:\n" + www.error;
bDatabaseConnected = false;
bConnectionFailed = true;
yield break;
}
text.guiText.text = "Login : connectToDatabase: wwwGet if statement skipped entirely";
}
}
내일 고맙습니다. 내일 실험실에있을 때 구현하겠습니다. – BigHandInSky