コード例 #1
0
        public void Init(ContextMenuData node)
        {
            nameText.text = node.name;

            bool hasSubMenu = node.children.Count > 0;

            subContextIcon.gameObject.SetActive(hasSubMenu);

            if (hasSubMenu)
            {
                button.onClick.AddListener(
                    () =>
                {
                    var container = Utility.CreatePrefab <ContextContainer>("Prefabs/ContextContainer", subContextTransform);
                    container.Init(node.children /*[0].children*/.ToArray());
                    SignalSystem.InvokeMenuItemClicked(node, container);
                }
                    );
            }
            else
            {
                button.onClick.AddListener(
                    () =>
                {
                    node.callback?.Invoke();
                }
                    );
            }
        }
コード例 #2
0
        public void OnEndDrag(PointerEventData eventData)
        {
            foreach (var item in eventData.hovered)
            {
                var input = item.GetComponent <SocketInput>();
                if (input != null)
                {
                    SignalSystem.InvokeOutputSocketDragDropTo(input);
                    return;
                }
            }

            SignalSystem.InvokeOutputSocketDragDropTo(null);
        }
コード例 #3
0
 public void OnDrag(PointerEventData eventData)
 {
     SignalSystem.InvokeSocketDragFrom(this);
 }
コード例 #4
0
 public void OnPointerClick(PointerEventData eventData)
 {
     SignalSystem.InvokeOutputSocketClick(this, eventData);
 }
コード例 #5
0
 public void OnDrag(PointerEventData eventData)
 {
     SignalSystem.InvokeNodePointerDrag(_parentNode, eventData);
 }
コード例 #6
0
 public void OnPointerClick(PointerEventData eventData)
 {
     SignalSystem.InvokeNodePointerClick(_parentNode, eventData);
 }
コード例 #7
0
 public void OnPointerClick(PointerEventData eventData)
 {
     SignalSystem.InvokeNodeConnectionPointerClick(connId, eventData);
 }