Пример #1
0
    public void OnTriggerExit2D(Collider2D collision)
    {
        ISpeedChangable s = collision.GetComponent <ISpeedChangable>();

        if (s != null)
        {
            EffectedBodies.Remove(s);
        }
    }
Пример #2
0
    public void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.scene != this.gameObject.scene)
        {
            return;
        }

        ISpeedChangable s = collision.GetComponent <ISpeedChangable>();

        if (s != null)
        {
            EffectedBodies.Add(s);
        }
    }