private void ChangeState() { if (ActiveWidgetManager.currentActive == ActiveWidgetManager.ActiveWidget.None || ActiveWidgetManager.currentActive == ActiveWidgetManager.ActiveWidget.Bookmark) { editModeState = !editModeState; // this means we are switching out of Edit mode if (!editModeState) { //restoring the original window POI_ReferenceHub.Instance.POIMenu.gameObject.GetComponent <Image>().color = Color.white; POI_ReferenceHub.Instance.POIEditWindow.gameObject.SetActive(false); POI_ReferenceHub.Instance.AddDeleteWindow.gameObject.SetActive(false); POI_ReferenceHub.Instance.BookmarkCurrentLocationWindow.gameObject.SetActive(false); POIButtonManager.instance.LoadAndGenerateButs(); ActiveWidgetManager.DeactivateWidget(ActiveWidgetManager.ActiveWidget.Bookmark); } // this means we are switching into Edit mode else { if (ActiveWidgetManager.ActivateWidget(ActiveWidgetManager.ActiveWidget.Bookmark)) { OpenAddDeleteWindow(); //change the color of the POImenu POI_ReferenceHub.Instance.POIMenu.gameObject.GetComponent <Image>().color = Color.black; } } } }
/// <summary> /// Closes the character drop menu. /// </summary> public void CloseCharacterDrop() { if (ActiveWidgetManager.currentActive == ActiveWidgetManager.ActiveWidget.CharacterDrop) { dropCharacterSelectPanel.gameObject.SetActive(false); Destroy(activeChar); activeChar = null; buttonImage.color = Color.white; currentState = CharacterDropperState.SelectExisting; ActiveWidgetManager.DeactivateWidget(ActiveWidgetManager.ActiveWidget.CharacterDrop); ActiveWidgetManager.ActivateWidget(ActiveWidgetManager.ActiveWidget.WidgetConfig); } }
/// <summary> /// Opens the character drop menu. /// </summary> public void OpenCharacterDrop() { if (ActiveWidgetManager.currentActive == ActiveWidgetManager.ActiveWidget.WidgetConfig) { dropCharacterSelectPanel.gameObject.SetActive(true); modelToggleGroup.SetAllTogglesOff(); randomToggle.isOn = true; activeChar = GetCharacter(); buttonImage.color = Color.red; currentState = CharacterDropperState.DroppingNew; ActiveWidgetManager.DeactivateWidget(ActiveWidgetManager.ActiveWidget.WidgetConfig); ActiveWidgetManager.ActivateWidget(ActiveWidgetManager.ActiveWidget.CharacterDrop); } }
public void OpenNewCityPanel() { if (ActiveWidgetManager.ActivateWidget(ActiveWidgetManager.ActiveWidget.Sunlight)) { newCityPanel.gameObject.SetActive(true); newCityPanel.anchoredPosition3D = new Vector3(350, -80, 0); Vector3[] corners = new Vector3[4]; newCityPanel.GetWorldCorners(corners); Rect screenRect = new Rect(0, 0, Screen.width, Screen.height); if (!screenRect.Contains(corners[2])) { newCityPanel.anchoredPosition3D = new Vector3(-105, -80, 0); } } }
private void OpenMenu() { if (ActiveWidgetManager.ActivateWidget(ActiveWidgetManager.ActiveWidget.WidgetConfig)) { WidgetTransitions.Instance.SlideWidgetRoot(); //all of the menu buttons need to be opened here foreach (Transform child in quickAccessBar.transform) { child.gameObject.SetActive(true); iTween.MoveFrom(child.gameObject, iTween.Hash(iT.MoveBy.x, Screen.width, iT.MoveBy.easetype, "easeOutCubic", iT.MoveBy.time, .6)); // time is different to control button arrive time } menuButtonsOpen = true; tpControlRef.allowPlayerInput = false; toggleMenuButtonManagerRef.clickedState = true; toggleMenuButtonManagerRef.clickTime = Time.time; } }
/// <summary> /// Opens the character info panel. /// </summary> /// <param name="charToOpen"></param> public void OpenCharacterInfo(GameObject charToOpen) { Destroy(activeChar); activeChar = charToOpen; mouseDownOnChar = false; wanderToEdit = activeChar.GetComponent <CharacterWander>(); activeChar.GetComponent <UnityEngine.AI.NavMeshAgent>().Stop(); wanderToEdit.CancelMovement(); activeChar.GetComponent <Animator>().enabled = false; charInfoPanel.gameObject.SetActive(true); if (wanderToEdit.mode == CharacterWander.WanderMode.Bookmark) { selectedMode = wanderToEdit.prevMode; } else { selectedMode = wanderToEdit.mode; } charInfoPanel.transform.position = UIUtilities.SetPopUpPanel(charInfoPanel); iTween.Stop(charInfoPanel.gameObject, true); charInfoPanel.localScale = new Vector3(.01f, .01f, .01f); iTween.ScaleBy(charInfoPanel.gameObject, iTween.Hash("x", 100, "y", 100, "easeType", "easeInOutExpo", "time", .5f)); UpdateCharInfoLabels(); destinationDropDown.ClearOptions(); destinationDropDown.AddOptions(new List <string>() { "None" }); destinationDropDown.AddOptions(new List <string>(POIButtonManager.originalHandler.projectPOIs.Select(e => e.buttonName).ToList())); ActiveWidgetManager.ActivateWidget(ActiveWidgetManager.ActiveWidget.CharacterDrop); currentState = CharacterDropperState.EditCharacter; }