Exemple #1
0
        public void PasteSelection()
        {
            if (mCopyDo == null)
            {
                return;
            }
            var pos = mCopyDo.GetSelectionPositin();

            mCopyDo.deltaPosition = AIGraph.CalculateLocalPosition(GlobalMousePosition) - pos;
            DoEdit(mCopyDo);
        }
Exemple #2
0
 bool InteractCraphClick(EMouseButton btn, Vector2 mousePos)
 {
     if (btn == EMouseButton.left)
     {
         if (IsRequestParentOrChild && mAssetBinder.targetTree != null)
         {
             mContextNode = RaycastNode;
             mContextPos  = AIGraph.CalculateLocalPosition(mousePos);
             sNodeMenu.Display(this, new Rect(Event.current.mousePosition, Vector2.zero));
         }
         else
         {
             ClearSelection();
         }
         return(true);
     }
     else if (btn == EMouseButton.right)
     {
         if (RaycastNode != null && !mSelection.Contains(RaycastNode))
         {
             ClearSelection();
         }
         mContextNode = RaycastNode;
         mContextPos  = AIGraph.CalculateLocalPosition(mousePos);
         if (Application.isPlaying)
         {
             DisplayDebugMenu(new Rect(Event.current.mousePosition, Vector2.zero));
             //EditorUtility.DisplayCustomMenu(new Rect(mousePos, Vector2.zero), mRuntimeMenu, -1, OnRuntimeMenuSelected, null);
         }
         else if (IsRequestParentOrChild)
         {
             RequestChild(null);
         }
         else
         {
             DisplayEditMenu(new Rect(Event.current.mousePosition, Vector2.zero));
         }
         return(true);
     }
     return(false);
 }
Exemple #3
0
 private bool InteractGraphKeyDown(KeyCode key)
 {
     if (key == KeyCode.Delete)
     {
         DeleteSelections();
         return(true);
     }
     else if (key == KeyCode.C && Event.current.control)
     {
         CopySelection();
         return(true);
     }
     else if (!Application.isPlaying && !Event.current.alt && !Event.current.control && !Event.current.shift &&
              mAssetBinder != null && mAssetBinder.targetTree != null)
     {
         mContextNode = RaycastNode;
         mContextPos  = AIGraph.CalculateLocalPosition(GlobalMousePosition);
         sHotkeyMenu.Display(this, new Rect(Event.current.mousePosition, Vector2.zero), key);
     }
     return(false);
 }