AirWallDetection.cs 654 B

12345678910111213141516171819202122232425262728
  1. using UnityEngine;
  2. public class AirWallDetection : MonoBehaviour
  3. {
  4. // Start is called once before the first execution of Update after the MonoBehaviour is created
  5. //void Start()
  6. //{
  7. //}
  8. // Update is called once per frame
  9. //void Update()
  10. //{
  11. //}
  12. // 飞盘撞到空气墙,判断为出界
  13. private void OnTriggerEnter(Collider other)
  14. {
  15. if (other.gameObject.tag == "Throw Material")
  16. {
  17. Debug.Log("飞盘出界了。 " + other.gameObject.tag);
  18. PlayData.throwHitWall = true;
  19. PlayData.gameStatus = PlayData.GameStatus.finishOutOfBound;
  20. }
  21. }
  22. }