示例#1
0
文件: World.cs 项目: Quixotic7/VR-Vox
		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
文件: World.cs 项目: Quixotic7/VR-Vox
		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
文件: World.cs 项目: Quixotic7/VR-Vox
		protected void OnLoadButton(VoxMenuButton button, bool state)
		{
			Debug.Log("Loading World");

			WorldName = "VoxWorld" + button.toolTip;

			LoadAll();
		}