U3D
lzt20007
这个作者很懒,什么都没留下…
展开
-
U3D 代码中旋转NGUI中texture
1. 获取texture的transform Transform t = this.transform.Find("Texture");2. 修改transform的localEulerAngles部分(顺时针旋转为例)float m_RotZ = 0;void Update () { m_RotZ -= 100 * Time.deltaTi原创 2017-01-07 17:45:21 · 1010 阅读 · 0 评论 -
U3D: 先激活、在操作,才能起作用
比如修改一个面板的alpha。下面方法1不起作用,方法2才是正确的。1. this.gameObject.SetActive(false);UIPanel m_Panel = this.GetComponent(); m_Panel.alpha = 1; this.gameObject.SetActive(true);2. this.gameObject.SetA原创 2017-01-08 12:55:44 · 767 阅读 · 0 评论 -
U3D: 设置FPS上限
关闭”垂直同步” Edit->Project Settings->Quality->Other->V Sync Count: Don’t Sync设置上限 Application.targetFrameRate = 40;注意: 经过实际测试:FPS会从原来的70左右,降低到50左右;不是最高40!不知道为啥?垂直同步: http://www.manew.com/blog原创 2017-02-12 16:29:14 · 1294 阅读 · 0 评论 -
U3D:路径
Resources a. 权限:只读,不能动态修改 b. 读取:在主线程,使用Resources.Load c. 打包:在此目录中的资源,会被无条件打进安装包 d. 路径:Assets/ResourcesApplication.dataPath a. 权限:只读 d. 路径: IOS: /var/containers/Bundle/Application/app sandbo转载 2017-03-16 10:35:09 · 679 阅读 · 0 评论 -
U3D:添加、删除Component
1. 添加GameObect.AddComponent();2. 删除Destroy(GameObect.GetComponent());原创 2017-11-07 14:49:58 · 19148 阅读 · 1 评论 -
U3D:Shader固定管线关闭雾
关闭雾: Fog {Mode Off}示例:Shader "Custom/Alpha Blended Fog Off" {Properties {_MainTex ("Particle Texture", 2D) = "white" {}}Category {Tags { "Queue"="Transparent" "IgnoreProjecto原创 2017-12-22 14:22:28 · 1309 阅读 · 0 评论 -
Unity3D:输出按下时,点击到的UI
PointerEventData eventData = new PointerEventData(EventSystem.current);eventData.pressPosition = pos;eventData.position = pos;List<RaycastResult> list = new List<RaycastResult>();Gra...原创 2018-10-26 11:18:49 · 341 阅读 · 0 评论 -
The type `HttpClient` is defined in an assembly that is not referenced
The type `HttpClient` is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 解...原创 2018-11-29 14:32:34 · 833 阅读 · 0 评论