how I change this C code for 2D

how I change this C code for 2D

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(Collider))]
public class GravityMatrix : MonoBehaviour
{

    [Range(-100f, 100f)] [SerializeField] float gForceMul = 5f;

    void OnTriggerStay(Collider other)
    {
        if (other.gameObject.GetComponent<Rigidbody>() == null)
            return;

        GameObject otherOb = other.gameObject;
        Rigidbody otherRb = otherOb.GetComponent<Rigidbody>();
        Transform otherTr = otherOb.GetComponent<Transform>();

        Vector3 moveF = transform.position - otherTr.position;

        otherRb.AddForce(moveF * gForceMul);
    }
}

Change Rigidbody to Rigidbody2D, OnTriggerStay to OnTriggerStay2D, Collider to Collider2D. Other than that, depends on what you are trying to do.