Obstacle.cs 375 B

123456789101112131415161718192021
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Mono;
  5. using UnityEngine;
  6. public class Obstacle : MonoBehaviour
  7. {
  8. private void OnTriggerEnter(Collider other)
  9. {
  10. if (other.tag == "Player")
  11. {
  12. Player.Instance.SetMoveSpeed(-1f);
  13. UIManager.Instance.PlayAudioClip("Hit");
  14. }
  15. }
  16. }