修改水

This commit is contained in:
2026-01-01 22:00:33 +08:00
parent 040a222bd6
commit 9ceffccd39
1800 changed files with 103929 additions and 139495 deletions

View File

@@ -1,41 +0,0 @@
#if (OBI_BURST && OBI_MATHEMATICS && OBI_COLLECTIONS)
using UnityEngine;
using Unity.Jobs;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Mathematics;
using Unity.Burst;
using System;
using System.Collections;
using System.Threading;
namespace Obi
{
[BurstCompile]
unsafe struct UpdateParticleLifetimesJob : IJobParallelFor
{
[ReadOnly] public NativeArray<int> activeParticles;
[NativeDisableParallelForRestriction] public NativeArray<float> life;
[NativeDisableParallelForRestriction] public NativeArray<int> deadParticles;
[NativeDisableContainerSafetyRestriction] public NativeReference<int> deadParticleCount;
[ReadOnly] public float dt;
public void Execute(int i)
{
int p = activeParticles[i];
life[p] -= dt;
if (life[p] <= 0)
{
int* countRef = (int*)deadParticleCount.GetUnsafePtr();
int count = Interlocked.Increment(ref countRef[0]) - 1;
deadParticles[count] = p;
life[p] = 0;
}
}
}
}
#endif