/// <summary>
 /// Initializes the Poly Toolkit runtime API. This will be called by PolyToolkitManager on its Awake method,
 /// you shouldn't need to call this method directly.
 /// </summary>
 public static void Init(PolyAuthConfig?authConfig = null, PolyCacheConfig?cacheConfig = null)
 {
     // NOTE: although it might seem strange, we have to support the use case of re-initializing PolyApi
     // (with possibly different config) because that's what happens when the project goes from play
     // mode back to edit mode -- the Poly Toolkit editor code will call PolyApi.Init with the editor
     // config, and in that case we should wipe out our previous state and initialize again.
     Shutdown();
     PtSettings.Init();
     PolyMainInternal.Init(authConfig, cacheConfig);
     Authenticator.Initialize(authConfig ?? PtSettings.Instance.authConfig);
     initialized = true;
 }
Example #2
0
        // Copy value from settings into shader state
        void SetKeywordFromSettings()
        {
            PtSettings settings = PtSettings.Instance;

            if (settings != null)
            {
                if (settings.playerColorSpace == ColorSpace.Linear)
                {
                    Shader.EnableKeyword("TBT_LINEAR_TARGET");
                }
                else
                {
                    Shader.DisableKeyword("TBT_LINEAR_TARGET");
                }
            }
        }