private void DisplayTargetRoom(bool enable) { var map = FindObjectOfType <TaskSwitcher>().CurrentTask.Megamap; map.gameObject.SetActive(enable); // Disable/Enable colliders for all selectable rooms and balls. // FIXME: This seems to not always reliably disable the colliders? // It's not a severe problem for now because when raycasting we cast for all // colliders and only act when the collider of the targetRoom is found // anyway. foreach (var room in map.SelectableRooms) { var colls = room.GetComponentsInChildren <Collider>(true); Array.ForEach(colls, c => c.enabled = !enable); } // Re-enable collider for target room so it can be used for raycasting. map.TargetRoom.GetComponent <Collider>().enabled = true; // Make only target room visible. ChangeVisibility.SetVisible(map.gameObject, !enable); ChangeVisibility.SetVisible(map.TargetRoom.gameObject, true); var marker = GameObject.Find("UserMarker Circle"); if (marker != null) { ChangeVisibility.SetVisible(marker, false); } }
private void OnEnable() { ChangeVisibility.SetVisible(usermarkerOnMap, true); ChangeVisibility.SetVisible(usermarkerInEnvironment, true); }
private void OnDisable() { ChangeVisibility.SetVisible(usermarkerOnMap, false); ChangeVisibility.SetVisible(usermarkerInEnvironment, false); }