Unity3D开发随手笔记

Pivot和Center区别 坐标指示轴的作用
http://316studio.blog.163.com/blog/static/126773529200982525014643/

Time.frameCount
从一开始到现在累计的总帧数

Animation Controllers Tutorials
http://www.raywenderlich.com/66523/unity-2d-tutorial-animation-controllers

Resources与StreamingAssets文件夹的区别
http://www.blogbus.com/flbh-logs/251368633.html
Unity3D研究院之手游开发中所有特殊的文件夹

获取某个Shader里的参数值
Material.GetFloat

怎么让一个Plane刚好覆盖满摄像头的范围
How to make a plane fill the field of view?

    1. using UnityEngine;
    2. public class FillScreen:MonoBehaviour
    3. {
    4. void Update()
    5. {
    6. Camera cam = Camera.main;
    7. float pos = (cam.nearClipPlane + 0.01f);
    8. transform.position = cam.transform.position + cam.transform.forward * pos;
    9. transform.LookAt (cam.transform);
    10. transform.Rotate (90.0f, 0.0f, 0.0f);
    11. float h = (Mathf.Tan(cam.fov*Mathf.Deg2Rad*0.5f)*pos*2f) /10.0f;
    12. transform.localScale = new Vector3(h*cam.aspect,1.0f, h);
    13. }
    14. }

其中,可以修改0.01的值,它表示Plane距离摄像机有多远。

Render Texture
创建一个Texture,这个Texture的内容是一个Camera看到的实时画面,然后这个Texture可以贴在其它物体上。有点像现实中的摄像头把拍摄到的画面在显示器上显示出来。
http://docs.unity3d.com/Manual/class-RenderTexture.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值