Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile package #4

Open
Aegel5 opened this issue Dec 7, 2020 · 4 comments
Open

can't compile package #4

Aegel5 opened this issue Dec 7, 2020 · 4 comments

Comments

@Aegel5
Copy link

Aegel5 commented Dec 7, 2020

Library\PackageCache\com.akb.knn@e5efc63\Demo\KnnVisualizationDemo.cs(7,32): error CS0234: The type or namespace name 'ParticleSystemJobs' does not exist in the namespace 'UnityEngine.Experimental' (are you missing an assembly reference?)

@Aegel5 Aegel5 changed the title can't compile pachage can't compile package Dec 7, 2020
@sambeebe
Copy link

same issue, did you manage to solve this?

@skymeson
Copy link

Same issue here. Is there a version of Burst package we should be using? 0

@benthroop
Copy link

benthroop commented Jun 28, 2023

Here's a patch to fix it in Unity 2020+

diff --git a/Demo/KnnVisualizationDemo.cs b/Demo/KnnVisualizationDemo.cs
index f4ee1d6..b8ae0f9 100644
--- a/Demo/KnnVisualizationDemo.cs
+++ b/Demo/KnnVisualizationDemo.cs
@@ -4,7 +4,8 @@ using Unity.Collections;
 using Unity.Jobs;
 using Unity.Mathematics;
 using UnityEngine;
-using UnityEngine.Experimental.ParticleSystemJobs;
+using UnityEngine.ParticleSystemJobs;
+
 
 // Ideally you really would use something like ECS to visualize the point cloud
 // And query from a job component system
@@ -58,14 +59,14 @@ public class KnnVisualizationDemo : MonoBehaviour {
 	}
 
 	// [BurstCompile(CompileSynchronously = true)]
-	struct ParticleJob : IParticleSystemJob {
+	struct ParticleJob : IJobParticleSystem {
 		[ReadOnly] public NativeArray<int> KnnResults;
 		public NativeArray<float3> Points;
 
 		public NativeArray<Color32> Colors;
 		public int K;
 
-		public void ProcessParticleSystem(ParticleSystemJobData jobData) {
+		public void Execute(ParticleSystemJobData jobData) {
 			var colors = jobData.startColors;
 			var positions = jobData.positions;
 
@@ -85,13 +86,13 @@ public class KnnVisualizationDemo : MonoBehaviour {
 		}
 	}
 
-	struct ParticleRangeJob : IParticleSystemJob {
+	struct ParticleRangeJob : IJobParticleSystem {
 		[ReadOnly] public NativeArray<RangeQueryResult> KnnResults;
 
 		public NativeArray<float3> Points;
 		public NativeArray<Color32> Colors;
 
-		public void ProcessParticleSystem(ParticleSystemJobData jobData) {
+		public void Execute(ParticleSystemJobData jobData) {
 			var partColors = jobData.startColors;
 			var partPos = jobData.positions;
 
@@ -119,21 +120,26 @@ public class KnnVisualizationDemo : MonoBehaviour {
 	void Update() {
 		if (Mode == QueryMode.KNearest) {
 			// Update particles job to do the colors
-			m_system.SetJob(new ParticleJob {
+			var j = new ParticleJob {
 				KnnResults = m_results,
 				Points = m_points,
 				K = QueryK,
 				Colors = m_queryColors
-			});
+			};
+
+			j.Schedule(m_system);
 		}
 		else {
 			// Update particles job to do the colors
-			m_system.SetJob(new ParticleRangeJob {
+			var j = new ParticleRangeJob {
 				KnnResults = m_rangeResults,
 				Points = m_points,
 				Colors = m_queryColors
-			});
+			};
+			j.Schedule(m_system);
 		}
+		
+		
 	}
 
 	// After particle job

@Rackneh
Copy link

Rackneh commented Nov 13, 2023

Here's a patch to fix it in Unity 2020+

// After particle job

I really need this but I have no idea how to apply this. I googled how to do diff patches in github but no luck, it's all .py patch based

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants