コード例 #1
0
        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));
        }