如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
Unity3D游戏开发之android下调试Unity3D应用目前貌似不支持断点调试,但可以通过日志打印(logcat)来跟踪。在androidSDK中有个adb工具,使用此工具来跟踪运行的android应用:adblogcat启动logcat,并将设备上运行的android应用的运行时信息全部打印出来。adblogcat-sUnity如果只想打印Unity的输出信息,使用此命令。adblogcat-d>logcat.txt将打印信息输出为文件。文章出处HYPERLINK"http://www.gopedu.com/"【狗刨学习网】当然,更直接的做法是在应用中集成自己的调试信息窗口,将如下代码关联到一个gameobject:[csharp]viewplaincopy<p>usingUnityEngine;usingSystem.Collections;</p><p>publicclassGuiTextDebug:MonoBehaviour{privatefloatwindowPosition=-440.0f;privateintpositionCheck=2;privatestaticstringwindowText="";privateVector2scrollViewVector=Vector2.zero;privateGUIStyledebugBoxStyle;privatefloatleftSide=0.0f;privatefloatdebugWidth=420.0f;publicbooldebugIsOn=false;publicstaticvoiddebug(stringnewString){windowText=newString+"\n"+windowText;UnityEngine.Debug.Log(newString);}voidStart(){debugBoxStyle=newGUIStyle();debugBoxStyle.alignment=TextAnchor.UpperLeft;leftSide=120;}voidOnGUI(){if(debugIsOn){GUI.depth=0;GUI.BeginGroup(newRect(windowPosition,40.0f,leftSide,200.0f));scrollViewVector=GUI.BeginScrollView(newRect(0,0.0f,debugWidth,200.0f),scrollViewVector,newRect(0.0f,0.0f,400.0f,2000.0f));GUI.Box(newRect(0,0.0f,debugWidth-20.0f,2000.0f),windowText,debugBoxStyle);GUI.EndScrollView();GUI.EndGroup();if(GUI.Button(newRect(leftSide,0.0f,75.0f,40.0f),"调试")){if(positionCheck==1){windowPosition=-440.0f;positionCheck=2;}else{windowPosition=leftSide;positionCheck=1;}}if(GUI.Button(newRect(leftSide+80f,0.0f,75.0f,40.0f),"清除")){windowText="";}}}}</p>文章出处HYPERLINK"http://www.gopedu.com/"【狗刨学习网】