Esempio n. 1
0
        public void SaveCurrentMapToDisk()
        {
            BeatMapData dataToSave = new BeatMapData();

            if (beatMapData == null)
            {
                BeatMap.Log("Current map data not available to save");
                return;
            }
            if (state != EditorState.Editing && state != EditorState.Recording &&
                state != EditorState.PlaybackPaused)
            {
                BeatMap.Log("Call to save when not in proper state - " + state);
                return;
            }
            else
            {
                Debug.LogWarning("data song file name - " + beatMapData.songFileName);
                dataToSave = BeatMapData.CopyBMDNotNotes(dataToSave, beatMapData);
                float              throwAwayFirstBeats = (dataToSave.beatsPerMinute / 16.5f);
                NoteDetails[]      notes    = GetAllNotes(true);
                List <NoteDetails> filtered = new List <NoteDetails>();
                for (int count = 0; count < notes.Length; count++)
                {
                    if (notes[count].timeToSpawn < throwAwayFirstBeats)
                    {
                    }
                    else
                    {
                        Debug.LogWarning("Accepting note " + notes[count].timeToSpawn + "-" +
                                         notes[count].inverted);
                        filtered.Add(notes[count]);
                    }
                }
                Debug.LogWarning("Notes - " + notes.Length + " filtered - " + filtered.Count);
                dataToSave.notes = filtered.ToArray();
            }
            Log("Call to save with # of notes " + dataToSave.notes.Length);
            Utilities.SaveToDisk(dataToSave);
        }