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 }; } }
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 }; } }
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 }; } }
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 }; } }