Click or drag to resize

IAssetProvider Interface

An AssetProvider knows how to akquire assets of certain types from a certain kind of storage.

Namespace:  Fusee.Base.Common
Assembly:  Fusee.Base.Common (in Fusee.Base.Common.dll) Version: 0.7.0.0 (0.7.0.0)
Syntax
C#
public interface IAssetProvider

The IAssetProvider type exposes the following members.

Methods
  NameDescription
Public methodBeginGetAsset
Asynchronous get method.
Public methodCanGet
Determines whether this asset provider can get the specified asset without actually getting it.
Public methodCanHandleType
Determines whether this instance can handle assets of the specified type (in general).
Public methodGetAsset
Retrieves the asset identified by the given string.
Public methodRegisterTypeHandler
Registers the given asset type decoder.
Top
Remarks
In a normal world, a good design would separate the many aspects of asset akquisition (storage, serialization, codec, asynchronicity). Unfortunately, in JavaScript-Land, it's all mixed (or should I say messed) up. You tell the JavaScript API "get me an image" and JavaScript magically loads the raw image data, converts it to a two-dimensional pixel array and calls a user-provided callback when its all done. No way to replace a single step by something self-provided. So this is FUSEE's pitiful approach for an asset akquisition abstraction which is capable of being implemented by poorly designed JavaScript APIs.
See Also