Files
Jeremy/Assets/Scripts/AnimationStarter.cs
T
2025-01-04 13:29:07 +01:00

22 lines
375 B
C#

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