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