コード例 #1
0
 void TimeSystem()
 {
     m_Timer += Time.deltaTime;
     if (m_Timer > m_TimeLimit)
     {
         //put the bomb location under the car before trigger
         gameObject.transform.position = new Vector3(m_Player.transform.position.x, m_Player.transform.position.y - m_lowerVal, m_Player.transform.position.z + m_forwardVal);
         if (m_Player.GetComponent <Score>())
         {
             m_Player.GetComponent <Score>().ResetScore();
         }
         if (m_Player.GetComponent <BombPass>())
         {
             m_Player.GetComponent <BombPass>().SetHoldingBomb(false, null);
         }
         //triggers the explosion physics
         m_ExpPhy.trigger();
         //destroys the bomb
         Destroy(gameObject);
         m_initCol = false;
         //particles for explosion
         m_ParticleSpawner.SpawnParticle();
         //spawns in ner bomb
     }
 }
コード例 #2
0
        void OnTriggerEnter(Collider other)
        {
            if (other.tag == "Player")
            {
                if (m_type == "Boulder")
                {
                    other.GetComponent <Boulders>().Trigger(true);
                    print("boulders triggered");
                }
                //if (m_type == "Snare")
                //{
                //other.GetComponent<Snare>().Trigger(true);
                //print("snare triggered");
                //}
                //if (m_type == "Blockade")
                //{
                //other.GetComponent<Blockades>().Trigger(true);
                //print("blockades triggered");
                //}
                //if (m_type == "Barrel")
                //{
                //other.GetComponent<Barrels>().Trigger(true);
                //print("barrels triggered");
                //}

                m_particleSpawner.SpawnParticle();
                Destroy(gameObject);
            }
        }
コード例 #3
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.collider.tag == "Player")
     {
         m_particleSpawner.SpawnParticle();
         m_rewindManager.SetMode(RewindManager.Mode.Rewind);
         print("collision and now rewinding");
         Destroy(gameObject);
     }
 }
コード例 #4
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         if (m_type == "SpeedBoost")
         {
             other.GetComponent <ArcadeCarScript>().SpeedBoost(true);
         }
         m_particleSpawner.SpawnParticle();
         int rand = (int)Random.Range(0, m_max);
         if (rand < m_num)
         {
             Instantiate(m_audioObjectOne, transform.position, Quaternion.identity);
         }
         else
         {
             Instantiate(m_audioObjectTwo, transform.position, Quaternion.identity);
         }
         Destroy(gameObject);
     }
 }