AlicizaX/Client/Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs

18 lines
509 B
C#
Raw Normal View History

2025-07-11 21:00:00 +08:00
#if PRIME_TWEEN_INSTALLED
using UnityEngine;
namespace PrimeTweenDemo {
public class HighlightableElement : MonoBehaviour {
[SerializeField] public Transform highlightAnchor;
public MeshRenderer[] models { get; private set; }
void OnEnable() {
models = GetComponentsInChildren<MeshRenderer>();
foreach (var mr in models) {
2026-02-28 17:09:15 +08:00
mr.sharedMaterial = new Material(mr.sharedMaterial); // copy shared material
2025-07-11 21:00:00 +08:00
}
}
}
}
2026-02-28 17:09:15 +08:00
#endif