public override void OnLevelUnloading()
 {
     levelLoaded = false;
     go.GetComponent <Config>();
     Config.ins.SaveConfig();
     MainLoad.Unload(go);
 }
 public override void OnLevelLoaded(LoadMode mode)
 {
     levelLoaded = true;
     go          = new GameObject();
     tex         = new Texture2D(1, 1);
     try
     {
         byte[] bytes = File.ReadAllBytes(deffile[0]);
         tex.LoadImage(bytes);
     }
     catch
     {
         Debug.Log("[EvenBetterImageOverlay]Error while loading image! Are you sure there is images in Files?");
         return;
     }
     go.AddComponent <MainLoad>();
     go.AddComponent <Config>();
     tex = MainLoad.ApplyOpacity(tex, "both");
     MainLoad.textureDict.Add(deffile[0], tex);
     RenderOver.OnLevelLoaded();
 }