liuzhiwei
2020-12-21 a2786894c7f3dad3583fc2d098d6642d7eef9f03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using UnityEngine;
 
namespace TowerDefense.UI
{
    /// <summary>
    /// A simple component that plays an animation
    /// </summary>
    [RequireComponent(typeof(Animation))]
    public class PlayAnimation : MonoBehaviour
    {
        Animation m_Animation;
        
        public void Play(string animationName)
        {
            m_Animation.Play(animationName);
        }
 
        void Start()
        {
            m_Animation = GetComponent<Animation>();
        }
        
    }
}