public bool HasSameNode(ConnectionPoint point) { var otherId = point.targetItemId > -1 ? point.targetItemId : point.targetNodeId; if (targetItemId > -1) { if (targetItemId == otherId) { return(true); } } else { if (targetNodeId == otherId) { return(true); } } return(false); }
public Connection(ConnectionPoint inPoint, ConnectionPoint outPoint, Action <Connection> OnClickRemoveConnection) { this.InPoint = inPoint; this.OutPoint = outPoint; this.OnClickRemoveConnection = OnClickRemoveConnection; }
//set node basic style (Imported) public void SetNodeStyle(GUIStyle nodeStyle, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, Action <ConnectionPoint> onClickInPoint, Action <ConnectionPoint> onClickOutPoint, Action <NodeBase> onClickCopyNode, Action <NodeBase> onClickRemoveNode) { Style = nodeStyle; InPoint = new ConnectionPoint(this, ConnectionPointType.In, inPointStyle, onClickInPoint); OutPoint = new ConnectionPoint(this, ConnectionPointType.Out, outPointStyle, onClickOutPoint); DefaultNodeStyle = nodeStyle; SelectedNodeStyle = selectedStyle; OnCopyNode = onClickCopyNode; OnRemoveNode = onClickRemoveNode; WhiteTxtStyle = new GUIStyle(); WhiteTxtStyle.normal.textColor = Color.white; WhiteTxtStyle.focused.textColor = Color.yellow; if (ActionType == ActionTypes.StartPoint) { WhiteTxtStyle.fontSize = 20; WhiteTxtStyle.fontStyle = FontStyle.Bold; } //set titles switch (ActionType) { case ActionTypes.CharacterSpriteInfos: Title = "Character sprite"; break; case ActionTypes.CharacterOutInfos: Title = "Character out"; break; case ActionTypes.DialogBox: Title = "Dialog"; break; case ActionTypes.BrancheBox: Title = "Branches"; break; case ActionTypes.BackgroundImage: Title = "Background"; break; case ActionTypes.CGImage: Title = "CG"; break; case ActionTypes.Music: Title = "Background music"; break; case ActionTypes.Sound: Title = "Sound"; break; case ActionTypes.Delayer: Title = "Delayer"; break; case ActionTypes.ChangeStoryLine: Title = "Play storyline"; break; case ActionTypes.ChangeScene: Title = "Change scene"; break; } }