当前位置: 首页>>代码示例>>C#>>正文


C# EditorWindow类代码示例

本文整理汇总了C#中EditorWindow的典型用法代码示例。如果您正苦于以下问题:C# EditorWindow类的具体用法?C# EditorWindow怎么用?C# EditorWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EditorWindow类属于命名空间,在下文中一共展示了EditorWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AttachView

 public bool AttachView(EditorWindow parent, ScriptableObject webView, bool initialize = false)
 {
     this.parentWin = parent;
     this.internalWebView = webView;
     if (this.internalWebView != null)
     {
         this.hostView = Tools.GetReflectionField<object>(parent, "m_Parent");
         this.dockedGetterMethod = this.parentWin.GetType().GetProperty("docked", Tools.FullBinding).GetGetMethod(true);
         if (this.hostView != null && dockedGetterMethod != null)
         {
             if (initialize)
             {
                 Rect initViewRect = new Rect(0, 20, this.parentWin.position.width, this.parentWin.position.height - ((this.IsDocked()) ? 20 : 40));
                 this.InitWebView(this.hostView, (int)initViewRect.x, (int)initViewRect.y, (int)initViewRect.width, (int)initViewRect.height, false);
                 this.SetHideFlags(HideFlags.HideAndDontSave);
                 this.AllowRightClickMenu(true);
             }
         }
         else
         {
             throw new Exception("Failed to get parent window or docked property");
         }
     }
     return (this.internalWebView != null);
 }
开发者ID:Temechon,项目名称:Babylon.js,代码行数:25,代码来源:WebBrowser.cs

示例2: gridDiffs_CellClick

 private void gridDiffs_CellClick(object sender, DataGridViewCellEventArgs e)
 {
   try
   {
     if (e.ColumnIndex == colCompare.DisplayIndex && e.RowIndex >= 0)
     {
       var diff = (InstallItemDiff)gridDiffs.Rows[e.RowIndex].DataBoundItem;
       if (diff.DiffType == DiffType.Different)
       {
         Settings.Current.PerformDiff("Left"
           , s => ToAml(s, diff.LeftScript)
           , "Right"
           , s => ToAml(s, diff.RightScript));
       }
       else
       {
         using (var dialog = new EditorWindow())
         {
           dialog.AllowRun = false;
           dialog.Script = Utils.FormatXml(diff.LeftScript ?? diff.RightScript);
           dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
           dialog.ShowDialog(this);
         }
       }
     }
   }
   catch (Exception ex)
   {
     Utils.HandleError(ex);
   }
 }
开发者ID:rneuber1,项目名称:InnovatorAdmin,代码行数:31,代码来源:Compare.cs

示例3: ShowWindow

 public static void ShowWindow()
 {
     GUIContent newWindowContent = new GUIContent("PlatformGenerator", (Texture)AssetDatabase.LoadAssetAtPath("Assets/Art/PlatformTiles/tile5.png", typeof(Texture)), "Tool to generate new platforms with width and height");
     _window = EditorWindow.GetWindow(typeof(PlatformGenerateEditor));
     _platformGenerator = new PlatformGenerator();
     _window.titleContent = newWindowContent;
 }
开发者ID:mennolp098,项目名称:Boom-Boom-Boomerang,代码行数:7,代码来源:PlatformGenerateEditor.cs

示例4: gridDiffs_CellClick

 private void gridDiffs_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
       {
     if (e.ColumnIndex == colCompare.DisplayIndex && e.RowIndex >= 0)
     {
       var diff = (InstallItemDiff)gridDiffs.Rows[e.RowIndex].DataBoundItem;
       if (diff.DiffType == DiffType.Different)
       {
     var diffWin = new ADiff.DiffWindow();
     diffWin.LeftText = diff.LeftScript.OuterXml;
     diffWin.RightText = diff.RightScript.OuterXml;
     ElementHost.EnableModelessKeyboardInterop(diffWin);
     diffWin.Show();
       }
       else
       {
     using (var dialog = new EditorWindow())
     {
       dialog.AllowRun = false;
       dialog.AmlGetter = o => Utils.FormatXml(diff.LeftScript ?? diff.RightScript);
       dialog.DisplayMember = "Name";
       dialog.DataSource = new List<InstallItemDiff>() { diff };
       dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
       dialog.ShowDialog(this);
     }
       }
     }
       }
       catch (Exception ex)
       {
     Utils.HandleError(ex);
       }
 }
开发者ID:Barnickle,项目名称:InnovatorAdmin,代码行数:34,代码来源:Compare.cs

示例5: ShowWindow

        public static void  ShowWindow () 
        {
            _window = EditorWindow.GetWindow(typeof(MapTool));

            _window.maxSize = new Vector2(600f, 400f);
            _window.minSize = _window.maxSize;
        }
开发者ID:emilienregent,项目名称:ggj2016,代码行数:7,代码来源:MapTool.cs

示例6: GrabSingleView

    private void GrabSingleView(EditorWindow view, FileInfo targetFile, OutputFormat format)
    {
        var width = Mathf.FloorToInt(view.position.width);
        var height = Mathf.FloorToInt(view.position.height);

        Texture2D screenShot = new Texture2D(width, height);

        this.HideOnGrabbing();

        var colorArray = InternalEditorUtility.ReadScreenPixel(view.position.position, width, height);

        screenShot.SetPixels(colorArray);

        byte[] encodedBytes = null;
        if (format == OutputFormat.jpg)
        {
            encodedBytes = screenShot.EncodeToJPG();
        }
        else
        {
            encodedBytes = screenShot.EncodeToPNG();
        }

        File.WriteAllBytes(targetFile.FullName, encodedBytes);

        this.ShowAfterHiding();
    }
开发者ID:xfleckx,项目名称:MF_Unity3D_Utilities,代码行数:27,代码来源:WindowGrabber.cs

示例7: GetCenterRect

		public static Rect GetCenterRect(EditorWindow editorWindow, float width, float height) {
			
			var size = editorWindow.position;
			
			return new Rect(size.width * 0.5f - width * 0.5f, size.height * 0.5f - height * 0.5f, width, height);
			
		}
开发者ID:Cyberbanan,项目名称:Unity3d.UI.Windows,代码行数:7,代码来源:FlowSystemEditor.cs

示例8: AddCurvesPopupHierarchyGUI

 public AddCurvesPopupHierarchyGUI(TreeView treeView, AnimationWindowState state, EditorWindow owner) : base(treeView, true)
 {
     this.plusButtonStyle = new GUIStyle("OL Plus");
     this.plusButtonBackgroundStyle = new GUIStyle("Tag MenuItem");
     this.owner = owner;
     this.state = state;
 }
开发者ID:demelev,项目名称:projectHL,代码行数:7,代码来源:AddCurvesPopupHierarchyGUI.cs

示例9: DrawIconButton

    public static bool DrawIconButton(string buttonLabel, Texture2D buttonIcon, EditorWindow edWindow = null, EditorStyles buttonStyle = null)
    {
        bool clicked = false;
        Rect buttonRect = EditorGUILayout.BeginVertical("box");

        if (GUI.Button(buttonRect, new GUIContent("", "Tooltip"), GetFoldoutButton())){
            //toggleDropDown = (toggleDropDown ? false : true);
        }

        GUILayout.Space(5f);
        EditorGUILayout.BeginHorizontal();
        if(clicked){
            GUILayout.Label("[     ]", GetLargeLabelIcon());
            //GUILayout.Label("[  V  ]", largeLabelIcon);
        }
        else
        {
            GUILayout.Label("  []  ", GetLargeLabelIcon());
        }
        GUILayout.Label(buttonLabel, GetLargeLabel());
        EditorGUILayout.EndHorizontal();
        GUILayout.Space(8f);
        EditorGUILayout.EndVertical();
        return clicked;
    }
开发者ID:JonathanPalmerGD,项目名称:Cryomancer,代码行数:25,代码来源:DarkwindStyles.cs

示例10: GDEDrawHelper

        public GDEDrawHelper(EditorWindow window, float topBuf=2f, float leftBuf=2f, float bottomBuf = 2f, float rightBuf=2f, float lineHeight=20f)
        {
            if (mainHeaderStyle.IsNullOrEmpty())
            {
                mainHeaderStyle = new GUIStyle(GUI.skin.label);
                mainHeaderStyle.fontSize = 20;
                mainHeaderStyle.fontStyle = FontStyle.Bold;
            }

            if (subHeaderStyle.IsNullOrEmpty())
            {
                subHeaderStyle = new GUIStyle(GUI.skin.label);
                subHeaderStyle.fontSize = mainHeaderStyle.fontSize - 4;
                subHeaderStyle.fontStyle = FontStyle.Bold;
            }

            TopBuffer = topBuf;
            LeftBuffer = leftBuf;
            BottomBuffer = bottomBuf;
            RightBuffer = rightBuf;
            LineHeight = lineHeight;

            windowHandle = window;
            SizeCache = new Dictionary<string, Vector2>();

            ResetToTop();
        }
开发者ID:wang-yichun,项目名称:Sadyrinth,代码行数:27,代码来源:GDEDrawHelper.cs

示例11: EmptyEditor

 public EmptyEditor(string name, EditorWindow window)
 {
     this.name = name;
     this.window = window;
     this.toolbarIndex = 0;
     this.requiresDatabase = false;
 }
开发者ID:predominant,项目名称:Treasure_Chest,代码行数:7,代码来源:EmptyEditor.cs

示例12: Draw

 private void Draw(EditorWindow caller, float listElementWidth)
 {
   Rect rect = new Rect(0.0f, 0.0f, listElementWidth, 16f);
   this.DrawHeader(ref rect, SceneRenderModeWindow.Styles.sShadedHeader);
   for (int index = 0; index < SceneRenderModeWindow.sRenderModeCount; ++index)
   {
     DrawCameraMode drawCameraMode = (DrawCameraMode) index;
     switch (drawCameraMode)
     {
       case DrawCameraMode.ShadowCascades:
         this.DrawSeparator(ref rect);
         this.DrawHeader(ref rect, SceneRenderModeWindow.Styles.sMiscellaneous);
         break;
       case DrawCameraMode.DeferredDiffuse:
         this.DrawSeparator(ref rect);
         this.DrawHeader(ref rect, SceneRenderModeWindow.Styles.sDeferredHeader);
         break;
       case DrawCameraMode.Charting:
         this.DrawSeparator(ref rect);
         this.DrawHeader(ref rect, SceneRenderModeWindow.Styles.sGlobalIlluminationHeader);
         break;
     }
     EditorGUI.BeginDisabledGroup(this.IsModeDisabled(drawCameraMode));
     this.DoOneMode(caller, ref rect, drawCameraMode);
     EditorGUI.EndDisabledGroup();
   }
   bool disabled = this.m_SceneView.renderMode < DrawCameraMode.Charting || this.IsModeDisabled(this.m_SceneView.renderMode);
   this.DoResolutionToggle(rect, disabled);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:29,代码来源:SceneRenderModeWindow.cs

示例13: SetWindowValues

        public static void SetWindowValues(EditorWindow editor, Texture icon, string title)
        {

            GUIContent guiContent;
            if (m_windowContentDict == null) 
                m_windowContentDict = new Dictionary<EditorWindow, GUIContent>();
            
            if (m_windowContentDict.ContainsKey(editor))
            {
                guiContent = m_windowContentDict[editor];
                if (guiContent != null)
                {
                    if (guiContent.image != icon) guiContent.image = icon;
                    if (title != null && guiContent.text != title) guiContent.text = title;
                    return;
                }
                m_windowContentDict.Remove(editor);
            }

            guiContent = getContent(editor);
            if (guiContent != null)
            {
                if (guiContent.image != icon) guiContent.image = icon;
                if (title != null && guiContent.text != title) guiContent.text = title;
                m_windowContentDict.Add(editor, guiContent);
            }
        }
开发者ID:hydrater,项目名称:Lucid,代码行数:27,代码来源:EditorUtils.cs

示例14: RemoveFailedToLoadWindowDockedWithInspector

 private static void RemoveFailedToLoadWindowDockedWithInspector(EditorWindow[] allWindows)
 {
     EditorWindow inspectorWindow = null;
     foreach (EditorWindow editorWin in allWindows)
     {
         if (editorWin.GetType().ToString() == "UnityEditor.InspectorWindow")
         {
             inspectorWindow = editorWin;
             break;
         }
     }
   
     if (inspectorWindow != null)
     {
         foreach (EditorWindow editorWin in allWindows)
         {
             if (editorWin.GetType().ToString() == "UnityEditor.FallbackEditorWindow") //cleans up old unused windows to deal with Unity layout bug
             {
                 if (editorWin.position == inspectorWindow.position) //if docked
                 {
                     editorWin.Close();
                      break;
                 }
             }
         }
     }
 }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:27,代码来源:PPEditorWindow.cs

示例15: getContent

 static GUIContent getContent(EditorWindow editor)
 {
     const BindingFlags bFlags = BindingFlags.Instance | BindingFlags.NonPublic;
     PropertyInfo p = typeof(EditorWindow).GetProperty("cachedTitleContent", bFlags);
     if (p == null) return null;
     return p.GetValue(editor, null) as GUIContent;
 }
开发者ID:hydrater,项目名称:Lucid,代码行数:7,代码来源:EditorUtils.cs


注:本文中的EditorWindow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。