2024-02-18 19:21:26 +08:00
|
|
|
|
#region
|
|
|
|
|
|
2024-03-05 16:19:54 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using VRC.SDKBase;
|
2024-03-03 16:26:23 +08:00
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
#endif
|
2024-02-18 19:21:26 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
namespace nadena.dev.modular_avatar.core
|
|
|
|
|
{
|
2024-03-05 16:19:54 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Legacy component from early 1.9.x builds.
|
|
|
|
|
/// </summary>
|
2024-02-18 19:21:26 +08:00
|
|
|
|
[ExecuteInEditMode]
|
2024-02-27 16:09:01 +08:00
|
|
|
|
[AddComponentMenu("")]
|
2024-02-18 19:21:26 +08:00
|
|
|
|
[RequireComponent(typeof(SkinnedMeshRenderer))]
|
|
|
|
|
internal class ScaleAdjusterRenderer : MonoBehaviour, IEditorOnly
|
|
|
|
|
{
|
2024-02-26 17:56:43 +08:00
|
|
|
|
#if UNITY_EDITOR
|
2024-02-18 19:21:26 +08:00
|
|
|
|
private void OnValidate()
|
|
|
|
|
{
|
2024-03-03 16:26:23 +08:00
|
|
|
|
if (PrefabUtility.IsPartOfPrefabAsset(this)) return;
|
2024-03-05 16:19:54 +08:00
|
|
|
|
|
2024-03-03 16:26:23 +08:00
|
|
|
|
EditorApplication.delayCall += () =>
|
2024-02-18 19:21:26 +08:00
|
|
|
|
{
|
2024-03-05 16:19:54 +08:00
|
|
|
|
if (this != null) DestroyImmediate(gameObject);
|
2024-02-18 19:21:26 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
2024-02-26 17:56:43 +08:00
|
|
|
|
#endif
|
2024-02-18 19:21:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|