示例#1
0
		/// <summary>
		/// Returns all current particles within a global manipulator (in form of an Event Particle, however no event will be needed).
		/// </summary>
		/// <returns>The manipulator particles.</returns>
		/// <param name="manipulator">Manipulator.</param>
		public static List<PlaygroundEventParticle> GetManipulatorParticles (int manipulator) {
			if (manipulator<0 || manipulator>=reference.manipulators.Count) return null;
			List<PlaygroundEventParticle> particles = new List<PlaygroundEventParticle>();
			PlaygroundEventParticle particle = new PlaygroundEventParticle();
			for (int s = 0; s<reference.particleSystems.Count; s++) {
				for (int i = 0; i<reference.particleSystems[s].particleCount; i++) {
					if (reference.particleSystems[s].manipulators[manipulator].Contains(reference.particleSystems[s].playgroundCache.position[i], reference.particleSystems[s].manipulators[manipulator].transform.position)) {
						reference.particleSystems[s].UpdateEventParticle(particle, i);
						particles.Add (particle.Clone());
					}
				}
			}
			return particles;
		}
示例#2
0
		/// <summary>
		/// Returns all current particles within a local manipulator (in form of an Event Particle, however no event will be needed).
		/// </summary>
		/// <returns>The manipulator particles.</returns>
		/// <param name="manipulator">Manipulator.</param>
		/// <param name="playgroundParticles">Playground particles.</param>
		public static List<PlaygroundEventParticle> GetManipulatorParticles (int manipulator, PlaygroundParticlesC playgroundParticles) {
			if (manipulator<0 || manipulator>=playgroundParticles.manipulators.Count) return null;
			List<PlaygroundEventParticle> particles = new List<PlaygroundEventParticle>();
			PlaygroundEventParticle particle = new PlaygroundEventParticle();
			for (int i = 0; i<playgroundParticles.particleCount; i++) {
				if (playgroundParticles.manipulators[manipulator].Contains(playgroundParticles.playgroundCache.position[i], playgroundParticles.manipulators[manipulator].transform.position)) {
					playgroundParticles.UpdateEventParticle(particle, i);
					particles.Add (particle.Clone());
				}
			}
			return particles;
		}