Example #1
0
    void Update()
    {
        MeshRenderer mr = GetComponent <MeshRenderer>();

        mr.material.SetVector("_GlowColor", glowColor);

        Vector3 pos = transform.position;

        pos.x = 9.5f;
        pos.y = Mathf.Cos(Time.time * 0.5f) * 3.0f;
        transform.position = pos;

        TestShooter ts = TestShooter.instance;
        {
            //const int num = 52;
            const int      num        = 16;
            MPGPParticle[] additional = new MPGPParticle[num];
            for (int i = 0; i < additional.Length; ++i)
            {
                additional[i].velocity = new Vector3(Random.Range(-2.0f, -0.5f), Random.Range(-1.0f, 1.0f), 0.0f) * 4.0f;
                additional[i].position = new Vector3(pos.x - 1.4f, pos.y, 0.0f) + additional[i].velocity * 0.1f;
            }
            ts.fractions.AddParticles(additional);
        }
    }
Example #2
0
 public void OnHitParticle(ref MPGPParticle particle)
 {
     if (particle.speed > 12.5f)
     {
         //OnDamage(1.0f, particle.owner_objid);
         OnDamage(1.0f, 0);
         particle.lifetime = 0.0f;
     }
 }
Example #3
0
 public void OnHitParticle(ref MPGPParticle particle)
 {
     if (particle.speed > 12.5f)
     {
         //OnDamage(1.0f, particle.owner_objid);
         OnDamage(1.0f, 0);
         particle.lifetime = 0.0f;
     }
 }
 void FluidHandler(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)
             {
                 particles[i].lifetime = 0.0f;
                 ++numGoaled;
             }
         }
     }
 }
Example #5
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]);
                 }
             }
         }
     }
 }
Example #6
0
    void Shot()
    {
        TestShooter ts = TestShooter.instance;

        if (ts.gameMode == TestShooter.GameMode.BulletHell)
        {
            Vector3        pos        = transform.position;
            Vector3        dir        = transform.forward;
            MPGPParticle[] additional = new MPGPParticle[26];
            for (int i = 0; i < additional.Length; ++i)
            {
                additional[i].position = pos + dir * 0.5f;
                additional[i].velocity = (dir + new Vector3(Random.Range(-0.5f, 0.5f), Random.Range(-0.5f, 0.5f), 0.0f)) * 10.0f;
            }
            ts.fractions.AddParticles(additional);
        }
        else if (ts.gameMode == TestShooter.GameMode.Exception)
        {
            Instantiate(playerBullet, trans.position + trans.forward.normalized * 1.0f, trans.rotation);
        }
    }
Example #7
0
    void Update()
    {
        MeshRenderer mr = GetComponent<MeshRenderer>();
        mr.material.SetVector("_GlowColor", glowColor);

        Vector3 pos = transform.position;
        pos.x = 9.5f;
        pos.y = Mathf.Cos(Time.time*0.5f) * 3.0f;
        transform.position = pos;

        TestShooter ts = TestShooter.instance;
        {
            //const int num = 52;
            const int num = 16;
            MPGPParticle[] additional = new MPGPParticle[num];
            for (int i = 0; i < additional.Length; ++i)
            {
                additional[i].velocity = new Vector3(Random.Range(-2.0f, -0.5f), Random.Range(-1.0f, 1.0f), 0.0f) * 4.0f;
                additional[i].position = new Vector3(pos.x - 1.4f, pos.y, 0.0f) + additional[i].velocity*0.1f;
            }
            ts.fractions.AddParticles(additional);
        }
    }
Example #8
0
 public void AddParticles(MPGPParticle[] particles) { if(enabled) m_particles_to_add.AddRange(particles); }
Example #9
0
 void Shot()
 {
     TestShooter ts = TestShooter.instance;
     if (ts.gameMode == TestShooter.GameMode.BulletHell)
     {
         Vector3 pos = transform.position;
         Vector3 dir = transform.forward;
         MPGPParticle[] additional = new MPGPParticle[26];
         for (int i = 0; i < additional.Length; ++i)
         {
             additional[i].position = pos + dir * 0.5f;
             additional[i].velocity = (dir + new Vector3(Random.Range(-0.5f, 0.5f), Random.Range(-0.5f, 0.5f), 0.0f)) * 10.0f;
         }
         ts.fractions.AddParticles(additional);
     }
     else if (ts.gameMode == TestShooter.GameMode.Exception)
     {
         Instantiate(playerBullet, trans.position + trans.forward.normalized * 1.0f, trans.rotation);
     }
 }