void OnTriggerExit(Collider other) { // only accept the player get into this trigger HHK_Role_Tags rt = other.gameObject.GetComponent <HHK_Role_Tags>(); if (rt) { HHK_Role_Tags.TAG[] tags = { HHK_Role_Tags.TAG.Role_Player }; if (rt.Is_Belong_Teams(tags)) { // player get into this trigger // ready to shift to next level HHK_Entry_Points_Manager.ready_to_go = true; } } }
void OnTriggerStay(Collider other) { // just for player HHK_Role_Tags rt = other.gameObject.GetComponent <HHK_Role_Tags>(); if (rt) { if (rt.Is_Belong_Teams(new HHK_Role_Tags.TAG[] { HHK_Role_Tags.TAG.Role_Player })) { // set the time limit; force_to_leave_time_limit = maxTime * force_to_leave_time_limit_scale; // join to this place Join_To_This_Place(rt); } } }
void OnTriggerEnter(Collider other) { // only accept the player get into this trigger // and he is ready to go. HHK_Role_Tags rt = other.gameObject.GetComponent <HHK_Role_Tags>(); if (rt) { HHK_Role_Tags.TAG[] tags = { HHK_Role_Tags.TAG.Role_Player }; if (rt.Is_Belong_Teams(tags) && HHK_Entry_Points_Manager.ready_to_go) { // player get into this trigger // shift to the next level and start at the given start point/entry point HHK_Entry_Points_Manager.which_start_point = which_start_point; Application.LoadLevel(to_next_level); } } }
void OnTriggerStay(Collider other) { // when the player click the key, then turn on/off the light if (Input.GetKeyDown(actionKey)) { HHK_Role_Tags rt = other.gameObject.GetComponent <HHK_Role_Tags>(); if (rt) { // player get stay this trigger HHK_Role_Tags.TAG[] tags = { HHK_Role_Tags.TAG.Role_Player }; if (rt.Is_Belong_Teams(tags)) { if (target) { target.enabled = !target.enabled; } } } } }