private PlaySound SpawnBlackKey(int setID, int soundKeyID, PlaySound.SoundKey targetSoundKey) { float zOffset = offset * setID + soundKeyID * 0.5f; Vector3 position = new Vector3(0, 0.3f, zOffset); GameObject blackKey = Instantiate(BlackKeyPrefab, position, Quaternion.identity, transform); PlaySound playSound = blackKey.GetComponentInChildren <PlaySound>(); playSound.pitchOffset = setID; playSound.soundKey = targetSoundKey; playSound.LoadAudioClip(); return(playSound); }