Skip to content

Commit 678c1a1

Browse files
committed
Version 0.12.6 Release [Compatibility]
Compatibility release for Entities 1.3.14
1 parent 2920dac commit 678c1a1

17 files changed

+141
-39
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ You can find changelogs for the individual modules in the [official Latios
1010
Framework Documentation
1111
repository](https://github.com/Dreaming381/Latios-Framework-Documentation).
1212

13+
## [0.12.6] – 2025-4-20
14+
15+
Officially supports Entities [1.3.14]
16+
17+
### Changed
18+
19+
- Updated Core to v0.12.6
20+
- Updated QVVS Transforms to v0.12.6
21+
- Updated Kinemation to v0.12.6
22+
1323
## [0.12.5] – 2025-4-12
1424

1525
Officially supports Entities [1.3.9]

Core/Authoring/FixBakingAllocatorSystem.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

Core/Authoring/FixBakingAllocatorSystem.cs.meta

Lines changed: 0 additions & 2 deletions
This file was deleted.

Core/Framework/BlackboardEntity.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,16 @@ public bool HasCollectionComponent<T>() where T : unmanaged, ICollectionComponen
300300
return latiosWorld.HasCollectionComponent<T>(entity);
301301
}
302302

303+
/// <summary>
304+
/// Gets an instance of the Collection Aspect from the blackboard entity.
305+
/// </summary>
306+
/// <typeparam name="T">The struct type implementing ICollectionAspect</typeparam>
307+
/// <returns>The Collection Aspect instance</returns>
308+
public T GetCollectionAspect<T>() where T : unmanaged, ICollectionAspect<T>
309+
{
310+
return latiosWorld.GetCollectionAspect<T>(entity);
311+
}
312+
303313
/// <summary>
304314
/// Provides a dependency for the collection component attached to the entity.
305315
/// The collection component will no longer be automatically updated with the final Dependency of the currently executing system.

Core/Framework/FluentQuery.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,21 @@ public FluentQuery WithAspect<T>() where T : unmanaged, IAspect, IAspectCreate<T
366366
return this;
367367
}
368368

369+
/// <summary>
370+
/// Adds the required components by the IAspect to the query, regardless of component enabled state
371+
/// </summary>
372+
/// <typeparam name="T">The type of IAspect to add to the query</typeparam>
373+
public FluentQuery WithAspectPresent<T>() where T : unmanaged, IAspect, IAspectCreate<T>
374+
{
375+
var tempList = new UnsafeList<ComponentType>(8, Allocator.Temp);
376+
default(T).AddComponentRequirementsTo(ref tempList);
377+
foreach (var component in tempList)
378+
{
379+
m_with.Add(in component);
380+
}
381+
return this;
382+
}
383+
369384
/// <summary>
370385
/// Allows disabled entities to be included in the query
371386
/// </summary>

Core/Utilities/ColorTools.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Unity.Collections;
2+
using Unity.Entities;
3+
using Unity.Mathematics;
4+
using UnityEngine;
5+
6+
namespace Latios
7+
{
8+
public static class ColorExtensions
9+
{
10+
public static float4 ToFloat4(this Color color)
11+
{
12+
return new float4(color.r, color.g, color.b, color.a);
13+
}
14+
15+
public static half4 ToHalf4(this Color color)
16+
{
17+
return new half4(color.ToFloat4());
18+
}
19+
20+
public static float4 ToFloat4(this Color32 color)
21+
{
22+
return ((Color)color).ToFloat4();
23+
}
24+
25+
public static half4 ToHalf4(this Color32 color)
26+
{
27+
return ((Color)color).ToHalf4();
28+
}
29+
}
30+
}
31+

Core/Utilities/ColorTools.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Kinemation/Authoring/BakingSystems/SetupSocketsSystem.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public void OnUpdate(ref SystemState state)
3535
var componentsToAdd = new ComponentTypeSet(ComponentType.ReadWrite<Socket>(),
3636
ComponentType.ReadWrite<BoneOwningSkeletonReference>());
3737

38+
new FindSocketByNameJob { socketLookup = GetComponentLookup<Socket>(false) }.ScheduleParallel();
39+
3840
new ClearJob().ScheduleParallel();
3941

4042
var ecbAdd = new EntityCommandBuffer(state.WorldUpdateAllocator);
@@ -62,6 +64,41 @@ public void OnUpdate(ref SystemState state)
6264
ecbRemove.Playback(state.EntityManager);
6365
}
6466

67+
[WithOptions(EntityQueryOptions.IncludeDisabledEntities | EntityQueryOptions.IncludePrefab)]
68+
[BurstCompile]
69+
partial struct FindSocketByNameJob : IJobEntity
70+
{
71+
[NativeDisableParallelForRestriction] public ComponentLookup<Socket> socketLookup;
72+
UnsafeText cache;
73+
74+
public void Execute(in AuthoredSocketString s, in DynamicBuffer<SkeletonBoneNameInHierarchy> boneBuffer)
75+
{
76+
var bones = boneBuffer.AsNativeArray().AsReadOnlySpan();
77+
var search = s.reversePathStart;
78+
for (int i = 0; i < bones.Length; i++)
79+
{
80+
var bone = bones[i].boneName;
81+
if (search.Length > bone.Length && search.StartsWith(bone))
82+
{
83+
if (!cache.IsCreated)
84+
cache = new UnsafeText(search.Length * 2, Allocator.Temp);
85+
cache.Clear();
86+
cache.AppendBoneReversePath(bones, i);
87+
if (cache.StartsWith(search))
88+
{
89+
socketLookup.GetRefRW(s.socket).ValueRW.boneIndex = (short)i;
90+
return;
91+
}
92+
}
93+
else if (search.Length <= bone.Length && bone.StartsWith(search))
94+
{
95+
socketLookup.GetRefRW(s.socket).ValueRW.boneIndex = (short)i;
96+
return;
97+
}
98+
}
99+
}
100+
}
101+
65102
[WithOptions(EntityQueryOptions.IncludeDisabledEntities | EntityQueryOptions.IncludePrefab)]
66103
[WithAll(typeof(Socket))]
67104
[WithNone(typeof(AuthoredSocket))]

Kinemation/Authoring/KinemationBakingComponents.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ internal struct ImportedSocketGameObjectRef : IBufferElementData
7272
[BakingType]
7373
internal struct AuthoredSocket : IComponentData { }
7474

75+
[TemporaryBakingType]
76+
internal struct AuthoredSocketString : IComponentData
77+
{
78+
public EntityWith<Socket> socket;
79+
public FixedString512Bytes reversePathStart;
80+
}
81+
7582
[TemporaryBakingType]
7683
internal struct PendingMeshBindingPathsBlob : IComponentData
7784
{

Kinemation/Authoring/OptimizedSkeletonStructureCache.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ private void Generate()
9999
m_bones[i] = bone;
100100
}
101101

102-
shadow.Dispose();
102+
// For some reason, Unity treats the shadow hierarchy using this path as an asset.
103+
// Is that because it was instantiated while inside the callback?
104+
//shadow.Dispose();
105+
shadow.taa.Dispose();
106+
shadow.parentIndices.Dispose();
107+
DestroyImmediate(shadow.shadowHierarchy, true);
103108
}
104109
}
105110

0 commit comments

Comments
 (0)