By this.ParentContainer you get root control of the hierarchy, it is UIContainer. Not just near parent. Hm, maybe rename it to RootParentContainer..
UI system is based on the component system as other components. You can use Parent, Components properties. All controls on the screen inside one hierarchy.
Yes, this.ParentContainer.GetComponents().
You can be free from UI to play sounds. UIContainer.PlaySound is just useful method. Source code:
public virtual void PlaySound( string name )
{
if( string.IsNullOrEmpty( name ) )
return;
var mode = Transform3D != null ? SoundModes.Mode3D : 0;
SoundData sound = SoundWorld.SoundCreate( name, mode );
if( sound == null )
return;
var channel = SoundWorld.SoundPlay( null, sound, EngineApp.DefaultSoundChannelGroup, 0.5, true );
if( channel != null )
{
if( Transform3D != null )
channel.Position = Transform3D.Position;
channel.Pause = false;
}
}
To play long ogg files add SoundModes.Stream flag.