Ejemplo n.º 1
0
            void ProcessCone(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var oneshots = chunk.GetNativeArray(oneshotHandle);
                var cones    = chunk.GetNativeArray(coneHandle);

                for (int i = 0; i < chunk.Count; i++)
                {
                    emitters[firstEntityIndex + i] = new OneshotEmitter
                    {
                        source    = oneshots[i],
                        transform = RigidTransform.identity,
                        cone      = cones[i],
                        useCone   = true
                    };
                }
            }
Ejemplo n.º 2
0
            void ProcessNoTransform(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var oneshots = chunk.GetNativeArray(oneshotHandle);
                AudioSourceEmitterCone cone = default;

                for (int i = 0; i < chunk.Count; i++)
                {
                    emitters[firstEntityIndex + i] = new OneshotEmitter
                    {
                        source    = oneshots[i],
                        transform = RigidTransform.identity,
                        cone      = cone,
                        useCone   = false
                    };
                }
            }
Ejemplo n.º 3
0
            void ProcessRotationCone(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var oneshots  = chunk.GetNativeArray(oneshotHandle);
                var rotations = chunk.GetNativeArray(rotationHandle);
                var cones     = chunk.GetNativeArray(coneHandle);

                for (int i = 0; i < chunk.Count; i++)
                {
                    emitters[firstEntityIndex + i] = new OneshotEmitter
                    {
                        source    = oneshots[i],
                        transform = new RigidTransform(rotations[i].Value, float3.zero),
                        cone      = cones[i],
                        useCone   = true
                    };
                }
            }
Ejemplo n.º 4
0
            void ProcessLtwCone(ArchetypeChunk chunk, int firstEntityIndex)
            {
                var oneshots = chunk.GetNativeArray(oneshotHandle);
                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 OneshotEmitter
                    {
                        source    = oneshots[i],
                        transform = new RigidTransform(quaternion.LookRotationSafe(ltw.Forward, ltw.Up), ltw.Position),
                        cone      = cones[i],
                        useCone   = true
                    };
                }
            }