Tag: unity3d

Unity3d iOS构buildexportArchive IPA大小

Unity3d IPA尺寸上有几个问题,但是我没有发现能够正确解决问题的问题。 问题是,如果通过XCode GUI导出IPA,我有24mg的IPA,如果使用命令行导出,我会得到一个160mg的IPA。 步骤: 使用默认的iOS设置从Unity创build项目 在Xcode 7.3.1中打开,selectProduct – > Archive 现在,通过GUI: 打开pipe理器 ,select存档,导出,保存为企业部署,完成 IPA与24mg 通过命令行: 获取由Organizer中的xcode生成的存档的path( Show in Finder ) 运行xcodebuild -exportArchive -archivePath ~/Library/etc/etc/Unity-iPhone.xcarchive -exportPath build/Unity-iPhone -exportFormat ipa -exportProvisioningProfile "My Provisioning Profile" 这给了我一个160毫克的IPA … $ ls -lh total 382480 -rw-r–r– 1 iz staff 163M Jul 26 15:28 cmdline.ipa -rw-r–r– 1 iz staff 23M Jul […]

使用注视input持续时间在Google Cardboard中select用户界面文字

我用我自己的UI文本button修改了Google Cardboard DemoScene。 默认情况下,这些button会响应Onclick()或点击事件来触发操作。 我想触发这些行动时,用户设置他们的目光对象2秒。 我怀疑我需要在GazeInputModule中添加一些条件语句,但我不知道如何度量时间。 任何人都可以指向正确的方向吗? 这是正确的方法还是我应该尝试其他的东西? 这对我来说还是很新的,所以即使是基本的提示也是非常有帮助的!

如何读取和写入一个XML文件到相同的位置?

我准备了一些内容的XML文件,并希望加载它在iOS设备上玩,但我也想改变加载的数据,并在同一个文件再次序列化。 在Unity编辑器(Windows)中,它完美的工作,但是当我在iOS设备上testing它时,似乎我可以使用WWW类从StreamingAssets读取,但是我无法写入它。 另外我发现我可以读写由Application.persistentDataPath创build的path。 但似乎在设备的位置,我不能把我的XML到该位置,用户有权访问该文件夹,所以这不是很好的解决scheme,不是吗? 这里用来加载和保存数据的代码。 using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using System.Xml.Serialization; using System.IO; using System.Xml; public class testxml : MonoBehaviour { public Text result; public InputField firstPart, secondPart; public Toggle toggle; private List<int> listToSave; // Use this for initialization void Start () { listToSave = new List<int>(); } public void Save() […]

Swift 3项目中的Unity实现:应用程序启动崩溃 – MetadataCache :: Initialize()

各位程序员, 我需要实现一个导出的Unity项目到我的本地Swift项目,所以我按照本教程的说明: https://github.com/blitzagency/ios-unity5 不幸的是,应用程序启动崩溃。 我截取了我的debugging导航器的截图: 我发现这个线程,并遵循每一个build议,但我不能得到它的运行。 我会很高兴看到一个工作的例子: https://forum.unity3d.com/threads/il2cpp-anyone-else-seeing-metadatacache-initialize-crashes-sometimes-when-the-game-starts.383145/ 提前致谢。

File.Create在iPhone 5S上失败

我正在开发一个保存/加载数据的Unity游戏。 我正处于这个项目的testing阶段,遇到了一个不寻常的情况,游戏拒绝在iOS中保存。 在Android,Windows和OS X上运行时,它工作的很好。以下是我的适用代码: FileStream file = File.Create(GetSavePath()); bf.Serialize(file, saveFile); file.Close(); 我如下定义GetSavePath() : private string GetSavePath() { return Path.Combine(Application.persistentDataPath, SAVEPATH); } 我将SAVEPATH定义为SaveFile.bin 。 请注意,问题是显式使用File.Create() ,如下面的跟踪所示: IOException: Sharing violation on path /var/mobile/Containers/Data/Application/4AE45A80-AC36-4A96-9C69-BE01CB753896/Documents/SaveFile.bin at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 at System.IO.FileStream..ctor (System.String path, […]

统一iOS的build设规模是很大的

目前,我正在为iOS制作2D益智游戏。 当我压缩我的项目时,它的大小约为16MB 。 当我在xcode中构build它时,项目大小变为780MB ,当我将其归档时,它变成1.5GB 。 但真正的问题开始时,我上传它testing飞行内部和外部testing,然后在iTunes连接它的压缩大小变为143MB和通用安装大小变成285MB,并为不同的iPhone安装大小成为160MB平均。 现在我认为160MB是一个简单的2D益智游戏的非常大的安装文件,当我发布它时可能会导致严重的丢失。 Unity版本:5.4.2 脚本后端:IL2CPP Api兼容性级别:.Net 2.0子网 任何人都可以告诉我,我能做些什么来解决这个问题,或者当我发布它时,大小会减less。 提前致谢。

UIImagePickerController偶尔会冻结

我在Unity应用程序中使用UIImagePickerController 。 当用户按下“完成”时它偶尔会冻结。 它经常发生在3GS上 – 大约每三次 – 但我也偶尔在iPhone 5上冻结。这个错误出现在iOS 4.3到7.0。 我无法确定哪些因素与冻结相关。 当我得到这个冻结时,我也没有得到记忆警告。 日志中没有错误,没有crashlog。 正常情况下,应用程序继续在UIImagePickerController后面运行。 在控制台中有很多看起来相关的消息,比如“deny file-write-data / private / var / mobile / Media / PhotoData”,但是当冻结出现时以及一切正在工作时,它们偶尔都会出现好的。 以下是我如何显示选取器: – (void)showPicker:(UIImagePickerControllerSourceType)type { imgPicker = [[[CustomPhotoPicker alloc] init] autorelease]; imgPicker.delegate = self; imgPicker.sourceType = type; imgPicker.allowsEditing = _pickerAllowsEditing; // wrap and show the modal [self showViewControllerModallyInWrapper:imgPicker]; } 这里是委托方法: […]

使用Protobuf-net,我得到了一个有关List <Subclassable>的未知types的exception

我已经开始将我们的Unity / iOS游戏转换为Protobuf-net保存状态。 看起来好像事情一切正常,直到我将这个实例variables添加到GameState [ProtoMember(10)] public List<Unit> fUnits; 单位是 [ProtoContract] [ProtoInclude(21, typeof(ArtilleryUnit))] [ProtoInclude(22, typeof(CavalryArtilleryUnit))] [ProtoInclude(23, typeof(CavalryUnit))] [ProtoInclude(24, typeof(InfantryUnit))] [Serializable] public class Unit : IActionHandler 这是我已经序列化的第一个子类。 我正在通过反编写testing我的代码,写之后 using (Stream memoryStream = new MemoryStream()) { byte[] data = System.Text.Encoding.UTF8.GetBytes(readText); memoryStream.Write(data, 0, data.Length); memoryStream.Position = 0; WBTSSerializer deserializer = new WBTSSerializer(); testState = new GameState(); deserializer.Deserialize(memoryStream, testState, typeof(GameState)); […]

在Unity3d中加载iphone的图像

我使用iOS Unity插件将图像path发送到统一。 在Unity中,我尝试使用接收的path来获取这个图像(我没有其他想法如何将图像从iphone发送到统一)。 问题:我仍然无法获得图像。 WWW错误:在此服务器上找不到请求的URL。 //Tried both "file:///…" and "file://…" string path = "file://var/mobile/Applications/173DE26D-4C0E-4DF7-9DC6-9CBB7D4FC954/Documents/Images/image.png" Texture texture; IEnumerator WaitForRequest(WWW www) { yield return www; if (www.error == null) { texture = www.texture; } } void Start() { WWW www = new WWW(path); StartCoroutine(WaitForRequest(www)); }

Monodevelop iOS Unity无法连接到debugging器

我努力让我的iOS应用程序用monodevelop进行debugging。 Mac连接到运行应用程序的iPad所在的同一networking,并显示在“附加到进程”窗口中,因此可被发现。 防火墙也closures,iPad没有蜂窝networkingfunction。 当我尝试连接时,我得到一个“无法连接到debugging器”的消息。 有没有人有任何想法? 我一直在做大量的谷歌search,但无法find任何答案。