Ejemplo n.º 1
0
 void OnCollisionEnter2D(Collision2D other)
 {
     Debug.Log("COlide");
     if (other.gameObject.tag == "Player")
     {
         RewindCore rewindCore = other.gameObject.GetComponent <RewindCore>();
         if (rewindCore.getRewinding())
         {
             return;
         }
         else
         {
             rewindCore.startRewind();
         }
         Destroy(this.gameObject);
     }
 }
Ejemplo n.º 2
0
    void shoot()
    {
        RaycastHit2D ray;

        ray = Physics2D.Linecast(this.transform.position, player.transform.position);
        if (ray.collider != null)
        {
            RewindCore rewindCore = ray.collider.gameObject.GetComponent <RewindCore>();
            if (rewindCore.getRewinding())
            {
                return;
            }
            else
            {
                rewindCore.startRewind();
            }
        }
    }
Ejemplo n.º 3
0
 private void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         RewindCore rewindCore = other.gameObject.GetComponent <RewindCore>();
         if (rewindCore.getRewinding())
         {
             return;
         }
         else
         {
             rewindCore.startRewind();
         }
     }
     else if (other.gameObject.tag == "Enemy")
     {
         return;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }