SceneAnimationEventLogic.cs 832 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. public class SceneAnimationEventLogic : MonoBehaviour
  6. {
  7. public Action AnimStart;
  8. public Action AnimEnd;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. SceneAnimationEvent info = this.gameObject.GetComponent<SceneAnimationEvent>();
  13. this.AnimStart = info.AnimStart;
  14. this.AnimEnd = info.AnimEnd;
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. }
  20. /// <summary>
  21. /// 播放开始
  22. /// </summary>
  23. public void PlayStartEvent()
  24. {
  25. if(AnimStart != null)
  26. {
  27. AnimStart();
  28. }
  29. }
  30. public void PlayEndEvent()
  31. {
  32. if(AnimEnd != null)
  33. {
  34. AnimEnd();
  35. }
  36. }
  37. }