| | 1 | | using DCL.Helpers; |
| | 2 | | using System.Collections; |
| | 3 | | using System.IO; |
| | 4 | | using UnityEditor.Experimental.TerrainAPI; |
| | 5 | | using UnityEngine.Networking; |
| | 6 | | using MappingPair = DCL.ContentServerUtils.MappingPair; |
| | 7 | |
|
| | 8 | | namespace DCL.ABConverter |
| | 9 | | { |
| | 10 | | public class AssetPath |
| | 11 | | { |
| | 12 | | public readonly string basePath; |
| | 13 | | public readonly MappingPair pair; |
| 0 | 14 | | public string hash => pair.hash; |
| 0 | 15 | | public string file => pair.file; |
| | 16 | |
|
| 0 | 17 | | public AssetPath(string basePath, string hash, string file) |
| | 18 | | { |
| 0 | 19 | | this.basePath = basePath; |
| 0 | 20 | | this.pair = new MappingPair { hash = hash, file = file }; |
| 0 | 21 | | } |
| | 22 | |
|
| 0 | 23 | | public AssetPath(string basePath, MappingPair pair) |
| | 24 | | { |
| 0 | 25 | | this.basePath = basePath; |
| 0 | 26 | | this.pair = pair; |
| 0 | 27 | | } |
| | 28 | |
|
| | 29 | | public string finalPath |
| | 30 | | { |
| | 31 | | get |
| | 32 | | { |
| 0 | 33 | | char dash = Path.DirectorySeparatorChar; |
| 0 | 34 | | string fileExt = Path.GetExtension(pair.file); |
| 0 | 35 | | return basePath + pair.hash + dash + pair.hash + fileExt; |
| | 36 | | } |
| | 37 | | } |
| | 38 | |
|
| 0 | 39 | | public string finalMetaPath => Path.ChangeExtension(finalPath, "meta"); |
| | 40 | |
|
| 0 | 41 | | public override string ToString() { return $"hash:{hash} - file:{file}"; } |
| | 42 | | } |
| | 43 | | } |