1#pragma warning disable 649
20 [SerializeField]
private Object ModelAsset;
26 private string ModelPath
31 return AssetDatabase.GetAssetPath(ModelAsset);
33 return "Models/TriLibSampleModel.obj";
50 var assetLoaderOptions = AssetLoader.CreateDefaultLoaderOptions();
53 AssetLoader.LoadModelFromStream(File.OpenRead(ModelPath), ModelPath,
null, OnLoad, OnMaterialsLoad,
54 OnProgress, OnError,
null, assetLoaderOptions);
64 private void OnError(IContextualizedError obj)
66 Debug.LogError($
"An error ocurred while loading your Model: {obj.GetInnerException()}");
74 private void OnProgress(AssetLoaderContext assetLoaderContext,
float progress)
76 Debug.Log($
"Loading Model. Progress: {progress:P}");
84 private void OnMaterialsLoad(AssetLoaderContext assetLoaderContext)
86 Debug.Log(
"Materials loaded. Model fully loaded.");
94 private void OnLoad(AssetLoaderContext assetLoaderContext)
96 Debug.Log(
"Model loaded. Loading materials.");
Represents a class that finds external resources at the given model base path.
Represents a sample that loads the "TriLibSample.obj" Model from the "Models" folder using a File Str...
Represents a class that finds textures at the given model base path.