Show / Hide Table of Contents

Class AsyncHttpAsset

Class to load data over HTTP asynchronously and process it according to AsyncAssetHandlers.

Inheritance
System.Object
AsyncHttpAsset
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Fusee.Base.Core
Assembly: Fusee.Base.Core.dll
Syntax
public class AsyncHttpAsset

Constructors

AsyncHttpAsset(String, Type, Boolean)

Declaration
public AsyncHttpAsset(string id, Type type = null, bool startLoad = true)
Parameters
Type Name Description
System.String id
System.Type type
System.Boolean startLoad

If true, starts loading immediately, otherwise call StartGet() to start loading the asset.

AsyncHttpAsset(String, Type, EventHandler, EventHandler, Boolean)

Declaration
public AsyncHttpAsset(string id, Type type, EventHandler onDone, EventHandler onFail, bool startLoad = true)
Parameters
Type Name Description
System.String id
System.Type type
System.EventHandler onDone
System.EventHandler onFail
System.Boolean startLoad

If true, starts loading immediately, otherwise call StartGet() to start loading the asset.

Properties

AssetHandlers

The async asset handlers.

Declaration
public static Dictionary<Type, AsyncAssetDecoder> AssetHandlers { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.Type, AsyncAssetDecoder>

Content

Content of the asset.

Declaration
public object Content { get; }
Property Value
Type Description
System.Object

Id

Id/URL of the asset.

Declaration
public string Id { get; }
Property Value
Type Description
System.String

State

State of the asset.

Declaration
public AsyncAssetState State { get; set; }
Property Value
Type Description
AsyncAssetState

Type

Type of the asset.

Declaration
public Type Type { get; }
Property Value
Type Description
System.Type

Methods

RegisterTypeHandler(AsyncAssetHandler)

Register an AsyncAssetHandler.

Declaration
public static void RegisterTypeHandler(AsyncAssetHandler assetHandler)
Parameters
Type Name Description
AsyncAssetHandler assetHandler

RegisterTypeHandler(Type, AsyncAssetDecoder)

Register an AsyncAssetDecoder for a certain Type.

Declaration
public static void RegisterTypeHandler(Type type, AsyncAssetDecoder asyncAssetDecoder)
Parameters
Type Name Description
System.Type type
AsyncAssetDecoder asyncAssetDecoder

StartLoad()

Starts to load the assets.

Declaration
public void StartLoad()

Events

OnDone

EventHandler for when downloading and processing is done.

Declaration
public event EventHandler OnDone
Event Type
Type Description
System.EventHandler

OnFail

EventHandler for when either downloading or processing fails.

Declaration
public event EventHandler OnFail
Event Type
Type Description
System.EventHandler
Generated by DocFX
GitHub Repo
Back to top