예제 #1
0
        /// <summary>
        /// Initializes Poly Toolkit runtime. Must be called once, before any other use of the library.
        /// Call only once in your app's lifetime, not once per scene (Poly Toolkit survives scene loads).
        /// </summary>
        public static void Init(PolyAuthConfig?authConfig, PolyCacheConfig?cacheConfig)
        {
            string objName = Application.isPlaying ? "Poly Main" : "Poly Main (EDITOR)";

            PolyUtils.AssertTrue(instance == null, "PolyMainInternal.Init() already called. Can only be called once.");

            polyObject = PolyInternalUtils.CreateSingletonGameObject(objName);
            instance   = polyObject.AddComponent <PolyMainInternal>();
            instance.Setup(authConfig, cacheConfig);
        }
예제 #2
0
 public static void Shutdown()
 {
     DestroyImmediate(polyObject);
     instance = null;
 }