Beispiel #1
0
 void FractionHandler(MPGPParticle[] particles, int num_particles, List <MPGPColliderBase> colliders)
 {
     for (int i = 0; i < num_particles; ++i)
     {
         int hit = particles[i].hit_objid;
         if (particles[i].lifetime != 0.0f && hit != -1 && hit < colliders.Count)
         {
             MPGPColliderBase cscol = colliders[hit];
             if (cscol != null && cscol.m_receive_collision)
             {
                 TSEntity tge = cscol.GetComponent <TSEntity>();
                 if (tge)
                 {
                     tge.OnHitParticle(ref particles[i]);
                 }
             }
         }
     }
 }
Beispiel #2
0
 void EnemyBulletHandler(CSParticle[] particles, int num_particles, List <GPUParticleColliderBase> colliders)
 {
     for (int i = 0; i < num_particles; ++i)
     {
         int hit = particles[i].hit_objid;
         if (particles[i].lifetime != 0.0f && hit != -1 && hit < colliders.Count)
         {
             GPUParticleColliderBase cscol = colliders[hit];
             if (cscol != null && cscol.m_receive_collision)
             {
                 TSEntity tge = cscol.GetComponent <TSEntity>();
                 if (tge)
                 {
                     tge.OnDamage(0.1f, 0);
                     particles[i].lifetime = 0.0f;
                 }
             }
         }
     }
 }