How do I scale down multiple gameobjects from a different script?

Hello everyone, im trying to call a function that scales down 15-20 spheres by the press of a buy button(space button) from the script where I keep the points. The space key will eventually be replaced by a button with a click activation on the canvas.

public class BuyStuffScript : MonoBehaviour
{
    public int cost=0;
    public CircleSize circlesize;


    void Update()
    {
        int score = Lava_Points.score;
        if (score >= cost){
            if (Input.GetKeyDown("space"))
            {
                Debug.Log("space");

                circlesize.DecreaseCircle();

                Debug.Log("space2");

                Lava_Points.score -= cost;
            } 
        }
    }
}

But when I call the function from my other script that scales down the object, I think it does not know what object to scale down. This my script that scales down the sphere:

public class CircleSize : MonoBehaviour
{
    public GameObject circle;
    public float decreasingfactor = 0.9f;

    void Start()
    {
        
    }

    void Update()
    {
        if (Input.GetKeyDown("k"))
        {
            Debug.Log("k");
            DecreaseCircle();
        }
    }

    public void DecreaseCircle()
    {
        Debug.Log("Decreased");
        circle.transform.localScale *= decreasingfactor;
    }
}

When I try to scale down the spheres which all have the CircleSize script attached by pressing ‘k’, therefore just using the CircleSize script, it does work, but I think I want to keep score and calling a function that scales down a gameobject seperate. First of all, does my though process make sense in keeping those seperated? If so, how would I approach such a thing?

Thank you!

You cannot call that method (DecreaseCircle is a method, not a function) because the script is present in multiple objects. What you can do instead is create an array which stores all the spheres you want scaled down. If you use this code instead, you can just delete that CircleSize script and declare the decreasingFactor variable in the BuyStuffScript.

If it doesn’t work, please tell me what went wrong.

    private GameObject[] circles; // this array stores all the spheres you want scaled down
    public CircleSize circlesize;

    void Awake()
    {
        circles = GameObject.FindGameObjectsWithTag("assign a tag to all the circles you want scaled down and put the name of the tag here"); // if you don't want to do this you can also make the array public and manually drag in all the circles you want scaled down.
     }

    void Update()
    {
            if (Input.GetKeyDown("space"))
            {
                for (int i = 0; i < circles.Length; i++) // this for loops runs the code inside the loop for as many times as there are spheres in your array.
                {
                    circles_.transform.localScale *= circlesize.decreasingfactor; // decreases circle size for every sphere in the array_

}
}
}