Obstacle.cs 310 B

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