예제 #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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxMenu.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		protected void OnPaintUsingPlanesButton(VoxMenuButton button, bool state)
		{
			if (state == false) return;

			paintUsingConstructionPlanes = button.isSelected;
		}
예제 #21
0
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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
파일: VoxUser.cs 프로젝트: Quixotic7/VR-Vox
		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();
		}