20 lines
		
	
	
		
			416 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			416 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| using UnityEngine.Events;
 | |
| 
 | |
| public class SpawnTrigger : MonoBehaviour
 | |
| {
 | |
| 
 | |
|     public UnityEvent spawn_event;
 | |
|     public void OnTriggerEnter(Collider other)
 | |
|     {
 | |
|         if (other.tag == "Player")
 | |
|         {
 | |
|             Debug.Log("Player spawned boss");
 | |
|             spawn_event.Invoke();
 | |
|             this.enabled = false;
 | |
|         }
 | |
|     }
 | |
| }
 |