void OnTriggerEnter(Collider col) { marcEvent mon_event; if (col.gameObject.GetComponent <keyboardKey> ()) { pressed_key = col.gameObject.GetComponent <keyboardKey> (); if (pressed_key.scripts.Count != 0) { if (pressed_key.is_random == true) { mon_event = pressed_key.scripts [Random.Range(0, pressed_key.scripts.Count)]; } else { mon_event = pressed_key.scripts [0]; } print(mon_event.name); if (eplayer.Play_Event(mon_event) == true) { pressed_key.scripts.Remove(mon_event); } } else { print("Cannot play event"); } } }