public MarkerNode DeepCopy() { RawMarker copiedMarker = new RawMarker(marker.Position, marker.Size, marker.Category); MarkerNode copiedNode = Construct(copiedMarker); copiedNode.rawPosition = rawPosition; return(copiedNode); }
public static MarkerNode Construct(RawMarker marker) { var node = CreateInstance <MarkerNode>(); node.marker = marker; node.rawPosition = marker.Position; return(node); }
public void AddMarker(RawMarker marker) { if (marker == null) { throw new ArgumentNullException(); } markers.Add(marker); }
/// <summary> /// Create a new marker from an existing one. /// </summary> public static RawMarker DeepCopy(RawMarker marker) { if (marker == null) { throw new ArgumentNullException("marker"); } return(new RawMarker(marker.position, marker.size, marker.category, marker.preset, marker.metaData)); }
public bool RemoveMarker(RawMarker marker) { if (marker == null) { throw new ArgumentNullException(); } bool wasMarkerRemoved = markers.Remove(marker); return(wasMarkerRemoved); }
public void RemoveMarker(RawMarker marker) { if (marker == null) { throw new ArgumentNullException(); } if (!markers.Remove(marker)) { throw new ArgumentException("This chart does not contain the marker."); } }
void CreateMarker(Vector2 position, Vector2 size, string category = "", string preset = "", MetaData metaData = null) { position = (position - dragTotal - PANEL_OFFSET * Vector2.right) / scale; position.y = Map.height - position.y; var marker = new RawMarker(position, size, category, preset, metaData); chart.AddMarker(marker); var markerNode = MarkerNode.Construct(marker); markers.Add(markerNode); SelectedMarker = markerNode; }
public Marker(RawMarker marker, Coord offset) { if (marker == null) { throw new ArgumentNullException("marker"); } size = marker.Size; preset = marker.Preset; category = marker.Category; metaData = marker.MetaData; localPosition = marker.Position; globalPosition = localPosition + offset; }
void CreateMarker(MarkerNode node) { RawMarker marker = node.Marker; CreateMarker(marker.Position, marker.Size, marker.Category, marker.Preset, marker.MetaData); }
Color GetMarkerColor(RawMarker marker) { var category = Palette.GetCategories().FirstOrDefault(cat => cat.name == marker.Category); return(category == null ? Palette.DefaultColor : category.color); }
public static void PasteMarkers(UnityEditor.MenuCommand command) { var targetChart = (ChartStatic)command.context; targetChart.markers.AddRange(_copyContext.Markers.Select(marker => RawMarker.DeepCopy(marker))); }
public MarkerNode DeepCopy() { RawMarker copiedMarker = new RawMarker(marker.Position, marker.Size, marker.Category); return(Construct(copiedMarker)); }