// ReSharper disable once UnusedMember.Local
    void OnEnable()
    {
        if (enabledOnce)
        {
            return;
        }
        enabledOnce = true;

        if (testMode && !MadLevel.extensionDefined)
        {
            Debug.Log("Test mode enabled");
            canContinue = true;
        }
        else if (!IsCurrentSceneInTheConfiguration() || !MadLevel.hasExtension)
        {
            Debug.Log("This is not an extension and this is the not proper way of loading this scene. Please enable test mode " +
                      "or see the documentation.");
        }
        else if (!MadLevel.CanContinue())
        {
            Debug.LogError("Loading screen can be set only before target level. Please see the documentation.");
        }
        else
        {
            if (testMode)
            {
                Debug.Log("Test mode disabled because loading scene has been loaded as an extension. " +
                          "This message is not harmful. You can disable the test mode in order to get rid of it.");
                testMode = false;
            }

            canContinue = true;
        }
    }
 private void InitFinalize()
 {
     if (asyncLoading)
     {
         if (MadLevel.hasExtension && MadLevel.CanContinue())
         {
             asyncOperation = MadLevel.ContinueAsync();
         }
         else
         {
             Debug.LogWarning("Level loading screen is meant to be in extension as 'before' scene.");
             asyncOperation = MadLevel.LoadNextAsync();
         }
     }
 }
    private void Update()
    {
        frameNumber++;

        if (!asyncLoading)
        {
            if (frameNumber >= notAsyncLoadingStartFrame)
            {
                if (MadLevel.hasExtension && MadLevel.CanContinue())
                {
                    MadLevel.Continue();
                }
                else
                {
                    Debug.LogWarning("Level loading screen is meant to be in extension as 'before' scene.");
                    MadLevel.LoadNext();
                }
            }
        }
    }