AirWallDetection.cs 848 B

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