static void Init()
    {
        if (headlessTexture == null)
        {
            headlessTexture = new RenderTexture(640, 480, 1);
            if (headlessTexture.Create())
            {
                CloudGraphics.SetDefaultBackbufferSurface(headlessTexture);
            }
            else
            {
                Debug.LogError("Failed to create a render texture for default backbuffer surface");
            }
        }
        var loopSystem = GenerateCustomLoop();

        PlayerLoop.SetPlayerLoop(loopSystem);
    }
    static void Init()
    {
        if (headlessTexture == null)
        {
            var playerSettings = Resources.Load <PlayerResolutionSettings>("PlayerResolutionSettings");
            if (playerSettings == null)
            {
                headlessTexture.width  = 640;
                headlessTexture.height = 480;
                Log.W("Player Settings resolution scriptable object not found, loading default of 640X480");
            }
            else
            {
                if (playerSettings.renderTexture != null)
                {
                    headlessTexture        = playerSettings.renderTexture;
                    headlessTexture.width  = playerSettings.playerResolution.width;
                    headlessTexture.height = playerSettings.playerResolution.height;
                }
                else
                {
                    headlessTexture = new RenderTexture(playerSettings.playerResolution.width, playerSettings.playerResolution.height, 1);
                }
            }

            if (headlessTexture.Create())
            {
                CloudGraphics.SetDefaultBackbufferSurface(headlessTexture);
            }
            else
            {
                Log.E("Failed to create a render texture for default backbuffer surface");
            }
        }
        var loopSystem = GenerateCustomLoop();

        PlayerLoop.SetPlayerLoop(loopSystem);
    }