using UnityEngine; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.AddressableAssets; public class CreateFloor : MonoBehaviour { public static void SetFloor(bool isFirstCreation = false) { //print("_G.FLCs=====" + _G.FLCs);//_G.FLCs=====CERA.13?#FFFFFF?#323232?#737373?1_1?56?0.5?0.1666667?0 print("_G.FLCs=====" + _G.FLCs); //CERA.7? // #ffffff? // DAD7D7? // D4D3D3? // 2-2? // 68? // 0.9? // 0.3 ? //0 //CERA.8? // #C79C63? // 604D4D? // CCCCCC? // 2-2? // 29? // 0.9?0.3?0 _G.FLOORMAT = UIT_MATERIAL.GetMaterial(_G.FLCs); _G.FLOOR.GetComponent().material = _G.FLOORMAT; string Code = _G.FLCs.Replace("?", ","); Addressables.LoadAssetAsync(Code.Split(",")[0]).Completed += Texture_Completed; } private static void Texture_Completed(AsyncOperationHandle handle) { if (handle.Status == AsyncOperationStatus.Succeeded) { Texture2D AdressableTexture = Instantiate(handle.Result); _G.FLOORMAT.SetTexture("_Texture", AdressableTexture); } } }