void OnEnable() { Load(); SelectedMarker = null; if (markers == null) { markers = properties.chart == null ? new List <MarkerNode>() : properties.chart.Markers.Select(m => MarkerNode.Construct(m)).ToList(); } }
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; }
void LoadChart(ChartStatic chart) { if (chart == null) { markers.Clear(); chartName = string.Empty; } else { markers = chart.Markers.Select(m => MarkerNode.Construct(m)).ToList(); chartName = chart.name; } }