Tanoda
ExternalDataMapperSample.cs
Go to the documentation of this file.
1
using
System;
2
using
System.IO;
3
using
TriLibCore
.
Mappers
;
4
using
TriLibCore
.
Utils
;
5
using
UnityEngine
;
6
7
namespace
TriLibCore.Samples
8
{
12
public
class
ExternalDataMapperSample
: ExternalDataMapper
13
{
24
public
override
Stream
Map
(AssetLoaderContext assetLoaderContext,
string
originalFilename, out
string
finalPath)
25
{
26
finalPath = $
"{assetLoaderContext.BasePath}/{FileUtils.GetFilename(originalFilename)}"
;
27
if
(File.Exists(finalPath))
28
{
29
Debug
.Log($
"Found external file at: {finalPath}"
);
30
return
File.OpenRead(finalPath);
31
}
32
33
throw
new
Exception($
"File {originalFilename} not found."
);
34
}
35
}
36
}
Debug
UnityEngine.Debug Debug
Definition:
TanodaServer.cs:19
TriLibCore.Samples.ExternalDataMapperSample
Represents a class that finds external resources at the given model base path.
Definition:
ExternalDataMapperSample.cs:13
TriLibCore.Samples.ExternalDataMapperSample.Map
override Stream Map(AssetLoaderContext assetLoaderContext, string originalFilename, out string finalPath)
Tries to find the given external data source using the original resource filename and the context par...
Definition:
ExternalDataMapperSample.cs:24
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
ExternalDataMapperSample.cs
Generated by
1.9.3