fork download
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BulletTimeTrigger : MonoBehaviour {
  6.  
  7. public TimeManager tm;
  8. public List <GameObject> enemies;
  9. public GameObject triggeredEnemy;
  10.  
  11. void Start () {
  12. enemies=new List<GameObject>();
  13. }
  14.  
  15. void OnTriggerEnter(Collider col){
  16.  
  17.  
  18.  
  19. if(col.tag=="enemy"){
  20. //tm.DoSlowMotion ();
  21. triggeredEnemy = col.gameObject ;
  22. enemies.Add (triggeredEnemy);
  23.  
  24. }
  25. }
  26.  
  27. public void RemoveEnemy(GameObject killedEnemy){
  28. Debug.Log ("Remove enemy works");
  29. if (enemies.Contains(killedEnemy)) {
  30. Debug.Log ("its alive!2");
  31. enemies.Remove (killedEnemy);
  32. }
  33. }
  34.  
  35. void OnTriggerExit(Collider col){
  36. if (enemies.Contains (col.gameObject)) {
  37. enemies.Remove (col.gameObject);
  38.  
  39. }
  40. }
  41.  
  42.  
  43.  
  44. void Update(){
  45.  
  46. Debug.Log ("Enemies count "+enemies.Count);
  47.  
  48. }
  49. }
  50.  
  51.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(3,7): error CS0246: The type or namespace name `UnityEngine' could not be found. Are you missing an assembly reference?
prog.cs(5,34): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?
prog.cs(7,9): error CS0246: The type or namespace name `TimeManager' could not be found. Are you missing an assembly reference?
prog.cs(8,15): error CS0246: The type or namespace name `GameObject' could not be found. Are you missing an assembly reference?
prog.cs(9,9): error CS0246: The type or namespace name `GameObject' could not be found. Are you missing an assembly reference?
prog.cs(15,22): error CS0246: The type or namespace name `Collider' could not be found. Are you missing an assembly reference?
prog.cs(27,26): error CS0246: The type or namespace name `GameObject' could not be found. Are you missing an assembly reference?
prog.cs(35,21): error CS0246: The type or namespace name `Collider' could not be found. Are you missing an assembly reference?
Compilation failed: 8 error(s), 0 warnings
stdout
Standard output is empty