x


Unity iPhone - Using the file system in my app/game?

Hi all,

My question is probably best asked by explaining what I need to do...

I am making a music based app/game where each "level" needs to pull in note-based information so that the level knows where notes should be played on the timeline. In order to do this, i've been advised that I should perhaps have a folder named "Songs" and in this folder, each song has a folder, "Song_001" for example. In a song folder you'll find files which contain note information for any given instrument. For example, drums might have the following files:

  • snare.notes
  • kick.notes
  • hihat.notes
  • crash.notes

In each of these files would be '1 note per line' and each note would have information for note timing and hit-type (accented, ghosted, ruffed for example) via a comma separated list.

The idea is that i'll load in these .notes files and parse them into dota that I can use in the game...

What I need to know is how to go about finding these files via the file system? I can build my own paths to find the files, but i couldn't find any information on how to go about actually locating files and pulling them in? Keep in mind this is for Unity iPhone. Hopefully that makes sense.

lastly, just want to say thanks for all the fantastic answers i've received in past questions, this place is amazing.

Thanks

Mat

more ▼

asked Apr 22 '10 at 09:10 AM

Mat Brummitt gravatar image

Mat Brummitt
220 21 23 32

Your game sounds like a really good idea, I wish I could help.

Apr 22 '10 at 10:15 AM alexnode
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The easiest way is to use a TextAsset. (Despite the name you can use it to read bytes as well as text.) If you really need actual file system access, use the http://System.IO classes and file members. Keep in mind that what's available depends on what version of .net you're using (e.g., using 1.1 means that ReadAllBytes isn't available). You'd also need to make use of Application.dataPath when doing this.

more ▼

answered Apr 22 '10 at 07:26 PM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x242
x204
x151
x78
x52

asked: Apr 22 '10 at 09:10 AM

Seen: 2831 times

Last Updated: Apr 22 '10 at 09:10 AM