modular-avatar/Runtime/ModularAvatarReplaceObject.cs

23 lines
726 B
C#
Raw Normal View History

using System.Collections.Generic;
using UnityEngine;
2023-07-23 13:22:25 +08:00
namespace nadena.dev.modular_avatar.core
{
[AddComponentMenu("Modular Avatar/MA Replace Object")]
[DisallowMultipleComponent]
[HelpURL("https://modular-avatar.nadena.dev/docs/reference/replace-object?lang=auto")]
public class ModularAvatarReplaceObject : AvatarTagComponent, IHaveObjReferences
2023-07-23 13:22:25 +08:00
{
public AvatarObjectReference targetObject = new AvatarObjectReference();
2023-08-05 14:47:03 +08:00
public override void ResolveReferences()
2023-08-05 14:47:03 +08:00
{
targetObject?.Get(this);
}
public IEnumerable<AvatarObjectReference> GetObjectReferences()
{
if (targetObject != null) yield return targetObject;
}
2023-07-23 13:22:25 +08:00
}
}