Beispiel #1
0
        private void Reload()
        {
            if (FlashResources.logLevel <= LogLevel.DEBUG)
            {
                Debug.LogWarning("Reloading...");
            }

            _descriptions = null;
            FlashResources.UnloadBundle(this);
            FlashResources.LoadBundle(this);
            AddBundleWatcher();
        }
Beispiel #2
0
        void UpdateContent()
        {
            root.RemoveChildren();

            if (resourcePath.IsNullOrEmpty())
            {
                return;
            }

            var bundleName = resourcePath.Split("/")[0];
            var bundle     = FlashResources.GetBundleInstance(bundleName);

            if (bundle == null)
            {
                Debug.Log("Bundle not found: " + bundleName);
                return;
            }

            if (!bundle.isLoaded)
            {
                FlashResources.LoadBundle(bundle);
            }

            var resource = FlashResources.GetResource <IDisplayResource>(resourcePath);

            if (resource == null)
            {
                Debug.Log("Resource not found: " + resourcePath);
                return;
            }

            var instance = resource.CreateInstance();

            root.AddChild(instance);

            if (isPlaying)
            {
                if (instance.totalFrames > 1)
                {
                    instance.Play();
                }
                else
                {
                    var displayContainer = instance as DisplayContainer;
                    if (displayContainer != null)
                    {
                        displayContainer.PlayAllChildren();
                    }
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Calls FlashResources.LoadBundle(this);
 /// </summary>
 public void Load()
 {
     FlashResources.LoadBundle(this);
 }