You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jeremy/Assets/Scripts/AnimationStarter.cs

22 lines
375 B

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();
}
}