예제 #1
0
    void SceneUpdate(SceneView SceneView)
    {
        if (EditorApplication.isCompiling)
        {
            DestroyImmediate(this);
            return;
        }
        Handles.BeginGUI();
        this.BuildLayout();
        if (GUI.Button(this.resButton, "资源"))
        {
            this.showResWindow = !this.showResWindow;
        }
        if (GUI.Button(this.closeButton, "关闭"))
        {
            ResWindow.Clear();
            //EntityWindow.Clear();

            DestroyImmediate(this);
        }
        if (this.showResWindow)
        {
            GUI.Window(GUIUtility.GetControlID(FocusType.Passive), this.resWindow, new GUI.WindowFunction(ResWindow.OnGUI), "资源");
        }
        Handles.EndGUI();
        this.InputReaction();
    }
예제 #2
0
 private void OnDestroy()
 {
     //SceneResData.SaveCache();
     ResWindow.Clear();
     //EntityWindow.Clear();
     //DungeonCache.Destroy();
     SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Remove(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.SceneUpdate));
     this.sceneView.maximized     = false;
 }
예제 #3
0
 public static void OnGUI(int id)
 {
     if (!ResWindow.inited)
     {
         ResWindow.window = ScriptableObject.CreateInstance <ResWindow>();
         ResWindow.window.Init();
     }
     ResWindow.scrollView = GUILayout.BeginScrollView(ResWindow.scrollView, new GUILayoutOption[0]);
     ResWindow.window.DrawPrefab();
     GUILayout.EndScrollView();
 }
    private void button_Click(object sender, RoutedEventArgs e)
    {
        ResButton btn       = sender as ResButton;
        ResWindow ResWindow = new ResWindow();

        ResWindow.Closing += (s1, e1) => {
            ResWindow win = s1 as ResWindow;
            //do something here with ResWindow.PersonName and ResWindow.MovieName
            //you can access the btn variable here as well
        };
        ResWindow.Show();
    }