Chatterer.chatterer.add_new_backgroundsource C# (CSharp) Method

add_new_backgroundsource() private method

private add_new_backgroundsource ( ) : void
return void
        private void add_new_backgroundsource()
        {
            backgroundsource_list.Add(new BackgroundSource());

            int x = backgroundsource_list.Count - 1;

            backgroundsource_list[x].background_player = new GameObject();
            backgroundsource_list[x].background_player.name = "rbr_background_player_" + backgroundsource_list.Count;
            backgroundsource_list[x].audiosource = backgroundsource_list[x].background_player.AddComponent<AudioSource>();
            backgroundsource_list[x].audiosource.volume = 0.3f;
            backgroundsource_list[x].audiosource.panLevel = 0;
            backgroundsource_list[x].current_clip = "Default";

            if (dict_background_samples.Count > 0)
            {
                set_background_clip(backgroundsource_list[x]);  //set clip
            }
        }
chatterer