using System.Collections.Generic; using DefaultNamespace.ProcessMode; using DefaultNamespace.ProcessMode.DefaultNamespace.ProcessMode; using DG.Tweening; using UnityEngine; namespace DefaultNamespace { public class TestAnimations : MonoBehaviour { private AnimationManager animationManager; public GameObject[] ggg; void Start() { animationManager = gameObject.AddComponent(); List group3 = new List { transform.DOMove(new Vector3(7, 2, 0), 1).SetAutoKill(false).Pause().OnComplete(() => Debug.Log("3_1")), transform.DOMove(new Vector3(7, 2, 0), 1).SetAutoKill(false).Pause().OnComplete(() => Debug.Log("3_1")), transform.DOMove(new Vector3(7, 2, 0), 1).SetAutoKill(false).Pause().OnComplete(() => Debug.Log("3_1")), }; animationManager.AddAnimationGroup(group3); Debug.Log("开始播放第一个动画组"); } void Update() { if (Input.GetKeyDown(KeyCode.A)) { Debug.Log("按下A"); animationManager.PlayAnimationGroup(0); } if (Input.GetKeyDown(KeyCode.B)) { Debug.Log("按下B"); animationManager.PlayAnimationGroup(1); } if (Input.GetKeyDown(KeyCode.C)) { Debug.Log("按下空格键"); animationManager.PlayAnimationGroup(2); } } } }