private void Create(string instrument) { Synthesizer synthesizer = Instantiate(this.synthesizer); synthesizer.Initialize(GetInstrument(instrument)); synthesizer.allowKeyboard = synthesizers.Count == 0; synthesizers.Add(synthesizer); }
public void Initialize(Synthesizer synthesizer) { this.synthesizer = synthesizer; foreach (var generator in synthesizer.preset.Generators) { VoiceGenerators voice = new GameObject("Voice").AddComponent <VoiceGenerators>(); voice.Initialize(this, generator); voice.transform.SetParent(transform); voices.Add(voice); } }