public static void SetTriggerParticles(this ParticleSystem ps, ParticleSystemTriggerEventType type, List <ParticleSystem.Particle> particles) { if (particles == null) { throw new ArgumentNullException("particles"); } ParticleSystemExtensionsImpl.SetTriggerParticles(ps, (int)type, particles, 0, particles.Count); }
public static int GetTriggerParticles(this ParticleSystem ps, ParticleSystemTriggerEventType type, List <ParticleSystem.Particle> particles) { if (particles == null) { throw new ArgumentNullException("particles"); } return(ParticleSystemExtensionsImpl.GetTriggerParticles(ps, (int)type, particles)); }
public static int GetTriggerParticles(this ParticleSystem ps, ParticleSystemTriggerEventType type, List <ParticleSystem.Particle> particles, out ParticleSystem.ColliderData colliderData) { if (type == ParticleSystemTriggerEventType.Exit) { throw new InvalidOperationException("Querying the collider data for the Exit event is not currently supported."); } else if (type == ParticleSystemTriggerEventType.Outside) { throw new InvalidOperationException("Querying the collider data for the Outside event is not supported, because when a particle is outside the collision volume, it is always outside every collider."); } colliderData = new ParticleSystem.ColliderData(); return(ParticleSystemExtensionsImpl.GetTriggerParticlesWithData(ps, (int)type, particles, ref colliderData)); }
public static void SetTriggerParticles(this ParticleSystem ps, ParticleSystemTriggerEventType type, List <ParticleSystem.Particle> particles, int offset, int count) { if (particles == null) { throw new ArgumentNullException("particles"); } if (offset >= particles.Count) { throw new ArgumentOutOfRangeException("offset", "offset should be smaller than the size of the particles list."); } if (offset + count >= particles.Count) { throw new ArgumentOutOfRangeException("count", "offset+count should be smaller than the size of the particles list."); } ParticleSystemExtensionsImpl.SetTriggerParticles(ps, (int)type, particles, offset, count); }
public void AddPhotonProcessor(IPhotonProcessor processor, Collider collider, ParticleSystemTriggerEventType eventType) { particleSystem = GetComponent <ParticleSystem>(); // Set-Up the particle system to callback when particle Inside in filter var trigger = particleSystem.trigger; trigger.enabled = true; switch (eventType) { case ParticleSystemTriggerEventType.Enter: if (enterProcessor != null) { return; } onEnter = true; enterProcessor = processor; trigger.SetCollider(0, collider); break; case ParticleSystemTriggerEventType.Inside: if (insideProcessor != null) { return; } onInside = true; insideProcessor = processor; trigger.SetCollider(1, collider); break; default: break; } trigger.inside = onInside ? ParticleSystemOverlapAction.Callback : ParticleSystemOverlapAction.Ignore; trigger.enter = onEnter ? ParticleSystemOverlapAction.Callback : ParticleSystemOverlapAction.Ignore; }
public static int GetSafeTriggerParticlesSize(this ParticleSystem ps, ParticleSystemTriggerEventType type) { return(ParticleSystemExtensionsImpl.GetSafeTriggerParticlesSize(ps, (int)type)); }
public static void SetTriggerParticles(this ParticleSystem ps, ParticleSystemTriggerEventType type, List <ParticleSystem.Particle> particles) { ParticleSystemExtensionsImpl.SetTriggerParticles(ps, (int)type, particles, 0, particles.Count); }
public static int GetTriggerParticles(this ParticleSystem ps, ParticleSystemTriggerEventType type, List <ParticleSystem.Particle> particles) { return(ParticleSystemExtensionsImpl.GetTriggerParticles(ps, (int)type, particles)); }