参考http://www.bkjia.com/Androidjc/888284.html
不过不用那么麻烦,只需在发布好的XCode工程中,修改Classes\UI\SplashScreen.mm文件...
参考http://www.bkjia.com/Androidjc/888284.html
不过不用那么麻烦,只需在发布好的XCode工程中,修改Classes\UI\SplashScreen.mm文件...
使用WWW.LoadFromCacheOrDownload方法加载文件时,其进度(www.progress)在IOS(iPhone/iPad)上只有0和1两个值,不会(0.1,0.2,0.3……)这样平滑的过渡,但在PC和Android上能正常。
解决方法是:1、按照下面设置好HTTP头,2、将要下载的文件后缀设置好mime类型(application/octet-stream )
参照:http://answers.unity3d.com/questions/594668/wwwprogress-not-working-on-android-ios-1.html
Typically you see this behaviour when the server is returning bad header information. If it's not returning a content length, Unity has no way of giving you progress, since progress is a percentage of the total content length.
Server code :
$attachment_location = 'files/myAssetBundle.unity3d';
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
header("Cache-Control: public");
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: Binary");
header("Content-Length:".filesize($attachment_location));
header("Content-Disposition: attachment; filename=myAssetBundle.unity3d");
readfile($attachment_location);
Die();
在unity3d 4.5.0f6发布IOS后,然后在xcode6编译会出现5个错误(Use of undeclared identifier 'GL_RGBA8_OES'/'GL_DEPTH_COMPONENT24_OES'/'GL_DEPTH24_STENCIL8_OES'等),解决如下
在XCode中的文件CMVideoSampling.mm 里添加:
#include <OpenGLES/ES3/gl.h>
#include <OpenGLES/ES3/glext.h>
同上,在文件GlesHelper.mm 中添加:
#define GL_RGBA8_OES GL_RGBA8
#define glRenderbufferStorageMultisampleAPPLE glRenderbufferStorageMultisample
#define GL_DEPTH_COMPONENT24_OES GL_DEPTH_COMPONENT24
#define GL_DEPTH24_STENCIL8_OES GL_DEPTH24_STENCIL8
1、造成Camera.Render->Drawing->......->Mesh.DrawVBO耗时高的原因是模型没有法线或者在导入设置里未导入法线,并且在Shader中使用了法线相关脚本,如“SCALED_NORMAL”等。
2、造成Camera.Render->......->Shader.Parse耗时高原因是使用了一个未使用过的Shader,吧这个Shader加到Edit->Project Settings->Graphics的Always Included Shaders列表就行了。
3、切换场景或者创建新对象时Mesh.Bake PHYSX CollisionData用时高,那可能是对象有复杂Mesh并且附加了Mesh Collider组件,需创建简单Mesh代替。
4、烘焙lightmap时出现“primary uv set on is incorrect and the secondary uv set is missing”,可能是模型对象在导入设置选择了压缩。