跪求unity3d中unity 场景渲染天空盒天空盒怎么用代码控制

3463人阅读
我们先来讲一下,怎么样自制一个天空盒吧,其实很简单,先创建一个material,取好名字,然后更改属性为Skybox/6 Sided,并且把六个面的图片都选好,如下图:
注意图片在太空盒的位置啊~~天空盒就这样做好了,那么修改天空盒呢?
在菜单栏Window属性下,选中Lighting,会出现下面对话框:
Scene中有Skybox属性,可以选择material,这里有系统默认的天空盒,也有自制的天空盒,更换之后天空盒会有改变。
可以给摄像机添加一个组件-Keybox,在这里也可以直接修改。
上面是在unity中手动修改天空盒,但是有些游戏中要求我们在游戏进行中自动更改天空盒,这时候就需要代码了。我们来一个小小练习,使用代码每隔5秒更改一次太空盒:
我把脚本挂在了摄像机上,记得把你做好的太空盒拖进数组中哦~(其实用Resource.load&&()去获取最好了~但这里只是展示核心代码)
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:3503次
排名:千里之外君,已阅读到文档的结尾了呢~~
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
unity3d天空盒的使用
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Skybox 天空盒_unity3d游戏脚本制作教程-游戏蛮牛出品
Unity 脚本手册
Skybox 天空盒
Inherits from
A script interface for the skybox component.
用于天空盒组件的一个脚本接口。
The skybox class has only the
Skybox类只有一个属性。
Variables变量
The material used by the skybox.
用于天空盒的材质。
Inherited members继承成员
Inherited Variables继承变量
Enabled Behaviours are Updated, disabled Behaviours are not.
启用行为被更新,禁用行为不更新。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(Read Only). (null if there is none attached)
附加到(游戏物体)(只读)(如无附加则为空)。
attached to this
(Read Only). (null if there is none attached)
附加到(游戏物体)(只读)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
The game object this component is attached to. A component is always attached to a game object.
组件附加的游戏物体。一个组件总是被附加到一个游戏物体。
The tag of this game object.
游戏物体的标签。
The name of the object. //物体的名字
Should the object be hidden, saved with the scene or modifiable by the user?
物体是否被隐藏、保存在场景中或被用户修改?
Inherited Functions继承函数
Returns the component of Type type if the game object has one attached, null if it doesn't.
如果游戏物体有一个附加,则返回Type类型的组件,如果没有则为null。

参考资料

 

随机推荐