ChallengeTargetCanvas.cs 644 B

123456789101112131415161718192021
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /*
  5. 闯关场景专用靶子Canvas
  6. 需求:在打猎游戏里,一开始屏幕中央给一个靶子(类似静止靶界面让玩家一开始视角校准用的)
  7. */
  8. public class ChallengeTargetCanvas : MonoBehaviour
  9. {
  10. void Start()
  11. {
  12. transform.Find("RawImage").gameObject.SetActive(true);
  13. GameEventCenter.ins.onBowArrowShootOut += Event_OnBowArrowShootOut;
  14. }
  15. void Event_OnBowArrowShootOut(ArmBow a, Arrow b) {
  16. GameEventCenter.ins.onBowArrowShootOut -= Event_OnBowArrowShootOut;
  17. Destroy(gameObject);
  18. }
  19. }