Esempio n. 1
0
        static public List <Game8_Sequencer.NoteData> getNotes()
        {
            {
                // Read file
                TextAsset asset = Resources.Load("notes_2") as TextAsset;
                byte[]    file  = asset.bytes;
                // byte[] file = File.ReadAllBytes("Assets/EditorOnFireFileParser/Resources/notes_2.eof");

                // Get file header
                char[] fileHeader = (from header in file.Take(8) select Convert.ToChar(header)).ToArray();

                // Get chart properties
                ChartProperties chartProperties = new ChartProperties(file);

                // Get song properties
                SongProperties songProperties = new SongProperties(file);

                // Get chart data
                ChartData chartData = new ChartData(file, songProperties.endByteIndex);

                // Get tracks data
                TrackData tracks = new TrackData(file, chartData.endByteIndex);

                LegacyTrack t = tracks.tracks.OfType <LegacyTrack>().ElementAt(0);

                List <Game8_Sequencer.NoteData> notes = new List <Game8_Sequencer.NoteData>();

                foreach (var note in t.notes)
                {
                    // For each lane in this note (one "note" can be one note on each 2 lanes for Deadly Riff) we add a note to the sequencer
                    for (int i = 0; i < 2; i++)
                    {
                        if (note.lanes[i])
                        {
                            // Convert from millisecond to second
                            if (note.length <= 1)
                            {
                                notes.Add(new Game8_Sequencer.NoteData((float)note.position / 1000, i, 0.0f));
                            }
                            else
                            {
                                notes.Add(new Game8_Sequencer.NoteData((float)note.position / 1000, i, (float)note.length / 1000));
                            }
                        }
                    }
                }

                return(notes);
            }
        }
Esempio n. 2
0
        void Start()
        {
            // Read file
            byte[] file = File.ReadAllBytes("Assets/EditorOnFireFileParser/Resources/notes_2.eof");

            // Get file header
            char[] fileHeader = getFileHeader(file);

            // Get chart properties
            ChartProperties chartProperties = new ChartProperties(file);

            // Get song properties
            SongProperties songProperties = new SongProperties(file);

            // Get chart data
            ChartData chartData = new ChartData(file, songProperties.endByteIndex);

            // Get tracks data
            TrackData tracks = new TrackData(file, chartData.endByteIndex);

            Debug.Log(tracks.endByteIndex);
        }