您的位置:首页 > 移动开发 > Unity3D

Unity3d五 android 设置背景透明的方法

2017-08-15 10:08 1301 查看
unity3d 设置背景透明
http://forum.china.unity3d.com/thread-22474-1-1.html //如何将Unity3D场景背景透明或者将背景替换成安卓(iOS)视图

背景用另一个相机渲染

- 如果仅仅是在U3D端把背景图的GameObject设置为透明,导入到Android中完全不起作用;

- 如果在U3D中把背景通过一个独立的Camera来渲染,然后通过Camera的开关来隐藏背景(甚至于直接删除背景图的GameObject,

Camera设置为depth only或也直接删除),导入到Android后显示的将会是一个黑色背景

- 同样的情况,在IOS端,可以看到在U3D的View中,有一个root-view,在把U3D的View置于IOS的View上之后,只要把这个root-view设置为透明,

就可以做到让我们在U3D中布置的UI或模型(无背景或透明背景)显示在IOS的Native背景之上 {注意:要做到这一点,U3D中比较无背景,

或背景由独立的Camera来渲染,并通过这个Camera的开关来隐藏或显示U3D的背景}

- unity的窗体透明加shader的方式能在window下实现,但导到android运行的时候还是黑色的

- 花钱申请unity3d源码,或者反编译unity-class.jar(有混淆),把UnityPlaye构造方法下的(.getHolder().setFormat(2);)地方的2改成1

- 用的是unity4.2的版本,其他版本好不行,没试。 //http://tieba.baidu.com/p/4862485959

通过RenderText获取到Unity中的颜色数据然后发到安卓端显示。也可以用Unity4.2.0(好像必须用这个版本)把相机设置成背景透明,然后再安卓端获取Unity的窗口显示出来。

- unity5.5的话,addView后图片背景始终是白色的; 用unity4.7添加后图片正常显示,图片背景的FrameLayout背景是透明的; //http://bbs.csdn.net/topics/392147380

- android:style/Theme.Translucent只需要在Manifest中需要透明的Activity内设置theme为以上任意一个就可以了 //http://www.jianshu.com/p/946e3ef9b9fe

- windows下无背景的小头像、桌面精灵(窗体透明)//http://blog.csdn.net/dark00800/article/details/70314432

- unity3d 如何将贴图的黑色背景变为透明, 在ps中将图片处理成带通道的tif格式文件,记住:必须是带通道的,

然后再U3D中选用一种支持通道的shader即可实现背景透明。//https://zhidao.baidu.com/question/564040521.html

- 快照 //http://www.ceeger.com/forum/read.php?tid=32570

- //http://bbs.csdn.net/topics/392147380

- //http://blog.csdn.net/mvpstevenlin/article/details/51195267

- Android显示Unity视图//http://blog.csdn.net/liujunjie612/article/details/45478921

- //http://answers.unity3d.com/questions/1101449/unity-export-with-transparent-background.html

- this works only with unity 4.2 and below... not unity 4.3 since they changed how the view is constructed 

//https://stackoverflow.com/questions/17705364/unityplayer-as-a-subview-with-transparent-background-unity-game-engine

// http://answers.unity3d.com/questions/1221400/unity5-transparent-unityplayer-view-in-android.html
- You can now animate your VR drawings using Google’s new Tilt Brush Toolkit with Unity integration

//https://www.theverge.com/2017/1/20/14340346/google-open-source-tilt-brush-toolkit-unity-integration

//https://docs.google.com/document/d/1YID89te9oDjinCkJ9R65bLZ3PpJk1W4S1SM2Ccc6-9w/edit#heading=h.hi5egaagwpgj

- Unity3D研究院之UGUI安卓自动ETC1通道分离(升级你的unity到5.5) //http://www.xuanyusong.com/archives/4279

英文关键词:

unity3d android background transparent

Tilt Brush Unity SDK
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: