1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.IO;
- using TriLibCore.Mappers;
- using TriLibCore.Utils;
- using UnityEngine;
- namespace TriLibCore.Samples
- {
-
-
-
- public class ExternalDataMapperSample : ExternalDataMapper
- {
-
-
-
-
-
-
-
- public override Stream Map(AssetLoaderContext assetLoaderContext, string originalFilename, out string finalPath)
- {
- finalPath = $"{assetLoaderContext.BasePath}/{FileUtils.GetFilename(originalFilename)}";
- if (File.Exists(finalPath))
- {
- Debug.Log($"Found external file at: {finalPath}");
- return File.OpenRead(finalPath);
- }
- throw new Exception($"File {originalFilename} not found.");
- }
- }
- }
|