How do i reference a non static singleton?

I haven’t been able to find anything useful on this considering I don’t know how to look for it, but I was told to make a singleton for my code since I needed a variable that could be used on another script since the variable is being changed. But when I use it on another script it does not produce the same number since it is static. So basically the first code is:

                public int itemNumber;
              static public classname instance;
   void Start()
   { 
          itemNumber = Random.Range (0, 7)
   }

And in the other script I try to use whatever number itemNumber generated by doing:

                        public int itemNumberTwo
       SpinWheel.instance.itemNumber = temNumberTwo

But when I run the script it later does not result in the same numbers I’m guessing because it is static. I try to remove that part but then it says an object reference is needed to access the non-static field. Any ideas? Sorry if the way I tried to explain this doesn’t make sense don’t know a bit of C# mostly just java.

a static variable creates only ONE instance of the variable that is shared by all.

if you want to change it from another script or class you just have to use the class or script name
to refer to it.

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {

	public static int MySharedNumber;
	void Start () {
		//access this from THIS script like this 
		MySharedNumber = Random.Range (0, 10);

		// to access the number from other scripts 
		// just use the class name that it started from like this
		print ("this line works from any script"+example.MySharedNumber);
	}
	

}