Design Advice: Power Up System (static variables?)

hey there,

I have a game in progress in which the player can fly around in 3d space and shoot weapons. I have various variables for the player like: movement speed, rate of fire, damage, hit points etc. I would like to create a system of powerups to modify these variables as the player’s score increases.

I have a static variable for score in a game object that manages global stats. The player variables are on various game objects as children of the main player object.

I am trying to decide whether it makes more sense to write code for the changes into each script which controls the player variable (like put different power up modifiers in the gun script for example) and then have those check a static variable in the global stats to turn them on or off, or whether I should try to track all that in the global stats object and just set the different variables to new values from that object.

I guess the heart of the matter is: will I be better off having many scripts checking a static variable or variables as to the players state of progress or should I have my object tracking score linked to all the weapons etc and modifying their variables from logic inside the score tracking script? Hope the question is clear.

I know this is more of a design question than a strict scripting question, but I feel like the decision I make here will have wide ranging consequences including how organized my scripts are and for overall performance and wanted to seek some advice.

thanks in advance!
M.

it is honestly just this simple:

Use a “Grid” like this: Grid.cs

using Assets.scripts.network;
using UnityEngine;

static class Grid
{
    public static Comms comms;
    public static State state;
    public static Launch launch;
    public static INetworkCommunicator iNetworkCommunicator;
    public static Sfx sfx;

    static Grid()
    {
        GameObject g = GameObject.Find("_app");

        comms = g.GetComponent<Comms>();
        state = g.GetComponent<State>();
        launch = g.GetComponent<Launch>();
        iNetworkCommunicator = g.GetComponent<INetworkCommunicator>();
        sfx = g.GetComponent<Sfx>();
    }
}

Then, anywhere in the project you can say

 Grid.sfx.Explosions();

and so on. Be sure to read this c# - Unity game manager. Script works only one time - Stack Overflow

Be aware of incredibly out of date discussions on this topic on the web; there are 100s of pages of total crap out there, which is now completely irrelevant.