本文整理汇总了C#中EditorWindow类的典型用法代码示例。如果您正苦于以下问题:C# EditorWindow类的具体用法?C# EditorWindow怎么用?C# EditorWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EditorWindow类属于命名空间,在下文中一共展示了EditorWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: SetEditorWindowTabIcon
//--------------------------------------
// Properties
//--------------------------------------
// PUBLIC
// PUBLIC STATIC
// PRIVATE
// PRIVATE STATIC
//--------------------------------------
// Methods
//--------------------------------------
// PUBLIC
// PUBLIC STATIC
/// <summary>
/// Sets the editor window tab icon.
/// </summary>
/// <param name='cachedTitleContent'>
/// Cached title content.
/// </param>
/// <param name='tabIcon_texture2D'>
/// Tab icon_texture2 d.
/// </param>
public static void SetEditorWindowTabIcon (EditorWindow editorWindow, Texture2D tabIcon_texture2D)
{
//TODO, MOVE THIS TO A PROPERTY SO WE DON'T CALL 'GETPROPERTY' MORE THAN NEEDED (JUST ONCE?)
PropertyInfo cachedTitleContent;
//if (cachedTitleContent == null) {
cachedTitleContent = typeof(EditorWindow).GetProperty("cachedTitleContent", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
//}
if (cachedTitleContent != null) {
GUIContent titleContent = cachedTitleContent.GetValue(editorWindow, null) as GUIContent;
if (titleContent != null) {
titleContent.image = tabIcon_texture2D;
//titleContent.text = "Super Cool3"; // <= here goes the title of your window
}
}
}
开发者ID:eyalzur,项目名称:CodeSamplesPublic,代码行数:58,代码来源:EditorWindowUtility.cs
示例17: MemoryTreeList
public MemoryTreeList(EditorWindow editorWindow, MemoryTreeList detailview)
{
this.m_EditorWindow = editorWindow;
this.m_DetailView = detailview;
this.m_ControlID = GUIUtility.GetPermanentControlID();
this.SetupSplitter();
}
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:MemoryTreeList.cs
示例18: DeregisterSelectedPane
protected void DeregisterSelectedPane(bool clearActualView)
{
if (this.m_ActualView != null)
{
if (this.GetPaneMethod("Update") != null)
{
EditorApplication.update = (EditorApplication.CallbackFunction) Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.SendUpdate));
}
if (this.GetPaneMethod("ModifierKeysChanged") != null)
{
EditorApplication.modifierKeysChanged = (EditorApplication.CallbackFunction) Delegate.Remove(EditorApplication.modifierKeysChanged, new EditorApplication.CallbackFunction(this.SendModKeysChanged));
}
if (this.m_ActualView.m_FadeoutTime != 0f)
{
EditorApplication.update = (EditorApplication.CallbackFunction) Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.m_ActualView.CheckForWindowRepaint));
}
if (clearActualView)
{
EditorWindow actualView = this.m_ActualView;
this.m_ActualView = null;
this.Invoke("OnLostFocus", actualView);
this.Invoke("OnBecameInvisible", actualView);
}
}
}
开发者ID:randomize,项目名称:VimConfig,代码行数:25,代码来源:HostView.cs
示例19: AddDefaultItemsToMenu
protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow view)
{
if (menu.GetItemCount() != 0)
{
menu.AddSeparator(string.Empty);
}
if (base.parent.window.showMode == ShowMode.MainWindow)
{
menu.AddItem(EditorGUIUtility.TextContent("Maximize"), !(base.parent is SplitView), new GenericMenu.MenuFunction2(this.Maximize), view);
}
else
{
menu.AddDisabledItem(EditorGUIUtility.TextContent("Maximize"));
}
menu.AddItem(EditorGUIUtility.TextContent("Close Tab"), false, new GenericMenu.MenuFunction2(this.Close), view);
menu.AddSeparator(string.Empty);
System.Type[] paneTypes = base.GetPaneTypes();
GUIContent content = EditorGUIUtility.TextContent("Add Tab");
foreach (System.Type type in paneTypes)
{
if (type != null)
{
GUIContent content2;
content2 = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(type)) {
text = content.text + "/" + content2.text
};
menu.AddItem(content2, false, new GenericMenu.MenuFunction2(this.AddTabToHere), type);
}
}
}
开发者ID:randomize,项目名称:VimConfig,代码行数:30,代码来源:DockArea.cs
示例20: ASHistoryWindow
public ASHistoryWindow(EditorWindow parent)
{
float[] relativeSizes = new float[] { 30f, 70f };
int[] minSizes = new int[] { 60, 100 };
this.m_HorSplit = new SplitterState(relativeSizes, minSizes, null);
this.m_ScrollPos = Vector2.zero;
this.m_RowHeight = 0x10;
this.m_HistoryControlID = -1;
this.m_ChangesetSelectionIndex = -1;
this.m_AssetSelectionIndex = -1;
this.m_ChangeLogSelectionRev = -1;
this.m_Rev1ForCustomDiff = -1;
this.m_ChangeLogSelectionGUID = string.Empty;
this.m_ChangeLogSelectionAssetName = string.Empty;
this.m_SelectedPath = string.Empty;
this.m_SelectedGUID = string.Empty;
this.m_DropDownMenuItems = new GUIContent[] { EditorGUIUtility.TextContent("Show History"), emptyGUIContent, EditorGUIUtility.TextContent("Compare to Local"), EditorGUIUtility.TextContent("Compare Binary to Local"), emptyGUIContent, EditorGUIUtility.TextContent("Compare to Another Revision"), EditorGUIUtility.TextContent("Compare Binary to Another Revision"), emptyGUIContent, EditorGUIUtility.TextContent("Download This File") };
this.m_DropDownChangesetMenuItems = new GUIContent[] { EditorGUIUtility.TextContent("Revert Entire Project to This Changeset") };
this.m_FileViewWin = new ASHistoryFileView();
this.m_ParentWindow = parent;
ASEditorBackend.SettingsIfNeeded();
if (Selection.objects.Length != 0)
{
this.m_FileViewWin.SelType = ASHistoryFileView.SelectionType.Items;
}
}
开发者ID:randomize,项目名称:VimConfig,代码行数:26,代码来源:ASHistoryWindow.cs
注:本文中的EditorWindow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论