My first feeble attempt is to create a script and attach it to the main camera.
I managed to do it error free, but how do i access it to modify its content?
Here is my script:
using UnityEngine;
using System.Collections;
public class Song : MonoBehaviour {
// Home for the Main Data structure
// Is an Array of Measures
// Each Measure is an array of Chords
// Each Chord is an array of Notes
// Each Note is an Array of Game Objects
public class Notes
{
public GameObject[] Sound;
}
public class Chords
{
public Notes[] Note;
}
public class Measures
{
public Chords[] Chord;
}
public int MaxMeasures;
public int ChordsPerMeasure;
public int NotesPerChord;
public int MaxObjectsPerNote;
Measures[] Measure;
void Start()
{
Measures[] NewMeasures = new Measures[MaxMeasures];
Measure = NewMeasures;
int M = 0;
for (M = 0; M < MaxMeasures; M++)
{
Measure[M] = new Measures();
Measure[M].Chord = new Chords[ChordsPerMeasure];
int C = 0;
for (C = 0; C < ChordsPerMeasure; C++)
{
Measure[M].Chord
= new Chords();
Measure[M].Chord[C].Note = new Notes[NotesPerChord];
int N = 0;
for (N = 0; N < NotesPerChord; N++)
{
Measure[M].Chord[C].Note[N] = new Notes();
Measure[M].Chord[C].Note[N].Sound = new GameObject[MaxObjectsPerNote];
int S = 0;
for (S = 0; S < MaxObjectsPerNote; S++)
{
Measure[M].Chord[C].Note[N].Sound[S] = null;
}
}
}
}
}
}