Пример #1
0
		protected void OnSaveButton(VoxMenuButton button, bool state)
		{
			Debug.Log("Saving World");
			WorldName = "VoxWorld" + button.toolTip;

			SaveAll();
		}
Пример #2
0
	protected void OnToggleQuality(VoxMenuButton button, bool state)
	{
		if (!state) return;

		highRes = button.isSelected;

		var level = highRes ? highResLevel : defaultLevel;

		QualitySettings.SetQualityLevel(level);

		//OVRManager.instance.nativeTextureScale = highRes ? 1 : textureScaleHigh;

	}
Пример #3
0
	protected void OnToggleTextureScale(VoxMenuButton button, bool state)
	{
		if (!state) return;

		//var prevScale = ovrManager.nativeTextureScale;

		if (button.isSelected)
		{
			//OVRManager.instance.nativeTextureScale = textureScaleLow;
			//OVRManager.NativeTextureScaleModified(prevScale, textureScaleLow);
		}
		else
		{
			//OVRManager.instance.nativeTextureScale = textureScaleHigh;
		}

		//OVRManager.ForceNativeTextureScaleModified();

		//ovrManager.gameObject.SetActive(false);
		//ovrManager.gameObject.SetActive(true);

		//ovrManager.gameObject.SetActive(false);
		//ovrManager.gameObject.SetActive(true);
	}
Пример #4
0
		protected void OnPrefabButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			//Debug.Log("Prefab");
			//interactionMode = VoxInteractionMode.Prefab;

			//interactionMode = VoxInteractionMode.Create;

			UsePrefab = button.isSelected;

			if (!UsePrefab) PrefabIndex = 0;
			else PrefabIndex = 1;

			//AddMode = false;
		}
Пример #5
0
		protected void OnPaintButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			//Debug.Log("Painting");
			//interactionMode = VoxInteractionMode.PaintBlocks;
			//AddMode = false;

			if (button.isSelected)
			{
				interactionMode = VoxInteractionMode.Paint;

				PaintButton.isSelected = true;
				AddButton.isSelected = false;
				SubtractButton.isSelected = false;
			}
			else
			{
				interactionMode = VoxInteractionMode.Create;

				if (AddMode)
				{
					AddButton.isSelected = true;
					SubtractButton.isSelected = false;
				}
				else
				{
					AddButton.isSelected = false;
					SubtractButton.isSelected = true;
				}
			}
		}
Пример #6
0
		protected void OnSubtractButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			//Debug.Log("Subtracting");
			//interactionMode = VoxInteractionMode.SubtractBlocks;

			interactionMode = VoxInteractionMode.Create;

			AddMode = false;

			SubtractButton.isSelected = true;
			AddButton.isSelected = false;
			PaintButton.isSelected = false;
		}
Пример #7
0
		public void SetParentButton(VoxMenuButton button)
		{
			parentButton = button;
		}
Пример #8
0
		protected void OnNewButton(VoxMenuButton button, bool state)
		{
			WorldName = "VoxWorld";

			NewWorld();
		}
Пример #9
0
	protected void OnToggleMusicButton(VoxMenuButton button, bool state)
	{
		if (!state) return;

		if (button.isSelected)
		{
			backgroundMusic.enabled = true;
			if(!backgroundMusic.isPlaying) backgroundMusic.Play();
		}
		else
		{
			backgroundMusic.Stop();
			backgroundMusic.enabled = false;
		}
	}
Пример #10
0
		protected void OnDrawStraightButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			drawStraight = button.isSelected;
		}
Пример #11
0
		protected void OnColorMenu(VoxMenuButton button, bool state)
		{
			if (!state) return;
		}
Пример #12
0
		protected void OnEyedropper(VoxMenuButton button, bool state)
		{
			if (!state) return;

			EnableEyeDropper = true;

			mainMenu.toolTipText.text = "Click a block to pick color";
		}
Пример #13
0
		protected void OnButtonSelect(VoxMenuButton button, bool state)
		{
			if (!state) return;

			SetColor(button.GetColor());
		}
Пример #14
0
	protected void OnToggleWater(VoxMenuButton button, bool state)
	{
		if (!state) return;

		ToggleWater(button.isSelected);
	}
Пример #15
0
		protected void OnQuitButton(VoxMenuButton button, bool state)
		{
			if (!state) return;

			ShowConfirmQuitMenu();
		}
Пример #16
0
		protected void LateUpdate()
		{
			if (showMenu)
			{
				canSelectTimer -= Time.deltaTime;
				
				var select = false;
				if (canSelectTimer < 0) select = VoxInput.GetSelectDown() || Input.GetButtonDown(VoxInput.rightShoulder) || Input.GetButtonDown(VoxInput.ButtonA);

				var doubleClick = false;

				if (doubleClickTimer <= doubleClickDelay)
				{
					if (select) doubleClick = true;
				}
				else
				{
					if (select)
					{
						doubleClickTimer = 0f;
					}
				}

				doubleClickTimer += Time.deltaTime;


				var rayHit = false;
				var ray = VoxManager.ViewRay;
				RaycastHit hit;

				var submenuOpen = IsSubmenuOpen();

				foreach (var button in menuButtons)
				{
					if (!submenuOpen)
					{
						if (button.RayCast(ray, out hit, 25f))
						{
							rayHit = true;
							//HighlightButtons(false);

							if (highlightedButton == null)
							{
								button.Highlight(true);
								if (!submenuOpen) toolTipText.text = button.toolTip;
								highlightedButton = button;
							}
							else if (highlightedButton != button)
							{
								button.Highlight(true);
								if(!submenuOpen) toolTipText.text = button.toolTip;
								highlightedButton = button;
							}

							if (select) button.Select(true);
							if (doubleClick) button.DoubleClick();
						}
						else
						{
							if (highlightedButton != null)
							{
								if (button == highlightedButton) highlightedButton = null;
							}
							button.Highlight(false);
						}
					}
				}

				if (!submenuOpen && !rayHit)
				{
					toolTipText.text = "";
				}

				if (!submenuOpen && !rayHit && select)
				{
					PlayClip(EVoxMenuSound.MenuClose);
					TryClose();
				}
			}
			else
			{
				//if (doubleClick && Crosshair.CanDoubleClickToOpenMenu) ShowMenu(true);
			}
		}
Пример #17
0
	protected void OnNextSong(VoxMenuButton button, bool state)
	{
		if (!state) return;

		NextSong();
	}
Пример #18
0
		protected void OnBrushButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			//Debug.Log("Prefab");
			//interactionMode = VoxInteractionMode.Prefab;

			//interactionMode = VoxInteractionMode.Create;

			//UsePrefab = button.isSelected;

			//if (!UsePrefab) PrefabIndex = 0;
			//else PrefabIndex = 1;

			var newIndex = 0;

			if (int.TryParse(button.description, out newIndex))
			{
				PrefabIndex = newIndex;
			}

			//AddMode = false;
		}
Пример #19
0
		protected void OnTeleportButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			//Debug.Log("Adding");

			//interactionMode = VoxInteractionMode.AddBlocks;

			interactionMode = VoxInteractionMode.Teleport;

			AddButton.isSelected = false;
			SubtractButton.isSelected = false;
			PaintButton.isSelected = false;
			//PrefabButton.isSelected = false;
		}
Пример #20
0
		protected void OnPaintUsingPlanesButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			paintUsingConstructionPlanes = button.isSelected;
		}
Пример #21
0
		protected void OnDoubleClickLayerButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			doubleClickToIncreaseHeight = button.isSelected;
		}
Пример #22
0
	protected void OnToggleAA(VoxMenuButton button, bool state)
	{
		if (!state) return;

		AAEnabled = !button.isSelected;

		if (AAEnabled)
		{
			// OVRManager.instance.eyeTextureAntiAliasing = OVRManager.RenderTextureAntiAliasing._2;
		}
		else
		{
			// OVRManager.instance.eyeTextureAntiAliasing = OVRManager.RenderTextureAntiAliasing._1;
		}

		//ovrManager.gameObject.SetActive(false);
		//ovrManager.gameObject.SetActive(true);

	}
Пример #23
0
		protected void OnCreateAtFixedDistanceButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			createAtFixedDistance = button.isSelected;
		}
Пример #24
0
		protected void OnLoadButton(VoxMenuButton button, bool state)
		{
			Debug.Log("Loading World");

			WorldName = "VoxWorld" + button.toolTip;

			LoadAll();
		}