fix: implement ResolveReferences for reactive objects (#1019)

Closes: #996
This commit is contained in:
bd_ 2024-08-18 19:03:18 -07:00 committed by GitHub
parent c2b381c721
commit eb5a04511d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 25 additions and 3 deletions

View File

@ -31,9 +31,10 @@ using VRC.SDKBase;
namespace nadena.dev.modular_avatar.core
{
/**
* This abstract base class is injected into the VRCSDK avatar component allowlist to avoid
*/
/// <summary>
/// This class is used internally by Modular Avatar for common operations between MA components. It should not be
/// inherited by user classes, and will be removed in Modular Avatar 2.0.
/// </summary>
[DefaultExecutionOrder(-9999)] // run before av3emu
public abstract class AvatarTagComponent : MonoBehaviour, IEditorOnly
{

View File

@ -39,5 +39,13 @@ namespace nadena.dev.modular_avatar.core
get => m_objects;
set => m_objects = value;
}
public override void ResolveReferences()
{
foreach (var obj in m_objects)
{
obj.Object?.Get(this);
}
}
}
}

View File

@ -22,5 +22,13 @@ namespace nadena.dev.modular_avatar.core
get => m_objects;
set => m_objects = value;
}
public override void ResolveReferences()
{
foreach (var obj in m_objects)
{
obj.Object?.Get(this);
}
}
}
}

View File

@ -65,5 +65,10 @@ namespace nadena.dev.modular_avatar.core
get => m_shapes;
set => m_shapes = value;
}
public override void ResolveReferences()
{
m_targetRenderer?.Get(this);
}
}
}