Пример #1
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag.Equals("Player"))
     {
         GravityObject go = collision.gameObject.GetComponent <GravityObject>();
         if (go.GetGravitySource().Equals(this))
         {
             go.ResetGravity();
         }
     }
 }
Пример #2
0
    private void OnTriggerExit2D(Collider2D collision)
    {
        GravityObject go = collision.gameObject.GetComponent <GravityObject>();

        if (go != null && go.isActiveAndEnabled)
        {
            if (this.Equals(go.GetGravitySource()))
            {
                go.ResetGravity();
            }
        }
    }