Megacity demo game for UOS
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

32 行
989 B

using Unity.Entities;
using Unity.Mathematics;
namespace Unity.MegaCity.Audio
{
/// <summary>
/// Instantiate AudioSources GameObjects.
/// Collects all kind of emitters in the Scene, and creates one KDTree per Emitter type.
/// Every frame iterates the KDTree to search for the nearest positions from the camera.
/// Later if set the positions for the Audio Sources and plays them.
/// If a building is added or removed, updates the KDTree data.
/// </summary>
public struct SoundEmitter : IComponentData
{
public int definitionIndex;
public float3 position;
public float3 direction;
}
public struct AllEmitterData
{
public BlobArray<int> DefIndexBeg;
public BlobArray<int> DefIndexEnd;
public BlobArray<SingleEmitterData> Emitters;
}
public struct SingleEmitterData
{
public float3 Position;
public float3 Direction;
}
}