Class GltfEntityAsset
Loads a glTF from a MonoBehaviour but instantiates Entities. Intermediate solution and drop-in replacement for GltfAsset TODO: To be replaced with a pure ECS concept
Inherited Members
Namespace: GLTFast
Assembly: solution.dll
Syntax
[BurstCompile]
public class GltfEntityAsset : GltfAssetBase
Properties
FullUrl
Declaration
public string FullUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
InstantiationSettings
Instantiation settings
Declaration
public InstantiationSettings InstantiationSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| InstantiationSettings |
LoadOnStartup
Automatically load at start
Declaration
public bool LoadOnStartup { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
SceneId
Scene to load (-1 loads glTFs default scene)
Declaration
protected int SceneId { get; }
Property Value
| Type | Description |
|---|---|
| int |
StreamingAsset
If true, url is treated as relative StreamingAssets path
Declaration
public bool StreamingAsset { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Url
Declaration
public string Url { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ClearScenes()
Removes previously instantiated scene(s)
Declaration
public override void ClearScenes()
Overrides
GetDefaultInstantiator(ICodeLogger)
Returns an instance of the default instantiator
Declaration
protected override IInstantiator GetDefaultInstantiator(ICodeLogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| ICodeLogger | logger | Custom logger to use with the instantiator |
Returns
| Type | Description |
|---|---|
| IInstantiator | Default instantiator instance |
Overrides
Load(string, IDownloadProvider, IDeferAgent, IMaterialGenerator, ICodeLogger)
Method for manual loading with custom IDownloadProvider and IDeferAgent.
Declaration
public override Task<bool> Load(string gltfUrl, IDownloadProvider downloadProvider = null, IDeferAgent deferAgent = null, IMaterialGenerator materialGenerator = null, ICodeLogger logger = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | gltfUrl | URL of the glTF file. |
| IDownloadProvider | downloadProvider | Download Provider for custom loading (e.g. caching or HTTP authorization) |
| IDeferAgent | deferAgent | Defer Agent takes care of interrupting the loading procedure in order to keep the frame rate responsive. |
| IMaterialGenerator | materialGenerator | Used to convert glTF materials to Material instances |
| ICodeLogger | logger | Used for message reporting |
Returns
| Type | Description |
|---|---|
| Task<bool> | Async Task that loads the glTF's contents |
Overrides
PostInstantiation(IInstantiator, bool)
Callback that is called after instantiation
Declaration
protected override void PostInstantiation(IInstantiator instantiator, bool success)
Parameters
| Type | Name | Description |
|---|---|---|
| IInstantiator | instantiator | instantiator that was used |
| bool | success | True if instantiation was successful, false otherwise |
Overrides
Start()
Declaration
protected virtual void Start()