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);
     }
    }

  • 相关阅读:
    cookie和session会话技术
    hdoj 1176 免费馅饼
    nyoj 14 会场安排问题
    hdoj 1575 Tr A
    poj 1163 The Triangle
    hdoj 2157 How many ways??
    贪心Poj1328
    贪心 序列
    差分约束Poj 3169 Layout
    差分约束Poj3159 Candies
  • 原文地址:https://www.cnblogs.com/softimagewht/p/1900239.html
Copyright © 2011-2022 走看看