How to generate new random static int?

Hi! I’ve got a static int variable in one script where it gets randomly generated

    public static int questNumber;
void Start()
    {
        questNumber = Random.Range(0, 3);

Is it possible to regenerate it from another script? ( Like, I don’t like this number, give me the next one)

public void NewQuestNumber()
{
questNumber = Random.Range(0, 3);
}

OtherScript:

void CheckQuestNumber()
{
  // old school way
   if (questNumberObject.GetComponent<QuestNumberScript>().questNumber == 2)
{
   questNumberObject.GetComponent<QuestNumberScript>().NewQuestNumber();
}
}

but if you set a static class, which I normally do, and name it:

public static class Global
{
   public static int questNumber;
}

you can easily setup the change and reference wherever you’d like… but keep track of the reads and declares, because you can easily lead yourself down the Debug Rabbit Hole, lol

public class Player : Monobehavior
{
   void Update()
{
   if (Global.questNumber == 2) { Global.questNumber = 1; }
   // or call a function like I mentioned before
   if (Global.questNumber == 2) { NewQuestNumber(); }
} }

}