private void Reload() { if (FlashResources.logLevel <= LogLevel.DEBUG) { Debug.LogWarning("Reloading..."); } _descriptions = null; FlashResources.UnloadBundle(this); FlashResources.LoadBundle(this); AddBundleWatcher(); }
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(); } } } }
/// <summary> /// Calls FlashResources.LoadBundle(this); /// </summary> public void Load() { FlashResources.LoadBundle(this); }