private void OnDragMenuClick(object o) { Type type = (Type)o; if (_canvas == null) { return; } if (_canvas.Graph == null) { return; } if (type == typeof(ActionNode)) { ActionNode actionNode = (ActionNode)_canvas.Graph.Editor().Repository.CreateNode(type, _lastMousePosition);; actionNode.TargetGameObject = (GameObject)_dragGameObject; } if (type == typeof(FollowMachineNode)) { FollowMachineNode followMachineNode = (FollowMachineNode)_canvas.Graph.Editor().Repository.CreateNode(type, _lastMousePosition);; followMachineNode.FollowMachine = _dragGameObject.GetComponent <FollowMachine>(); followMachineNode.Editor().UpdateFollowMachine(); } if (type == typeof(WindowNode)) { WindowNode windowNode = (WindowNode)_canvas.Graph.Editor().Repository.CreateNode(type, _lastMousePosition);; windowNode.Window = _dragGameObject.GetComponent <MgsUIWindow>(); windowNode.Editor().OnShow(); } if (type == typeof(DialogeNode)) { DialogeNode dialogeNode = (DialogeNode)_canvas.Graph.Editor().Repository.CreateNode(type, _lastMousePosition);; dialogeNode.Window = _dragGameObject.GetComponent <MgsDialougWindow>(); dialogeNode.Editor().OnShow(); } }
public static EDialogeNode Editor(this DialogeNode node) => Editor <EDialogeNode>(node);