public NodePointData(int index, string nodeGUID, ConnectionPointType pointType, string parameterType, string parameterName) : base() { this.index = index; this.nodeGUID = nodeGUID; this.pointType = pointType; this.parameterType = parameterType; this.parameterName = parameterName; //unityengine.vector3 어셈블리 이름 타입에 적어줘야함 this.cachedValue = NodeGUIUtility.GetDefaultValue(NodeGUIUtility.GetType(parameterType))?.ToString() ?? "null"; }
private static GUIStyle ConnectionPoint(ConnectionPointType type, Skin skin) { string styleName = CONNECTION_POINT + type; return(new GUIStyle { name = styleName, normal = { background = GetTexture(styleName + StyleState.Normal + skin) }, hover = { background = GetTexture(styleName + StyleState.Hover + skin) }, imagePosition = ImagePosition.ImageOnly }); }
public ConnectionPoint(Node node, ConnectionPointType type, GUIStyle style, Action <ConnectionPoint> onClickConnectionPoint, Action <ConnectionPoint> onClickRemoveConnectionPoint, Action <ConnectionPoint, int> onClickMoveConnectionPoint) { Node = node; Type = type; _style = style; _onClickConnectionPoint = onClickConnectionPoint; _onClickRemoveConnectionPoint = onClickRemoveConnectionPoint; _onClickMoveConnectionPoint = onClickMoveConnectionPoint; Rect = new Rect(0, 0, 20f, 20f); }
//初期化 public NodeConnectionPoint(Node node, ConnectionPointType type, GUIStyle style, Action <NodeConnectionPoint> OnClickConnectionPoint, NextStateJudge judge = null) { this.node = node; //親 this.type = type; //タイプ this.style = style; //スタイル this.OnClickConnectionPoint = OnClickConnectionPoint; rect = new Rect(0, 0, 10f, 20f); //座標 if (judge != null) { myNextStateJudge = judge; } }
/// <summary> ///Constructor. /// </summary> /// <param name="connectionType">Tipo de conector</param> /// <param name="parent">Padre del conector.</param> public ConnectionPointWpf(ConnectionPointType connectionType, Component parent) : base(connectionType, parent) { if (connectionType == ConnectionPointType.Input) { this.canvasPath = "CanvasConnectionPointInput.xaml"; } else { this.canvasPath = "CanvasConnectionPointOutput.xaml"; } }
public ConnectionPoint(Node node, string inname, string name, float deltay, ConnectionPointType type, GUIStyle style) { this._outLabel = Regex.Replace(name, "(\\B[A-Z])", " $1"); inLabel = inname; this.node = node; this.type = type; this.style = style; _deltaY = deltay; rect = new Rect(0, 0, 10f + (string.IsNullOrEmpty(inLabel) ? 0 : 100), 20f); left = new Vector2(rect.x, rect.y + (rect.height / 2)); labelRect = new Rect(node.rect.xMin, node.rect.y + _deltaY - 15f, node.rect.width - 20, 25); inLabelRect = new Rect(rect.x + 4, rect.y - 1, rect.width, rect.height); }
public ConnectionPoint(SimpleNodeBase _targetNode, ConnectionPointType _type, GUIStyle _style, Action <ConnectionPoint> _onClickConnectionPoint, int _targetItemId = -1) { targetNode = _targetNode; targetNodeId = targetNode.Id; targetItemId = _targetItemId; Type = _type; Style = _style; OnClickConnectionPoint = _onClickConnectionPoint; myRect = new Rect(0, 0, 13f, 13f); }
public List <NodePointData> GetPointData(ConnectionPointType type) { List <NodePointData> retVal = new List <NodePointData>(); foreach (var guid in funcNodeData.points) { NodePointData point = guidMap.GetData <NodePointData>(guid); if (point.pointType == type) { retVal.Add(point); } } return(retVal); }
public ConnectionPoint(Node node, int id, ConnectionPointType type, Action <ConnectionPoint> OnClickConnectionPoint) { this.node = node; this.id = id; this.type = type; this.OnClickConnectionPoint = OnClickConnectionPoint; if (type == ConnectionPointType.Output) { style = "outputPoint"; } if (type == ConnectionPointType.Input) { style = "InputPoint"; } }
// ######################## INITS ######################## // public ConnectionPoint(TNode node, ConnectionPointType type, int index, int numOfSamePoints, GUIStyle style, DelOnClickConnectionPoint OnClick) { PointNode = node; Type = type; Index = index; _numOfPointsOnNode = numOfSamePoints; _style = style; OnClickConnectionPoint += OnClick; PointRect = new Rect(0, 0, 10f, 20f); _labelStyle = new GUIStyle(); _labelStyle.normal.textColor = Color.white; _labelStyle.stretchWidth = true; _labelRect = new Rect(PointRect.position.x, PointRect.position.x, 0, PointRect.height); }
public ConnectionPointView(INodeView nodeView, ConnectionPointType type) { _rect = new Rect(0, 0, Width, Height); _nodeView = nodeView; _type = type; switch (type) { case ConnectionPointType.In: _style = StylesCollection.GetStyle(VntStyles.ConnectionIn); break; case ConnectionPointType.Out: _style = StylesCollection.GetStyle(VntStyles.ConnectionOut); break; } }
public ConnectionPoint(BaseNode node, ConnectionPointType type) { base.GenId(); this.node = node; this.type = type; switch (this.type) { case ConnectionPointType.In: this.style = BTEditorWindow.inPointStyle; break; case ConnectionPointType.Out: this.style = BTEditorWindow.outPointStyle; break; } this.rect = new Rect(0, 0, 10f, 20f); }
/// <summary> /// Adds the connection point to the in/out list as well as adding it to the asset database /// </summary> /// <param name="p"></param> protected IConnectionPoint AddConnectionPoint <TOne, TTwo>(ConnectionPointType type) where TOne : ConnectionPoint_Generic <TTwo> { TOne newPoint = CreateInstance <TOne>(); newPoint.Init(this, type); if (type == ConnectionPointType.In) { inPoints.Add(newPoint); } else { outPoints.Add(newPoint); } AssetDatabase.AddObjectToAsset(newPoint, graph); AssetDatabase.SaveAssets(); return(newPoint); }
// TODO splint into two classses public ConnectionPoint( GUIDialogueNode parent, ConnectionPointType type, GUIDialogueReply replyParent = null, int verticalPos = 0 ) { this.parent = parent; this.replyParent = replyParent; this.type = type; connections = new HashSet <Connection>(); if (type == ConnectionPointType.In) { style = inPointStyle; } else { style = outPointStyle; } rect = new Rect(0, 0, 10f, 20f); this.verticalPos = verticalPos; }
public ConnectionPoint(NodeWindow node, ConnectionPointType type, Action <ConnectionPoint> OnClickConnectionPoint) { var ohBehave = EditorWindow.GetWindow <OhBehaveEditorWindow>(); blueprint = ohBehave.treeBlueprint; this.nodeWindow = node; this.type = type; if (type == ConnectionPointType.In) { unConnectedstyle = OhBehaveEditorWindow.InPointStyle; } else { unConnectedstyle = OhBehaveEditorWindow.OutPointStyle; } this.OnClickConnectionPoint = OnClickConnectionPoint; connectedStyle = new GUIStyle(); connectedStyle.normal.background = unConnectedstyle.hover.background; rect = new Rect(0, 0, unConnectedstyle.normal.background.width, unConnectedstyle.normal.background.height); }
public void Init(SDEComponent parent, ConnectionPointType connectionType) { base.Init(SDEComponentType.ConnectionPoint, parent, new Rect(0, 0, ConnectionManager.CONNECTIONPOINT_WIDTH, ConnectionManager.CONNECTIONPOINT_HEIGHT), SDEStyles.connectionPointDefault, SDEStyles.connectionPointDefault, SDEStyles.connectionPointSelected); this.connectionType = connectionType; // determine what method to be called when clicked if (this.connectionType == ConnectionPointType.In) { this.OnClickConnectionPoint = ConnectionManager.OnClickInPoint; } else { this.OnClickConnectionPoint = ConnectionManager.OnClickOutPoint; } this.connections = new List <Connection>(); }
public List <int> Add(TargetShapes targets, string fx, string fy, ConnectionPointType type) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); targets = targets.ResolveShapes(this._client); if (targets.Shapes.Count < 1) { return(new List <int>(0)); } int dirx = 0; int diry = 0; var indices = new List <int>(targets.Shapes.Count); using (var undoscope = this._client.Application.NewUndoScope("Add Connection Point")) { var cp = new ConnectionPointCells(); cp.X = fx; cp.Y = fy; cp.DirX = dirx; cp.DirY = diry; cp.Type = (int)type; foreach (var shape in targets.Shapes) { int index = ConnectionPointHelper.Add(shape, cp); indices.Add(index); } } return(indices); }
public ConnectionPoint(Node node, ConnectionPointType type, Action <ConnectionPoint> OnClickConnectionPoint) { this.node = node; this.type = type; rect = new Rect(0, 0, 10f, 20f); style = new GUIStyle(); style.border = new RectOffset(4, 4, 12, 12); switch (type) { case ConnectionPointType.In: style.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left.png") as Texture2D; style.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left on.png") as Texture2D; break; case ConnectionPointType.Out: style.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right.png") as Texture2D; style.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right on.png") as Texture2D; break; } this.OnClickConnectionPoint = OnClickConnectionPoint; }
public ConnectionPoint ( ENodeBase node, ConnectionPointType type, GUIStyle style, Action <ConnectionPoint> onClickConnectionPoint, string id = null ) { //connection type Type = type; //visuals rect = new Rect(0, 0, 10f, 20f); Style = style; //parent node ParentNode = node; //Point action OnClickConnectionPoint = onClickConnectionPoint; this.id = id ?? Guid.NewGuid().ToString(); }
public virtual void Serialize(ConnectionPoint connectionPoint) { base.SetId(connectionPoint); //Debug.Log(">point data " + this.id); this.type = connectionPoint.type; }
/// <summary> /// Constructor que inicializa el ConnectionPointType para el ConnectionPoint /// </summary> /// <param name="connectionPointType">ConnectionPointType para el ConnectionPoint</param> public ConnectionPoint(ConnectionPointType connectionPointType) { this.ConnectionPointType = connectionPointType; }
//widthFraction and heightFraction determine the location of the ConnectionPoint on the UIElement. ConnectionPoint CreateConnectionPoint(UIElement element, double widthFraction, double heightFraction, EdgeLocation location, ConnectionPointType type) { ConnectionPoint connectionPoint = new ConnectionPoint(); connectionPoint.EdgeLocation = location; connectionPoint.PointType = type; connectionPoint.ParentDesigner = element; BindingOperations.SetBinding(connectionPoint, ConnectionPoint.LocationProperty, GetConnectionPointBinding(element as FrameworkElement, widthFraction, heightFraction)); return connectionPoint; }
public InteruptConnectionPoint(BaseNode node, ConnectionPointType type, GUIStyle style, Action <ConnectionPoint> OnClickConnectionPoint) : base(node, type, style, OnClickConnectionPoint) { }
static ConnectionPoint GetClosestConnectionPointNotOfType(ConnectionPoint srcConnectionPoint, List <ConnectionPoint> targetConnectionPoints, ConnectionPointType illegalConnectionPointType) { double minDist; List <ConnectionPoint> filteredConnectionPoints = new List <ConnectionPoint>(); foreach (ConnectionPoint connPoint in targetConnectionPoints) { if (connPoint.PointType != illegalConnectionPointType && !connPoint.Equals(srcConnectionPoint) && connPoint.AttachedConnectors.Count == 0) { filteredConnectionPoints.Add(connPoint); } } return(GetClosestConnectionPoint(srcConnectionPoint, filteredConnectionPoints, out minDist)); }
public ConnectionPoint(Node node, ConnectionPointType type) { Node = node; _type = type; }
public ProgressionConnectionPoint(BaseNode node, ConnectionPointType type, GUIStyle style, Action <ConnectionPoint> OnClickConnectionPoint) : base(node, type, style, OnClickConnectionPoint) { }
public void Rebuild(Node node, ConnectionPointType type, Action <ConnectionPoint> OnClickConnectionPoint) { this.node = node; this.type = type; this.OnClickConnectionPoint = OnClickConnectionPoint; }
public ConnectionPoint() { pointType = ConnectionPointType.Default; attachedConnectors = new List <Connector>(); this.parentDesigner = null; }
public EventConnectPoint(Node node, ConnectionPointType type, GUIStyle style, string title = "", int maxConnect = 1) : base(node, type, style, title, maxConnect) { }
public NodeConnectionPoint(Node node, ConnectionPointType type, GUIStyle style, Action <ConnectionPointBase> onClickConnectionPoint, string id = null) : base(type, style, onClickConnectionPoint) { this.node = node; }
public void Ini(ConnectionPointType type) { this.type = type; }
public ConnectionPoint() { pointType = ConnectionPointType.Default; attachedConnectors = new List<Connector>(); this.parentDesigner = null; }