Skip to content

Commit

Permalink
【ECSLearn】 1 使用WithBrust 提前编译 2 使用struct的system,也能使用burst编译
Browse files Browse the repository at this point in the history
  • Loading branch information
hexinping committed Aug 12, 2021
1 parent e4b9f39 commit 9ba9c43
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,5 @@ EntityComponentSystemSamples/ECSSamples/Temp/
EntityComponentSystemSamples/ECSSamples/Logs/
EntityComponentSystemSamples/ECSSamples/.vs/
EntityComponentSystemSamples/ECSSamples/Assets/SceneDependencyCache/
EntityComponentSystemSamples/ECSSamples/Assets/.idea/
xasset/Assets/Plugins/Editor/JetBrains/
8 changes: 0 additions & 8 deletions ECSLearn/Assets/Materials.meta

This file was deleted.

8 changes: 0 additions & 8 deletions ECSLearn/Assets/Settings.meta

This file was deleted.

3 changes: 3 additions & 0 deletions ECSLearn/UserSettings/EditorUserSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ EditorUserSettings:
Entity Inspector Settings:
value: 183b144645154b790c0d07271e271d4a564654406c6866706f0d1420f2ec3521c1e83bf9e8343a322d36f62c017c5b7ff40b0518f36117
flags: 0
RecentlyUsedScenePath-0:
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
flags: 0
unity-properties__ui-persistent-state:
value: 183b144645154b7d0202082d05376c0417031d6876681d5a6d695d73a2a07478f98d76a9a77a7f7c7942af7c447e4314f7134b51b6585f58465caf5740a75c79518558855a885f5c8b595c8e8f2bd0efc0d396b098ede6d4cddacab2b4b0aeb8b5b1e5e6e6c2bc80eaefbef1ef82dcae818af7848c868987fa929193fcf8d7ca9b8cc58781d5808d8fd9f5d5f7dccde4d3e1e4d6d5e5d9ebdddedcf056b2a375632532faa8aaa385d7f92dc33230c4c8326aca1337cacfccc9d23fcc8fe4d1cf02dad9db06dbdadb21de0fb56456223921043b053c003d3c0b3c20341d2d61336566643a683b37686c19314e51453c1205473447293d26107a7f0e417f1217491d3047141c1619174a623a494e636263696655666957686b6b36350470ba7765b66761b6b361b06eb5a28642b0437fb0b6b7b84a4c4846523b08f106c7824e58c4c61adac2705f5c59a28f5ca45efc7592aaa9abeba780abb1ae9dacc1def7faffa4ecacf5a6cce8aaedf9ecf7bd8afedfab
flags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 170076734}
m_IndirectSpecularColor: {r: 0.18028352, g: 0.22571376, b: 0.30692244, a: 1}
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
Expand Down Expand Up @@ -94,10 +94,11 @@ LightmapSettings:
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_LightingSettings: {fileID: 1273495885}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
Expand All @@ -117,6 +118,8 @@ NavMeshSettings:
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
Expand Down Expand Up @@ -145,8 +148,9 @@ Light:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 170076733}
m_Enabled: 1
serializedVersion: 9
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
Expand Down Expand Up @@ -195,6 +199,7 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &170076735
Expand Down Expand Up @@ -354,3 +359,64 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 37.512, y: 28.637001, z: 0}
--- !u!850595691 &1273495885
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Settings.lighting
serializedVersion: 3
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 512
m_BakeResolution: 10
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 256
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override void OnUpdate()
{
var instance = commandBuffer.Instantiate(entityInQueryIndex, spawnerFromEntity.Prefab);

// Place the instantiated in a grid with some noise
// Place the instantiated in a grid with some noise 世界坐标
var position = math.transform(location.Value,
new float3(x * 1.3F, noise.cnoise(new float2(x, y) * 0.21F) * 2, y * 1.3F));
commandBuffer.SetComponent(entityInQueryIndex, instance, new Translation {Value = position});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ protected override void OnUpdate()
commandBuffer.SetComponent(entityInQueryIndex, instance, new RotationSpeed_SpawnAndRemove { RadiansPerSecond = math.radians(random.NextFloat(25.0F, 90.0F)) });
}
}

//原始的entity
//commandBuffer.DestroyEntity(entityInQueryIndex, spawner.Prefab);

commandBuffer.DestroyEntity(entityInQueryIndex, entity);
}).ScheduleParallel();

Expand Down
Loading

0 comments on commit 9ba9c43

Please sign in to comment.