using System; using UnityEngine; public class AnimationStarter : MonoBehaviour { [SerializeField] private Animation _animation; private void OnValidate() { if (!_animation && TryGetComponent(out var animation)) { _animation = animation; } } public void Play() { _animation.Play(); } }