APPNAME经过优化编译-单步执行可能会产生奇怪的结果;变量可能不可用 [英] APPNAME was compiled with optimization - stepping may behave oddly; variables may not be available

查看:153
本文介绍了APPNAME经过优化编译-单步执行可能会产生奇怪的结果;变量可能不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该项目是在Unity3d中开发的,并将其构建到iOS中.

This project is develop in Unity3d and build it to iOS.

这是我的.cs文件.

IEnumerator DownloadModel(string modelUrl)
    {
        isDownloading = true;
        // Wait for the Caching system to be ready
        while (!Caching.ready)
            yield return null;

        // Load the AssetBundle file from Cache if it exists with the same version or download and store it in the cache
        WWW www = WWW.LoadFromCacheOrDownload (modelUrl, 1);
        Debug.Log ("modelURL : " + modelUrl);
        while (!www.isDone) {
            progressText.text = "Progress : " + (www.progress * 100).ToString ("N0") + "%";
            Debug.Log("Download Progress : " + (www.progress * 100).ToString ("N0") + "%");
            yield return null;
        }

        yield return www;  

        isDownloading = false;

        if (www.error != null) {
            throw new UnityException ("WWW download had an error:" + www.error);
        }

        AssetBundle bundle = www.assetBundle;

        downloadedObjectContainer = bundle.LoadAllAssets ();

        //              tempObj = Instantiate(downloadedObjectContainer[0]) as GameObject;
        //
        //              tempObj.transform.SetParent(this.transform);
        isDownloading = false;

        // Unload the AssetBundles compressed contents to conserve memory
        bundle.Unload (false);
        // memory is freed from the web stream (www.Dispose() gets called implicitly)

        Debug.LogWarning ("START CALLING OUT OBJECT");
        if (downloadedObjectContainer[0] != null) {

            Debug.Log("Downloadable content count : " + downloadedObjectContainer.Length );

            currentDownloadedModel = Instantiate(downloadedObjectContainer[0]) as GameObject;
            Debug.Log("OBJECT INSTANTIATE.");

            currentDownloadedModel.transform.SetParent(this.transform);

            //set the ARContent and ImageTarget
            sic.setARContentAndMarker(currentDownloadedModel, ImageTarget);
            Debug.Log("CONTENT MARKER SET.");

            currentDownloadedModel.SetActive(true);

        }

        Debug.LogWarning ("COROUTINE FINISHED");
    }

和我的"currentDownloadedModel"在顶部声明为GameObject.

and my "currentDownloadedModel" is declared at the top as GameObject.

public class cloudTrackableEventHandler : MonoBehaviour{

     GameObject currentDownloadedModel;

当我将应用程序构建到Android时,完全没有问题.但是一旦我在iOS中构建它,就会发生此错误

When i build my App to Android, there is no problem at all. But once i build it in iOS, this error occurs

START CALLING OUT OBJECT

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

Downloadable content count : 1

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

MarcV2 was compiled with optimization - stepping may behave oddly; variables may not be available.

通过Debug.Log(),我发现要为我实例化的模型分配currentDownloadedModel时出现问题.谁可以帮我这个事 ?预先感谢.

By the Debug.Log(), I found out that the problem occurs when I want to assign the currentDownloadedModel with the model i instantiate. Can anyone help me on this ? Thanks in advance.

注意:在统一播放器设置中,脚本调用优化"设置为缓慢且安全"

Note : the "Script call optimization" at the unity player settings is set to "slow and safe"

推荐答案

对于同样遇到此问题的任何人,请尝试取消选中文件">构建设置">播放器设置(iOS)"中的条带引擎代码"".

For anyone who also face this problem, try uncheck the "Strip Engine Code" at File > Build Settings > Player Settings (iOS).

http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

这篇关于APPNAME经过优化编译-单步执行可能会产生奇怪的结果;变量可能不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆