Files
Studio/Assets/Scripts/Studio/Command/FileCommand/LoadLocalTextureDataCommand.cs
2025-04-25 11:20:03 +09:00

50 lines
1.2 KiB
C#

using System.Collections;
using UnityEngine;
using XED.Manage;
namespace XED.Command
{
public class LoadLocalTextureDataCommand : IIrreversibleCommand
{
private FBXFileManager fbxFileManager;
private float loadTime = 0f;
public LoadLocalTextureDataCommand()
{
}
public string id { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public bool CanExecute()
{
throw new System.NotImplementedException();
}
public void Execute()
{
fbxFileManager = ManagerHub.instance.Get<FBXFileManager>();
foreach (var tex in fbxFileManager.saveData.textureDatas)
{
CoroutineRunner.instance.StartCoroutine(LoadTextureData(tex));
}
}
IEnumerator LoadTextureData(TextureData texData)
{
fbxFileManager.sharedMaterial.AddTextureData(texData);
loadTime += Time.deltaTime;
if (loadTime > 1f / 30f)
{
loadTime = 0f;
yield return null;
}
// yield return null;
}
}
}