Skip to content

Unity AudioSource pooling system usable from ECS

Notifications You must be signed in to change notification settings

Sroka/EcsAudioBridge

Repository files navigation

EcsAudioBridge

Unity AudioSource pooling system usable from ECS

How to use

In order to use just add EcsAudioSource component to object. It will automatically add AudioSource and read all data from it

To play audio from ECS system just call Play() or PlayOneShot() method on a component:

            Entities.ForEach((ref EcsAudioSource ecsAudioSource, ) =>
            {
                if (/* Some condition */)
                {
                    ecsAudioSource.PlayOneShot();
                }
            }).Schedule();
            Entities.ForEach((ref EcsAudioSource ecsAudioSource, ) =>
            {
                if (/* Some condition */)
                {
                    ecsAudioSource.Play();
                }
            }).Schedule();

About

Unity AudioSource pooling system usable from ECS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages