PresetTrigger.cs 609 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace TrafficSimulation{
  5. public class PresetTrigger : MonoBehaviour
  6. {
  7. public bool isTriggered;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. this.isTriggered = false;
  12. }
  13. // Update is called once per frame
  14. void Update()
  15. {
  16. }
  17. private void OnTriggerEnter(Collider other) {
  18. if(other.gameObject.tag == "bike"){
  19. this.isTriggered = true;
  20. }
  21. }
  22. }
  23. }