zoukankan      html  css  js  c++  java
  • 一些编辑器开发的代码范例

    class GUIWindowDemo extends EditorWindow
    {
     var windowRect = Rect (100,100,200,200);
     function OnGUI ()
     {
      BeginWindows ();
      windowRect = GUILayout.Window (1, windowRect, DoWindow, "Hi There");
      EndWindows ();
     }
     
     function DoWindow ()
     {
      GUILayout.Button ("Hi");
      GUI.DragWindow ();
     }
     
     @MenuItem ("Test/GUIWindow Demo")
     static function Init () {
     EditorWindow.GetWindow (GUIWindowDemo);
     }
    }

    -------------------------------------------------------------------------------------------------

    class GUIWindowDemo2 extends EditorWindow
    {
     var windowRect = Rect (100,100,200,200);
     var scrollPos = Vector2.zero;
     function OnGUI ()
     {
      scrollPos = GUI.BeginScrollView (
      new Rect (0, 0, position.width, position.height),
      scrollPos,
      new Rect (0, 0, 1000, 1000)
      );

      BeginWindows ();
      windowRect = GUILayout.Window (1, windowRect, DoWindow, "test");
      EndWindows ();
      GUI.EndScrollView ();
     }

     function DoWindow ()
     {
      GUILayout.Button ("Hi");
      GUILayout.Button ("H2");
      GUI.DragWindow ();
     }

     @MenuItem ("Test/GUIWindow Demo 2")
     static function Init ()
     {
      EditorWindow.GetWindow (GUIWindowDemo2);
     }
    }

  • 相关阅读:
    XCode 7 运行 cocos2dx 2.2.6问题小节
    SerializeField和Serializable
    convert2utf8withbom
    NGUI制作字体的三种方法
    js json stringify
    nodejs npm 使用淘宝 NPM 镜像
    js url?callback=xxx xxx的介绍
    强引用 弱引用
    关于xml里的encoding
    js 历史
  • 原文地址:https://www.cnblogs.com/softimagewht/p/1900239.html
Copyright © 2011-2022 走看看