-
Notifications
You must be signed in to change notification settings - Fork 0
Content Loading
The Content Providers may be used to load some content from disk. For example - basic content providers in the XDot Framework used to load Game Views from Resources or Addressables.
Note! For Content Providers in the XDot Framework used UniTask Library. You can rewrite it without UniTask, but this library is very useful for async content loading
The first provider out-of-the box. If your project is not using addressables, this feature was been disabled.
Usage Example:
AddressablesLoader<GameObject> contentLoader = new AddressablesLoader<GameObject>();
contentLoader?.Load("PathToAddressableAsset", onComplete, onError);The second provider out-of-the box used to load objects from Resources Folder. Please, note - use Resource loading for any objects - is a bad idea (for performance reasons). Please, use addressables or your content loading system instead.
Usage Example:
ResourcesLoader<GameObject> contentLoader = new ResourcesLoader<GameObject>();
contentLoader?.Load("PathToAddressableAsset", onComplete, onError);You can write your own content loading system. Any Content Providers has a single interface.
XDot Framework Content Provider Interface:
using System;
using Cysharp.Threading.Tasks;
using XDot.Handlers;
namespace XDot.ContentLoader
{
public interface IContentLoader<TContent> where TContent : class
{
UniTask<TContent> Load(string path, Action<TContent> onComplete = null,
Action<ErrorHandler> onError = null);
void Cancel();
void Dispose();
}
}This framework is under MIT license. Developed by Ilya Rastorguev specially for Pixel Incubator.
You can ask me about XDot Framework using Telegram @SodaBoom or by email: iliya-sdt@yandex.ru