首页 > Windows开发 > 详细

C#绘制准心脚本

时间:2014-11-23 00:33:09      阅读:329      评论:0      收藏:0      [点我收藏+]

欢迎来到unity学习unity培训、unity企业培训教育专区,这里有很多U3D资源U3D培训视频U3D教程U3D常见问题U3D项目源码,我们致力于打造业内unity3d培训、学习第一品牌。

 

texture.width >> 1和(texture.height >>是右移一位,相当于除以2。(x >> 1) 和 (x / 2) 的结果是一样的。

 

01

void OnGUI()

02

 

03

{

04

 

05

//绘制准心

06

 

07

Rect  rect = new Rect(Input.mousePosition.x - (texture.width >> 1),

08

 

09

Screen.height - Input.mousePosition.y - (texture.height >> 1),

10

 

11

texture.width, texture.height);

12

 

13

GUI.DrawTexture(rect, texture);

14

 

15

}

16

 

17

 

更多精彩请点击 http://www.gopedu.com/

C#绘制准心脚本

原文:http://www.cnblogs.com/Unity3Dqishituan/p/4115960.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!