From ba4880b5f16e8f22cad6d12e5c38832bf6dc90a2 Mon Sep 17 00:00:00 2001 From: phuong-axie Date: Sat, 28 Oct 2023 23:11:03 +0700 Subject: [PATCH] Strip CR --- .../AxieInfinity/AxieMixerUnity/Components/Builder/Mixer.cs | 4 +++- .../AxieMixerUnity/Components/Helper/AxieMixerMaterials.cs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Assets/AxieInfinity/AxieMixerUnity/Components/Builder/Mixer.cs b/Assets/AxieInfinity/AxieMixerUnity/Components/Builder/Mixer.cs index f47e546..098f457 100644 --- a/Assets/AxieInfinity/AxieMixerUnity/Components/Builder/Mixer.cs +++ b/Assets/AxieInfinity/AxieMixerUnity/Components/Builder/Mixer.cs @@ -110,7 +110,9 @@ private static Dictionary LoadAxieAtlasStuff() { Dictionary textures = new Dictionary(); var atlasAsset = Resources.Load($"{StuffName}/{quality}/axie-2d-v3-stuff"); - string[] lines = atlasAsset.text.Split('\n').Where(x => x.Contains(".png")).Select(x => x.Replace(".png", "")).ToArray(); + string atlasStr = atlasAsset.text; + atlasStr = atlasStr.Replace("\r", ""); + string[] lines = atlasStr.Split('\n').Where(x => x.Contains(".png")).Select(x => x.Replace(".png", "")).ToArray(); foreach (var texName in lines) { var colorTexture = Resources.Load($"{StuffName}/{quality}/{texName}_color"); diff --git a/Assets/AxieInfinity/AxieMixerUnity/Components/Helper/AxieMixerMaterials.cs b/Assets/AxieInfinity/AxieMixerUnity/Components/Helper/AxieMixerMaterials.cs index 47d13da..bbb4363 100644 --- a/Assets/AxieInfinity/AxieMixerUnity/Components/Helper/AxieMixerMaterials.cs +++ b/Assets/AxieInfinity/AxieMixerUnity/Components/Helper/AxieMixerMaterials.cs @@ -108,7 +108,10 @@ Dictionary baseMaterials static List LoadMaterials(SplatAtlasStuff atlasStuff, Material baseMaterial) { List materials = new List(); - string[] texList = atlasStuff.atlasAssetText.Split('\n').Where(x => x.Contains(".png")).Select(x => x.Replace(".png", "")).ToArray(); + string atlasStr = atlasStuff.atlasAssetText; + atlasStr = atlasStr.Replace("\r", ""); + + string[] texList = atlasStr.Split('\n').Where(x => x.Contains(".png")).Select(x => x.Replace(".png", "")).ToArray(); foreach (var texName in texList) { var material = new Material(baseMaterial);