Example #1
0
 private void OnNodeEvent(NodeEvent ev)
 {
     if (ev.eventType == NodeEvent.EventType.Touched)
     {
         SelectNode(ev.eventSourceNode);
     }
 }
Example #2
0
        private void HandleNodeEvent()
        {
            switch (Event.current.rawType)
            {
            case EventType.MouseUp:
            {
                if (Event.current.button == 0)
                {
                    var ev = new NodeEvent
                    {
                        eventType           = NodeEvent.EventType.Touched,
                        eventSourceNode     = this,
                        globalMousePosition = Event.current.mousePosition + nodeRect.position,
                    };

                    // redirect to manager
                    NodeEventHandler.Invoke(ev);
                }
            }
            break;

            default:
                break;
            }
        }