mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-25 15:47:26 -05:00
UnityObjectManager から ScriptedImporter に移譲する
This commit is contained in:
parent
a17c789a02
commit
e9d4654678
|
|
@ -51,7 +51,7 @@ namespace UniGLTF
|
|||
var loaded = loader.Load();
|
||||
loaded.ShowMeshes();
|
||||
|
||||
loader.TransferOwnership((k, o) =>
|
||||
loaded.TransferOwnership((k, o) =>
|
||||
{
|
||||
context.AddObjectToAsset(k.Name, o);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -313,8 +313,7 @@ namespace UniGLTF
|
|||
{
|
||||
foreach (var mesh in Meshes.ToArray())
|
||||
{
|
||||
// mesh の extract は実装していないので SubAssetKey を使わない
|
||||
if (take(default, mesh.Mesh))
|
||||
if (take(SubAssetKey.Create(mesh.Mesh), mesh.Mesh))
|
||||
{
|
||||
Meshes.Remove(mesh);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,16 +47,19 @@ namespace UniGLTF
|
|||
|
||||
public void TransferOwnership(TakeResponsibilityForDestroyObjectFunc take)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
foreach (var (key, x) in m_resources.ToArray())
|
||||
{
|
||||
if (take(key, x))
|
||||
{
|
||||
m_resources.Remove((key, x));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var (key, x) in m_resources)
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
// Debug.Log($"Destroy: {x}");
|
||||
#endif
|
||||
UnityObjectDestoyer.DestroyRuntimeOrEditor(x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace UniVRM10
|
|||
var loaded = loader.Load();
|
||||
loaded.ShowMeshes();
|
||||
|
||||
loader.TransferOwnership((key, o) =>
|
||||
loaded.TransferOwnership((key, o) =>
|
||||
{
|
||||
context.AddObjectToAsset(key.Name, o);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user