How can I return a GameObject?

I’m trying to create a Singleton Class that have all the GameObjects of the game. This class is responsable to provide to all classes the GameObject. It have a function that, given a index, return a GameObject. However, when I make a instance of this singleton and request a GameObject, this function return a NULL value.

Can I make: GameObject objectTable= bank.GetObject(0);?

objectTable = GameObject;

bank = Singleton Class;

GetObject(0) = Function of the Singleton Class that recive a index as parameter and return a corresponding GameObject;

I don’t know how your code work.
Here is an example for simple singleton implementation

public class SingletonExample{
    public static SingletonExample instance;
    void Awake(){
        instance = this;

    public GameObject GetObject(int index){


 SingletonExample singleton = SingletonExample.instance;
 GameObject object =  SingletonExample.instance.GetObject(0);

Hope this could help you