public override void DrawDragAndDropPreview()
 {
     if (DragAndDropUtility.Is <ScriptGraphAsset>())
     {
         GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, DragAndDropUtility.Get <ScriptGraphAsset>().name, typeof(ScriptGraphAsset).Icon());
     }
     else if (DragAndDropUtility.Is <StateGraphAsset>())
     {
         GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, DragAndDropUtility.Get <StateGraphAsset>().name, typeof(StateGraphAsset).Icon());
     }
 }
Ejemplo n.º 2
0
        public override void DrawDragAndDropPreview()
        {
            if (DragAndDropUtility.Is <ScriptGraphAsset>())
            {
                GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, DragAndDropUtility.Get <ScriptGraphAsset>().name, typeof(ScriptGraphAsset).Icon());
            }
            else if (DragAndDropUtility.Is <GameObject>())
            {
                var gameObject = DragAndDropUtility.Get <GameObject>();
                GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, gameObject.name + "...", gameObject.Icon());
            }
            else if (DragAndDropUtility.Is <UnityObject>())
            {
                var obj  = DragAndDropUtility.Get <UnityObject>();
                var type = obj.GetType();
                GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, type.HumanName() + "...", type.Icon());
            }
            else if (EditorVariablesUtility.isDraggingVariable)
            {
                var kind = EditorVariablesUtility.kind;
                var name = EditorVariablesUtility.declaration.name;

                string label;

                if (e.alt)
                {
                    label = $"Set {name}";
                }
                else if (e.shift)
                {
                    label = $"Check if {name} is defined";
                }
                else
                {
                    label = $"Get {name}";
                }

                GraphGUI.DrawDragAndDropPreviewLabel(DragAndDropUtility.offsetedPosition, label, BoltCore.Icons.VariableKind(kind));
            }
        }
Ejemplo n.º 3
0
 public void DrawDragAndDropPreview()
 {
     GraphGUI.DrawDragAndDropPreviewLabel(new Vector2(edgePosition.x, outerPosition.yMax), "Replace with: " + DragAndDropUtility.Get <StateGraphAsset>().name, typeof(StateGraphAsset).Icon());
 }