예제 #1
0
        public static void CheckInstance()
        {
            try
            {
                if (!IsCreated)
                {
                    instance = UnityEngine.Object.FindObjectOfType(typeof(ImageLoaderUpdateDelegator)) as ImageLoaderUpdateDelegator;

                    if (instance == null)
                    {
                        GameObject go = new GameObject("LocalImageLoader Update Delegator");
                        go.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy;
                        UnityEngine.Object.DontDestroyOnLoad(go);

                        instance = go.AddComponent <ImageLoaderUpdateDelegator>();
                    }
                    IsCreated = true;
                }
            }
            catch
            {
                Debug.LogError("ImageLoaderUpdateDelegator->Please call the LocalImageLoader.ImageLoadManager.Setup() from one of Unity's event(eg. awake, start) before you start AsyncLoadImage!");
            }
        }
예제 #2
0
 private static void Setup()
 {
     ImageLoaderUpdateDelegator.CheckInstance();
 }