CoroutineManager.cs 303 B

123456789101112131415161718192021
  1. using System;
  2. using UnityEngine;
  3. namespace MoreLights
  4. {
  5. public class CoroutineManager : MonoBehaviour
  6. {
  7. Action action;
  8. public void SetAction(Action action)
  9. {
  10. this.action = action;
  11. }
  12. void OnEnable()
  13. {
  14. if (action != null)
  15. action.Invoke();
  16. }
  17. }
  18. }