Tanoda
TextureMapperSample.cs
Go to the documentation of this file.
1
using
System;
2
using
System.IO;
3
using
TriLibCore
.Interfaces;
4
using
TriLibCore
.
Mappers
;
5
using
TriLibCore
.
Utils
;
6
using
UnityEngine
;
7
8
namespace
TriLibCore.Samples
9
{
13
public
class
TextureMapperSample
: TextureMapper
14
{
22
public
override
TextureLoadingContext
Map
(AssetLoaderContext assetLoaderContext, ITexture texture)
23
{
24
var finalPath = $
"{assetLoaderContext.BasePath}/{FileUtils.GetFilename(texture.Filename)}"
;
25
if
(File.Exists(finalPath))
26
{
27
var textureLoadingContext =
new
TextureLoadingContext
28
{
29
Context = assetLoaderContext,
30
Stream = File.OpenRead(finalPath),
31
Texture = texture
32
};
33
Debug
.Log($
"Found texture at: {finalPath}"
);
34
return
textureLoadingContext;
35
}
36
37
throw
new
Exception($
"Texture {texture.Filename} not found."
);
38
}
39
}
40
}
Debug
UnityEngine.Debug Debug
Definition:
TanodaServer.cs:19
TriLibCore.Samples.TextureMapperSample
Represents a class that finds textures at the given model base path.
Definition:
TextureMapperSample.cs:14
TriLibCore.Samples.TextureMapperSample.Map
override TextureLoadingContext Map(AssetLoaderContext assetLoaderContext, ITexture texture)
Tries to retrieve a Stream to the Texture native data based on the given context.
Definition:
TextureMapperSample.cs:22
TriLibCore.Mappers
Definition:
AnimatorOverrideAnimationClipMapper.cs:4
TriLibCore.Samples
Definition:
AssetViewer.cs:15
TriLibCore.Utils
Definition:
GraphicsSettingsUtils.cs:4
TriLibCore
Definition:
AssetLoaderOptionsEditor.cs:6
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
TriLib
TriLibSamples
LoadModelFromStream
Mappers
TextureMapperSample.cs
Generated by
1.9.3