2022-12-18 13:05:19 +08:00
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
|
|
|
|
using UnityEngine;
|
2023-11-10 14:37:56 +08:00
|
|
|
|
|
|
|
|
|
#if MA_VRCSDK3_AVATARS
|
2023-08-05 14:47:03 +08:00
|
|
|
|
using VRC.SDKBase;
|
2023-11-10 14:37:56 +08:00
|
|
|
|
#endif
|
2022-12-18 13:05:19 +08:00
|
|
|
|
|
|
|
|
|
namespace nadena.dev.modular_avatar.core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2023-08-05 14:47:03 +08:00
|
|
|
|
/// This component was previously used to trigger avatar processing when entering play mode. This functionality has
|
|
|
|
|
/// moved to NDMF, so we leave here a stub to clean up detritus left behind from older versions of MA.
|
2022-12-18 13:05:19 +08:00
|
|
|
|
/// We create it on a hidden object via AvatarTagObject's OnValidate, and it will proceed to add MAAvatarActivator
|
|
|
|
|
/// components to all avatar roots which contain MA components. This MAAvatarActivator component then performs MA
|
|
|
|
|
/// processing on Awake.
|
|
|
|
|
///
|
|
|
|
|
/// Note that we do not directly process the avatars from MAActivator. This is to avoid processing avatars that are
|
|
|
|
|
/// initially inactive in the scene (which can have high overhead if the user has a lot of inactive avatars in the
|
|
|
|
|
/// scene).
|
|
|
|
|
/// </summary>
|
2024-10-20 09:58:41 +08:00
|
|
|
|
[AddComponentMenu("/")]
|
2022-12-18 13:05:19 +08:00
|
|
|
|
[ExecuteInEditMode]
|
|
|
|
|
[DefaultExecutionOrder(-9998)]
|
2023-08-05 14:47:03 +08:00
|
|
|
|
public class Activator : MonoBehaviour, IEditorOnly
|
2022-12-18 13:05:19 +08:00
|
|
|
|
{
|
2023-08-05 14:47:03 +08:00
|
|
|
|
private void Update()
|
2022-12-18 13:05:19 +08:00
|
|
|
|
{
|
2023-08-05 14:47:03 +08:00
|
|
|
|
UnityEngine.Object.DestroyImmediate(gameObject);
|
2022-12-18 13:05:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-20 09:58:41 +08:00
|
|
|
|
[AddComponentMenu("/")]
|
2022-12-18 13:05:19 +08:00
|
|
|
|
[ExecuteInEditMode]
|
|
|
|
|
[DefaultExecutionOrder(-9997)]
|
2023-08-05 14:47:03 +08:00
|
|
|
|
public class AvatarActivator : MonoBehaviour, IEditorOnly
|
2022-12-18 13:05:19 +08:00
|
|
|
|
{
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
|
|
|
|
DestroyImmediate(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|