Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (transform.localScale.x < 0.7)
     {
         Destroy(gameObject);
         if (connector != null)
         {
             connector.OnTravelObstacle();
         }
     }
 }
Esempio n. 2
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.transform.parent != null)
     {
         Destroy(collision.transform.parent.gameObject);
     }
     else
     {
         Destroy(collision.gameObject);
     }
     if (connector != null)
     {
         connector.OnTravelObstacle();
     }
 }