mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
!W(Node Editor Widnow) exposed set Lock
This commit is contained in:
parent
3761aa1361
commit
8454b1f1a6
@ -8,9 +8,9 @@ using Object = UnityEngine.Object;
|
|||||||
namespace XNodeEditor {
|
namespace XNodeEditor {
|
||||||
[InitializeOnLoad]
|
[InitializeOnLoad]
|
||||||
public partial class NodeEditorWindow : EditorWindow,IHasCustomMenu {
|
public partial class NodeEditorWindow : EditorWindow,IHasCustomMenu {
|
||||||
|
|
||||||
public bool Lock { get; private set; }
|
public bool Lock { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Magic method which Unity detects automatically.
|
/// Magic method which Unity detects automatically.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -18,7 +18,7 @@ namespace XNodeEditor {
|
|||||||
void ShowButton(Rect position) {
|
void ShowButton(Rect position) {
|
||||||
Lock = GUI.Toggle(position, Lock, GUIContent.none, "IN LockButton");
|
Lock = GUI.Toggle(position, Lock, GUIContent.none, "IN LockButton");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddItemsToMenu(GenericMenu menu)
|
public void AddItemsToMenu(GenericMenu menu)
|
||||||
{
|
{
|
||||||
menu.AddItem(new GUIContent("Lock"), Lock, () => {
|
menu.AddItem(new GUIContent("Lock"), Lock, () => {
|
||||||
@ -46,7 +46,7 @@ namespace XNodeEditor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NodeEditorWindow current;
|
public static NodeEditorWindow current;
|
||||||
|
|
||||||
/// <summary> Stores node positions for all nodePorts. </summary>
|
/// <summary> Stores node positions for all nodePorts. </summary>
|
||||||
@ -121,10 +121,10 @@ namespace XNodeEditor {
|
|||||||
graphEditor.OnWindowFocus();
|
graphEditor.OnWindowFocus();
|
||||||
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
|
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
|
||||||
}
|
}
|
||||||
|
|
||||||
dragThreshold = Math.Max(1f, Screen.width / 1000f);
|
dragThreshold = Math.Max(1f, Screen.width / 1000f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnLostFocus() {
|
void OnLostFocus() {
|
||||||
if (graphEditor != null) graphEditor.OnWindowFocusLost();
|
if (graphEditor != null) graphEditor.OnWindowFocusLost();
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ namespace XNodeEditor {
|
|||||||
w = EditorWindow.CreateInstance<NodeEditorWindow>();
|
w = EditorWindow.CreateInstance<NodeEditorWindow>();
|
||||||
w.titleContent = new GUIContent("xNode");
|
w.titleContent = new GUIContent("xNode");
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Show(true);
|
w.Show(true);
|
||||||
w.Focus();
|
w.Focus();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user