//restarts the instance
 public static void RestartInstance()
 {
     GameInstance = new GameObject();
 }
 //sets the instance to an instance
 public static void SetInstance(GameObject instance)
 {
     GameInstance = instance;
 }
 //returns the game instance
 public static GameObject GetInstance()
 {
     if (GameInstance == null)
         GameInstance = new GameObject();
     return GameInstance;
 }