Exemplo n.º 1
0
            void OnRightClick(Vector2 mousePosition)
            {
                GenericMenu genericMenu = new GenericMenu();

                genericMenu.AddItem(new GUIContent("Add node"), false, () => {
                    T node = OnAddNode?.Invoke(mousePosition);
                    _nodes.Add(node);
                });
                genericMenu.ShowAsContext();
            }
        public async ValueTask OnEditCallback(InteropNodeEventData evt)
        {
            switch (evt.Type)
            {
            case "add_nodeTODO":
                // this.invoke_event_handle(jm.event_type.edit, { evt: 'add_node', data: [parent_node.id, nodeid, topic, data], node: nodeid });
                await OnAddNode.InvokeAsync(new MindMapAddNodeEventArgs <T>
                {
                    Node   = FindNode(evt.NodeId),
                    Parent = FindNode(evt.Data[0].GetString()),
                    // NodeId = evt.Data[1].GetString(),
                    // Topic = evt.Data[2].GetString(),
                    Data = JsonSerializer.Deserialize <IDictionary <string, string> >(evt.Data[3].GetRawText())
                });

                break;
            }
        }