unity3d 控制OnGUI

来源:互联网 发布:淘宝刚开店没单怎么办 编辑:程序博客网 时间:2024/06/05 18:06
  1. 有时我们想要在一些按钮或鼠标事件之后在让OnGUI画出里面的东西、
  2. bool down = false;
  3. void OnGUI()
  4. {
  5.   if (down)
  6.       GUILayout.Label("had mouse down");
  7.  
  8.   if (Event.current.type == EventType.MouseDown)
  9.       down = true;
  10. }



参考:http://forum.unity3d.com/threads/29058-error-with-no-side-effects

原创粉丝点击