From 354f7d10d8f484d3e74308eda32a1a9ac90fe3e2 Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Tue, 24 Sep 2019 13:49:26 +0800 Subject: [PATCH] =?UTF-8?q?!W=20=E6=96=B0=E5=A2=9E=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E5=9C=A8Group=E4=B8=AD=E7=9A=84=E5=9D=90?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/Editor/NodeEditor.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index 8d293ab..c923984 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -89,6 +89,13 @@ namespace XNodeEditor { else return 208; } + public Vector2 GetCurrentMousePosition() + { + var pos = this.target.position + Event.current.mousePosition; + pos.x = pos.x - target.position.x; + return pos; + } + /// Returns color for target node public virtual Color GetTint() { // Try get color from [NodeTint] attribute