void UpdateEvent(string name) { ChartEditor editor = ChartEditor.Instance; if (currentChartEvent != null) { ChartEvent newChartEvent = new ChartEvent(currentChartEvent.tick, name); editor.commandStack.Push(new SongEditModify <ChartEvent>(currentChartEvent, newChartEvent)); editor.SelectSongObject(newChartEvent, editor.currentChart.events); } else if (currentEvent != null) { Event newEvent = new Event(name, currentEvent.tick); editor.commandStack.Push(new SongEditModify <Event>(currentEvent, newEvent)); editor.SelectSongObject(newEvent, editor.currentSong.events); } else { Debug.LogError("Trying to update event when object is not recognised as an event"); } }