void Start(){ if(inputField != null){ parentTask = transform.parent.parent.parent.GetComponent<TaskPanel>(); inputField.gameObject.SetActive (true); inputField.Select(); checkButton.gameObject.SetActive(true); deleteButton.gameObject.SetActive(false); }else{ checkButton.gameObject.SetActive(false); deleteButton.gameObject.SetActive(true); } if(optionsMenu == null){ optionsMenu = parentTask.taskList.optionsMenu; } }
/// <summary> /// Instantiates Menu_Manager and setups the menu item positions. /// </summary> /// <param name="graphics"></param> public Menu_Manager(GraphicsDeviceManager graphics) { CenterPos = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2); menu_item1_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y - 100); menu_item2_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y - 50); menu_item3_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y + 0); menu_item4_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y + 50); menu_item5_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y + 100); New_menu_item1_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y - 50); New_menu_item2_Pos = new Vector2(CenterPos.X - 100, CenterPos.Y + 0); aboutmenu = new AboutMenu(CenterPos); optionsmenu = new OptionsMenu(CenterPos); helpmenu = new HelpMenu(CenterPos); failmenu = new FailMenu(CenterPos); }
public void Awake() { DontDestroyOnLoad(this); Instance = this; MessageLog = new MessageLog(); MessageLog.Skin = BaseSkin; //uLink.Network.natFacilitatorIP = "107.170.78.82"; ExternalServerList = new ExternalServerList(); ExternalServerList.OnMasterServerListChanged += ReceiveMasterListChanged; ExternalServerList.OnMasterServerListFetchError += ReceiveMasterListFetchError; BoxSpacer = new GUIStyle(BaseSkin.box) {fixedWidth = 1}; OptionsMenu = new OptionsMenu(BaseSkin); OptionsMenu.OnOptionsMenuWantsClosed += () => { ShowOptions = false; }; OptionsMenu.OnOptionsMenuWantsQuitGame += Application.Quit; OptionsMenu.OnOptionsMenuWantsGoToTitle += uLink.Network.Disconnect; // We want 60fps send rate, but Unity seems retarded and won't actually // send at the rate you give it. So we'll just specify it higher and // hope to meet the minimum of 60 ticks per second. uLink.Network.sendRate = 80; // Set up thing that requests to get our WAN IP from some server. AddressFinder = new ExternalAddressFinder(); }
public OptionsButton(MainMenu m) { mainMenu = m; optionsMenu = OptionsMenu.Create(m); }
public void Start(){ taskList = GameObject.FindGameObjectWithTag("TaskList").GetComponent<TaskList>(); if(optionsMenu == null){ optionsMenu = taskList.optionsMenu; } }
public static void ShowPage(OptionsMenu optionsMenu, OptionsMenu.Page page) { if (page == OptionsMenu.Page.SpectatorCam && !menuCreated) { /*string toggleText = "OFF"; * * if (config.activated) * { * toggleText = "ON"; * } * * toggleButton = optionsMenu.AddButton * (0, * toggleText, * new Action(() => { * if (config.activated) * { * config.activated = false; * toggleButton.label.text = "OFF"; * SaveConfig(); * } * else * { * config.activated = true; * toggleButton.label.text = "ON"; * SaveConfig(); * } * }), * null, * "Turns the follow camera on or off"); */ positionSmoothingSlider = optionsMenu.AddSlider ( 0, "Position Speed", "P", new Action <float>((float n) => { config.positionSmoothing = Mathf.Round((config.positionSmoothing + (n * 0.001f)) * 1000.0f) / 1000.0f; UpdateSlider(positionSmoothingSlider, "Position Smoothing : " + config.positionSmoothing.ToString()); }), null, null, "Changes how smooth position will be" ); positionSmoothingSlider.label.text = "Position Smoothing : " + config.positionSmoothing.ToString(); rotationSmoothingSlider = optionsMenu.AddSlider ( 0, "Rotation Speed", "P", new Action <float>((float n) => { config.rotationSmoothing = Mathf.Round((config.rotationSmoothing + (n * 0.001f)) * 1000.0f) / 1000.0f; UpdateSlider(rotationSmoothingSlider, "Rotation Smoothing : " + config.rotationSmoothing.ToString()); }), null, null, "Changes how smooth rotation will be" ); rotationSmoothingSlider.label.text = "Rotation Smoothing : " + config.rotationSmoothing.ToString(); camOffsetSlider = optionsMenu.AddSlider ( 0, "Horizontal Offset", "P", new Action <float>((float n) => { config.camOffset = Mathf.Round((config.camOffset + (n * 0.1f)) * 10.0f) / 10.0f; UpdateSlider(camOffsetSlider, "Horizontal Offset : " + config.camOffset.ToString()); }), null, null, "Changes horizontal position" ); camOffsetSlider.label.text = "Horizontal Offset : " + config.camOffset.ToString(); camHeightSlider = optionsMenu.AddSlider ( 0, "Vertical Offset", "P", new Action <float>((float n) => { config.camHeight = Mathf.Round((config.camHeight + (n * 0.1f)) * 10.0f) / 10.0f; UpdateSlider(camHeightSlider, "Vertical Offset : " + config.camHeight.ToString()); }), null, null, "Changes vertical position" ); camHeightSlider.label.text = "Vertical Offset : " + config.camHeight.ToString(); camDistanceSlider = optionsMenu.AddSlider ( 0, "Distance", "P", new Action <float>((float n) => { config.camDistance = Mathf.Round((config.camDistance + (n * 0.1f)) * 10.0f) / 10.0f; UpdateSlider(camDistanceSlider, "Distance : " + config.camDistance.ToString()); }), null, null, "Changes the distance" ); camDistanceSlider.label.text = "Distance : " + config.camDistance.ToString(); camRotationSlider = optionsMenu.AddSlider ( 0, "Tilt", "P", new Action <float>((float n) => { config.camRotation = Mathf.Round((config.camRotation + (n * 0.1f)) * 10.0f) / 10.0f; UpdateSlider(camRotationSlider, "Rotation : " + config.camRotation.ToString()); }), null, null, "Changes the rotation" ); camRotationSlider.label.text = "Rotation : " + config.camRotation.ToString(); optionsMenu.scrollable.AddRow(optionsMenu.AddHeader(0, "Follow Camera <size=5>Must be set to 3rd person static</size>")); //optionsMenu.scrollable.AddRow(toggleButton.gameObject); optionsMenu.scrollable.AddRow(positionSmoothingSlider.gameObject); optionsMenu.scrollable.AddRow(rotationSmoothingSlider.gameObject); optionsMenu.scrollable.AddRow(camOffsetSlider.gameObject); optionsMenu.scrollable.AddRow(camHeightSlider.gameObject); optionsMenu.scrollable.AddRow(camDistanceSlider.gameObject); optionsMenu.scrollable.AddRow(camRotationSlider.gameObject); if (config.activated) { spectatorCam.previewCam.gameObject.SetActive(true); spectatorCam.previewCamDisplay.SetActive(true); } menuCreated = true; } else { menuCreated = false; } }
public void OnOptionsPressed() { OptionsMenu.Show(); }
public void CloseOptions() { OptionsMenu.SetActive(false); }
public void OpenOptions() { OptionsMenu.SetActive(true); }
public void OpenOptionsMenu() { Menu.SetActive(false); StartGameMenu.SetActive(false); OptionsMenu.SetActive(true); }