Пример #1
0
            void ProcessCone(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var loopeds = chunk.GetNativeArray(loopedHandle);
                var cones   = chunk.GetNativeArray(coneHandle);

                for (int i = 0; i < chunk.Count; i++)
                {
                    emitters[firstEntityIndex + i] = new LoopedEmitter
                    {
                        source    = loopeds[i],
                        transform = RigidTransform.identity,
                        cone      = cones[i],
                        useCone   = true
                    };
                }
            }
Пример #2
0
            void ProcessNoTransform(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var loopeds = chunk.GetNativeArray(loopedHandle);
                AudioSourceEmitterCone cone = default;

                for (int i = 0; i < chunk.Count; i++)
                {
                    emitters[firstEntityIndex + i] = new LoopedEmitter
                    {
                        source    = loopeds[i],
                        transform = RigidTransform.identity,
                        cone      = cone,
                        useCone   = false
                    };
                }
            }
Пример #3
0
            void ProcessRotationCone(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var loopeds   = chunk.GetNativeArray(loopedHandle);
                var rotations = chunk.GetNativeArray(rotationHandle);
                var cones     = chunk.GetNativeArray(coneHandle);

                for (int i = 0; i < chunk.Count; i++)
                {
                    emitters[firstEntityIndex + i] = new LoopedEmitter
                    {
                        source    = loopeds[i],
                        transform = new RigidTransform(rotations[i].Value, float3.zero),
                        cone      = cones[i],
                        useCone   = true
                    };
                }
            }
Пример #4
0
            void ProcessLtwCone(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var loopeds = chunk.GetNativeArray(loopedHandle);
                var ltws    = chunk.GetNativeArray(ltwHandle);
                var cones   = chunk.GetNativeArray(coneHandle);

                for (int i = 0; i < chunk.Count; i++)
                {
                    var ltw = ltws[i];
                    emitters[firstEntityIndex + i] = new LoopedEmitter
                    {
                        source    = loopeds[i],
                        transform = new RigidTransform(quaternion.LookRotationSafe(ltw.Forward, ltw.Up), ltw.Position),
                        cone      = cones[i],
                        useCone   = true
                    };
                }
            }