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);
}
}