2015年8月7日

unity, get Canvas Scaler referenceResolution

摘要: 需要usingUnityEngine.UI;然后就可以访问到CanvasScaler组件。float width=GetComponent().referenceResolution.xfloat height=GetComponent().referenceResolution.y 阅读全文

posted @ 2015-08-07 18:08 wantnon 阅读(1473) 评论(0) 推荐(0)

unity, change parent and keep localPosition or worlPosition

摘要: node.parent=othernode等价于node.setParent(othernode,true),是保持世界坐标不变。 node.setParent(othernode,false)则可以实现保持node的局部坐标不变。 参考:http://tieba.baidu.com/p/43970 阅读全文

posted @ 2015-08-07 15:16 wantnon 阅读(441) 评论(0) 推荐(0)

unity, access sprite of UGUI Image

摘要: 首先需要usingUnityEngine.UI;然后调用下面语句就不报错了:Image.GetComponent().sprite参考:http://answers.unity3d.com/questions/794139/获得Image的width和height:Image.GetComponen... 阅读全文

posted @ 2015-08-07 13:20 wantnon 阅读(342) 评论(0) 推荐(0)

unity, UGUI Text outline

摘要: UGUI Text的勾边效果是通过添加component实现的:Add Component->UI->Effects->Outline参考:http://www.cnblogs.com/hont/p/4321347.html 阅读全文

posted @ 2015-08-07 13:11 wantnon 阅读(922) 评论(0) 推荐(0)

unity, sprite atlas

摘要: 一, Sprite Packer可以直接在unity里放碎图,只要将Texture Type选为Sprite(2D and UI),Sprite Mode选为Single,再把想打在一张大图里的碎图指定为相同的Packing Tag,将来就会自动合并了。如果想预览,可以打开菜单->Window->S... 阅读全文

posted @ 2015-08-07 13:06 wantnon 阅读(780) 评论(0) 推荐(0)

导航