GameEventCenter.cs 560 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /* 游戏事件中心-订阅发布 */
  5. public class GameEventCenter : MonoBehaviour
  6. {
  7. public System.Action<ArmBow, Arrow> onBowArrowShootOut;
  8. public System.Action<TargetAnimal, int> onTargetAnimalHurt;
  9. private static GameEventCenter _ins;
  10. public static GameEventCenter ins {
  11. get {
  12. if (!_ins) {
  13. _ins = new GameObject("GameEventCenter").AddComponent<GameEventCenter>();
  14. }
  15. return _ins;
  16. }
  17. }
  18. }