Exemplo n.º 1
0
		protected void OnSaveButton(VoxMenuButton button, bool state)
		{
			Debug.Log("Saving World");
			WorldName = "VoxWorld" + button.toolTip;

			SaveAll();
		}
Exemplo n.º 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;

	}
Exemplo n.º 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);
	}
Exemplo n.º 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;
		}
Exemplo n.º 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;
				}
			}
		}
Exemplo n.º 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;
		}
Exemplo n.º 7
0
		public void SetParentButton(VoxMenuButton button)
		{
			parentButton = button;
		}
Exemplo n.º 8
0
		protected void OnNewButton(VoxMenuButton button, bool state)
		{
			WorldName = "VoxWorld";

			NewWorld();
		}
Exemplo n.º 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;
		}
	}
Exemplo n.º 10
0
		protected void OnDrawStraightButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			drawStraight = button.isSelected;
		}
Exemplo n.º 11
0
		protected void OnColorMenu(VoxMenuButton button, bool state)
		{
			if (!state) return;
		}
Exemplo n.º 12
0
		protected void OnEyedropper(VoxMenuButton button, bool state)
		{
			if (!state) return;

			EnableEyeDropper = true;

			mainMenu.toolTipText.text = "Click a block to pick color";
		}
Exemplo n.º 13
0
		protected void OnButtonSelect(VoxMenuButton button, bool state)
		{
			if (!state) return;

			SetColor(button.GetColor());
		}
Exemplo n.º 14
0
	protected void OnToggleWater(VoxMenuButton button, bool state)
	{
		if (!state) return;

		ToggleWater(button.isSelected);
	}
Exemplo n.º 15
0
		protected void OnQuitButton(VoxMenuButton button, bool state)
		{
			if (!state) return;

			ShowConfirmQuitMenu();
		}
Exemplo n.º 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);
			}
		}
Exemplo n.º 17
0
	protected void OnNextSong(VoxMenuButton button, bool state)
	{
		if (!state) return;

		NextSong();
	}
Exemplo n.º 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;
		}
Exemplo n.º 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;
		}
Exemplo n.º 20
0
		protected void OnPaintUsingPlanesButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			paintUsingConstructionPlanes = button.isSelected;
		}
Exemplo n.º 21
0
		protected void OnDoubleClickLayerButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			doubleClickToIncreaseHeight = button.isSelected;
		}
Exemplo n.º 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);

	}
Exemplo n.º 23
0
		protected void OnCreateAtFixedDistanceButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			createAtFixedDistance = button.isSelected;
		}
Exemplo n.º 24
0
		protected void OnLoadButton(VoxMenuButton button, bool state)
		{
			Debug.Log("Loading World");

			WorldName = "VoxWorld" + button.toolTip;

			LoadAll();
		}