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

Unity3D开发随手笔记

2015-09-05 21:54 597 查看
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?

[code]    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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: